:root {
  --deskora-accent: #4f46e5;
  --deskora-accent-strong: #3730a3;
  --deskora-accent-soft: #eef2ff;
  --deskora-violet: #087ce5;
  --deskora-cyan: #0891b2;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-raised: #ffffff;
  --text: #111827;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

[data-theme="dark"] {
  --surface: #111827;
  --surface-soft: #0b1220;
  --surface-raised: #172033;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #2a3850;
  --gray-950: #f8fafc;
  --gray-900: #f8fafc;
  --gray-800: #e2e8f0;
  --gray-700: #cbd5e1;
  --gray-600: #a8b5c7;
  --gray-500: #94a3b8;
  --gray-400: #64748b;
  --gray-300: #3b4b64;
  --gray-200: #2a3850;
  --gray-100: #1c2940;
  --gray-50: #162238;
  --white: #111827;
  color-scheme: dark;
}

.deskora-author-line { margin: 16px 0 0; color: var(--text-muted); font-size: 11px; text-align: center; }
.deskora-sidebar-author { margin: 12px 10px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.55); font-size: 9px; line-height: 1.45; }
.deskora-sidebar-author strong { color: rgba(255,255,255,.82); font-size: 10px; }
.confidential-badge { display: inline-flex; margin: 0 0 12px 8px; color: #9f1239; background: #fff1f2; }
.participant-manager, .signature-manager, .signature-picker, .agenda-list { display: grid; }
.participant-card, .signature-manager-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--border); }
.participant-card strong, .participant-card span, .participant-card small, .signature-manager-row strong, .signature-manager-row span, .signature-manager-row small { display: block; }
.participant-card span, .participant-card small, .signature-manager-row span, .signature-manager-row small { margin-top: 3px; color: var(--text-muted); }
.signature-manager-row { grid-template-columns: 120px minmax(0,1fr) auto; }
.signature-manager-row > img { width: 110px; height: 58px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: white; }
.signature-choice { width: 100%; display: grid; grid-template-columns: 145px 1fr; gap: 14px; align-items: center; padding: 12px; border: 0; border-bottom: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; }
.signature-choice:hover { background: var(--deskora-accent-soft); }
.signature-choice img { width: 135px; height: 62px; object-fit: contain; border-radius: 7px; background: white; }
.signature-choice strong, .signature-choice small { display: block; }
.signature-choice small { color: var(--text-muted); }
.appointment-badge { color: #0062c4; background: #e1f1ff; }
.calendar-event.appointment { color: #0062c4; border-left-color: #087ce5; background: #edf6ff; }
.agenda-row { width: 100%; display: grid; grid-template-columns: 160px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; }
.agenda-row:hover { background: var(--deskora-accent-soft); }
.agenda-row time { color: var(--text-muted); font-size: 11px; }
.agenda-row strong, .agenda-row small { display: block; }
.agenda-row small { color: var(--text-muted); }
.deskora-fold-mark, .deskora-punch-mark { position: absolute; left: 0; z-index: 3; width: 5mm; height: 0; border-top: .25mm solid #94a3b8; pointer-events: none; }
.deskora-fold-mark.fold-one { top: 105mm; }
.deskora-fold-mark.fold-two { top: 210mm; }
.deskora-punch-mark { top: 148.5mm; width: 7mm; border-color: #64748b; }
.layout-designer { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 24px; }
.layout-preview { display: grid; place-items: center; padding: 18px; border-radius: 12px; background: #e8edf5; }
.layout-preview-page { position: relative; width: 252px; height: 356px; background: white; box-shadow: 0 10px 30px rgba(15,23,42,.18); }
.layout-preview-page > span { position: absolute; left: 10%; color: #64748b; font-size: 8px; }
.lp-logo { top: 7%; width: 80%; height: 10%; border: 1px dashed #cbd5e1; padding: 7px; }
.lp-address { height: 18%; border: 2px solid #818cf8; padding: 7px; color: #0062c4 !important; background: #eef2ff; }
.lp-meta { top: 19%; left: 63% !important; }
.lp-subject { width: 80%; border-bottom: 2px solid #334155; padding-bottom: 3px; color: #111827 !important; font-weight: 700; }
.lp-body { width: 72%; line-height: 1.8; }
.preflight-list { display: grid; gap: 9px; }
.preflight-row { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 11px; border-radius: 9px; }
.preflight-row span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.preflight-row.error { color: #9f1239; background: #fff1f2; }
.preflight-row.error span { color: white; background: #e11d48; }
.preflight-row.warning { color: #92400e; background: #fffbeb; }
.preflight-row.warning span { color: white; background: #f59e0b; }
.preflight-success { padding: 28px; text-align: center; }
.preflight-success > span { width: 58px; height: 58px; display: grid; place-items: center; margin: auto; border-radius: 50%; color: white; background: #10b981; font-size: 28px; }
.advanced-search-bar { display: grid; grid-template-columns: minmax(300px,1fr) 190px 145px 145px; gap: 9px; }
.advanced-search-bar .command-search { min-width: 0; }
.path-picker { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 14px; }
.about-deskora { display: flex; gap: 18px; align-items: center; }
.about-deskora img { width: 72px; height: 72px; border-radius: 17px; }
.about-deskora h3, .about-deskora p { margin: 3px 0; }
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.encryption-status { display: flex; gap: 13px; align-items: flex-start; padding: 15px; border: 1px solid #a7f3d0; border-radius: 12px; color: #065f46; background: #ecfdf5; }
.encryption-status > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: white; background: #10b981; }
.encryption-status p { margin: 4px 0 0; color: #047857; }
.retention-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.retention-row { display: grid; gap: 3px; padding: 10px 3px; border-bottom: 1px solid var(--border); }
.retention-row span, .retention-row small { color: var(--text-muted); }

@media (max-width: 1050px) {
  .layout-designer, .security-grid, .retention-columns { grid-template-columns: 1fr; }
  .advanced-search-bar { grid-template-columns: 1fr 1fr; }
}

body { background: var(--surface-soft); color: var(--text); }
.deskora-shell { --sidebar-width: 274px; }
.deskora-shell .sidebar { overflow-y: auto; padding-top: 18px; background: linear-gradient(180deg, #111936 0%, #171942 52%, #111827 100%); scrollbar-width: thin; }
.deskora-shell .sidebar-brand { position: sticky; top: -18px; z-index: 3; margin: 0 -14px 8px; padding: 18px 23px 19px; background: rgba(17, 25, 54, .97); backdrop-filter: blur(12px); }
.deskora-shell .brand-mark, .deskora-auth .brand-mark { border-radius: 14px; background: linear-gradient(145deg, #248bec, #0062c4 55%, #087ce5); box-shadow: 0 12px 28px rgba(79, 70, 229, .32); }
.sidebar-logo { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(2, 8, 23, .34)); }
.loading-logo { display: block; width: 76px; height: 76px; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(2, 8, 23, .34)); }
.deskora-shell .nav-button { min-height: 38px; margin-bottom: 1px; }
.deskora-shell .nav-button.active { background: linear-gradient(90deg, rgba(99, 102, 241, .35), rgba(124, 58, 237, .14)); box-shadow: inset 3px 0 0 #818cf8; }
.deskora-shell .nav-group-label { padding-top: 15px; }
.deskora-shell .topbar { border-color: var(--border); background: color-mix(in srgb, var(--surface) 91%, transparent); }
.topbar-leading { display: flex; align-items: center; gap: 10px; }
.global-search-trigger { min-width: 250px; height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); background: var(--surface-soft); text-align: left; }
.global-search-trigger span:nth-child(2) { flex: 1; }
.global-search-trigger kbd { padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); font-size: 10px; }
.panel, .stat-card, .quick-action, .modal, .modal-header, .modal-footer, .version-item, .mandant-card { border-color: var(--border); background: var(--surface); color: var(--text); }
.data-table th { border-color: var(--border); background: var(--surface-soft); color: var(--text-muted); }
.data-table td, .panel-header, .settings-row, .activity-item { border-color: var(--border); }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--deskora-accent-soft) 45%, var(--surface)); }
input, select, textarea { border-color: var(--border); color: var(--text); background: var(--surface-raised); }
input[readonly] { background: var(--surface-soft); }
.btn { border-color: var(--border); color: var(--text); background: var(--surface-raised); }
.btn:hover { border-color: #818cf8; background: var(--deskora-accent-soft); color: #312e81; }
[data-theme="dark"] .btn:hover { color: #e0e7ff; background: #252d59; }
.btn-primary { border-color: var(--deskora-accent); color: white; background: linear-gradient(145deg, #248bec, #4f46e5); box-shadow: 0 7px 17px rgba(79, 70, 229, .2); }
.btn-primary:hover { border-color: var(--deskora-accent-strong); color: white; background: linear-gradient(145deg, #4f46e5, #3730a3); }
.btn-danger-subtle { color: #b42318; background: #fff7f6; }
.full-width { width: 100%; }
.btn-lg { min-height: 46px; }
.flex-spacer { flex: 1; }
.compact-select { width: auto; min-width: 170px; }
.inline-fields { display: grid; grid-template-columns: 1fr 100px; gap: 8px; }
.form-grid.compact { gap: 9px; }
.table-scroll { overflow: auto; }
.select-col { width: 32px; }

.app-loading {
  padding: 24px;
  background: radial-gradient(circle at 50% 12%, rgba(37, 99, 235, .33), transparent 35%), linear-gradient(145deg, #030a18, #071a37 52%, #0a2a58);
}
.deskora-splash { width: min(420px, 90vw); display: grid; justify-items: center; color: white; text-align: center; animation: splash-enter .65s cubic-bezier(.22,.9,.32,1) both; }
.splash-mark-wrap { width: 112px; height: 112px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid rgba(255,255,255,.11); border-radius: 32px; background: rgba(255,255,255,.055); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 28px 60px rgba(0,0,0,.25); backdrop-filter: blur(16px); }
.deskora-wordmark { color: #0f172a; font-size: 25px; font-weight: 850; letter-spacing: .19em; line-height: 1; }
.deskora-wordmark span { color: #1687ff; }
.deskora-wordmark-light { color: white; }
.deskora-splash .deskora-wordmark { color: white; font-size: 29px; }
.deskora-splash > p { margin: 13px 0 24px; color: rgba(255,255,255,.7); font-size: 13px; letter-spacing: .045em; }
.deskora-splash > small { margin-top: 15px; color: rgba(255,255,255,.43); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.splash-progress { width: 190px; height: 3px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.12); }
.splash-progress span { width: 42%; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #1687ff, #60a5fa); animation: splash-progress 1.15s ease-in-out infinite alternate; }
@keyframes splash-enter { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes splash-progress { from { transform: translateX(-100%); } to { transform: translateX(238%); } }

.deskora-auth { overflow: auto; padding: 24px; background: radial-gradient(circle at 12% 8%, rgba(37, 99, 235, .19), transparent 31%), linear-gradient(145deg, #eaf1fb, #f8fafc 54%, #e9f1fb); }
[data-theme="dark"] .deskora-auth { background: radial-gradient(circle at 12% 8%, rgba(37, 99, 235, .22), transparent 31%), linear-gradient(145deg, #030712, #0b1220); }
.deskora-login-screen { width: min(1180px, 100%); min-height: min(690px, calc(100vh - 48px)); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(430px, .92fr); overflow: hidden; border: 1px solid rgba(148,163,184,.22); border-radius: 28px; background: var(--surface); box-shadow: 0 34px 90px rgba(15, 23, 42, .22); }
.deskora-login-visual { position: relative; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 46px 50px 34px; color: white; background-image: linear-gradient(155deg, rgba(2, 8, 23, .78), rgba(5, 24, 55, .42) 50%, rgba(10, 37, 86, .7)), url("deskora-login-bg-v2.jpg"); background-position: center; background-size: cover; }
.deskora-login-visual::after { position: absolute; inset: 0; content: ""; background: radial-gradient(circle at 72% 16%, rgba(96,165,250,.17), transparent 27%), linear-gradient(180deg, transparent 64%, rgba(2,8,23,.28)); pointer-events: none; }
.deskora-login-visual > * { position: relative; z-index: 1; }
.login-brand-lockup, .login-mobile-brand { display: flex; align-items: center; gap: 14px; }
.login-brand-lockup img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(0,0,0,.3)); }
.login-visual-copy { width: min(520px, 100%); margin: auto 0; padding: 54px 0 48px; }
.login-eyebrow, .login-form-kicker { display: block; color: #60a5fa; font-size: 10px; font-weight: 800; letter-spacing: .19em; }
.login-visual-copy h1 { margin: 16px 0 18px; color: white; font-size: clamp(38px, 4.1vw, 59px); line-height: 1.02; letter-spacing: -.055em; }
.login-visual-copy > p { width: min(460px, 100%); margin: 0; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.7; }
.login-feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; }
.login-feature-list > div { padding: 15px 16px; border: 1px solid rgba(255,255,255,.11); border-radius: 14px; background: rgba(4,14,34,.31); backdrop-filter: blur(9px); }
.login-feature-list strong, .login-feature-list span { display: block; }
.login-feature-list strong { color: white; font-size: 12px; }
.login-feature-list span { margin-top: 4px; color: rgba(255,255,255,.58); font-size: 10px; line-height: 1.45; }
.login-version { margin: 0; color: rgba(255,255,255,.46); font-size: 9px; letter-spacing: .055em; }
.deskora-login-form-panel { min-width: 0; display: grid; place-items: center; overflow-y: auto; padding: 46px 58px; background: var(--surface); }
.deskora-auth-card { width: min(100%, 430px); padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.deskora-auth-card h2 { margin: 12px 0 8px; color: var(--text); font-size: 32px; line-height: 1.15; letter-spacing: -.035em; }
.deskora-auth-card .auth-lead { margin-bottom: 28px; color: var(--text-muted); }
.login-mobile-brand { display: none; margin-bottom: 34px; }
.login-mobile-brand img { width: 46px; height: 46px; object-fit: contain; }
.deskora-auth-card input { min-height: 48px; border-radius: 11px; }
.deskora-auth-card .btn-primary { min-height: 50px; border-radius: 11px; background: linear-gradient(135deg, #1677e8, #0759c7); box-shadow: 0 12px 24px rgba(22,119,232,.22); }
.deskora-auth-card .btn-primary:hover { background: linear-gradient(135deg, #086ad9, #064ba8); }
.login-security-note { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; margin-top: 24px; padding: 12px 13px; border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: 12px; color: var(--text-muted); background: var(--surface-soft); }
.login-security-note > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #087a55; background: #d9f7e9; font-size: 11px; font-weight: 900; }
.login-security-note p { margin: 0; font-size: 10px; line-height: 1.5; }
.login-security-note strong { display: block; color: var(--text); font-size: 10px; }
.deskora-auth-card .deskora-author-line { margin-top: 16px; color: var(--text-muted); font-size: 9px; letter-spacing: .03em; }

@media (max-width: 900px) {
  .deskora-auth { align-items: start; }
  .deskora-login-screen { min-height: 0; grid-template-columns: 1fr; }
  .deskora-login-visual { min-height: 280px; padding: 32px; }
  .login-brand-lockup { display: none; }
  .login-visual-copy { padding: 10px 0 22px; }
  .login-visual-copy h1 { font-size: 38px; }
  .login-feature-list { display: none; }
  .deskora-login-form-panel { padding: 42px 34px; }
  .login-mobile-brand { display: flex; }
}

@media (max-width: 560px) {
  .deskora-auth { padding: 0; }
  .deskora-login-screen { border: 0; border-radius: 0; }
  .deskora-login-visual { min-height: 230px; padding: 26px 24px; }
  .login-visual-copy h1 { margin: 10px 0; font-size: 31px; }
  .login-visual-copy > p { font-size: 12px; }
  .deskora-login-form-panel { padding: 38px 24px; }
  .deskora-auth-card h2 { font-size: 28px; }
}

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .75fr); gap: 18px; }
.modern-stat { border-top: 3px solid transparent; border-image: linear-gradient(90deg, #248bec, #087ce5) 1; }
.deadline-row { width: 100%; display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: start; padding: 11px 5px; border: 0; border-bottom: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; }
.deadline-row:last-child { border-bottom: 0; }
.deadline-row strong, .deadline-row small { display: block; }
.deadline-row small { margin-top: 2px; color: var(--text-muted); }
.deadline-dot, .due-indicator { width: 9px; height: 9px; display: inline-block; margin-top: 5px; border-radius: 50%; background: #94a3b8; }
.deadline-row.overdue .deadline-dot, .due-indicator.overdue { background: #e11d48; box-shadow: 0 0 0 4px rgba(225, 29, 72, .12); }
.deadline-row.today .deadline-dot, .due-indicator.today { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .14); }
.due-indicator.done { background: #10b981; }

.favorite-button { width: 28px; height: 28px; padding: 0; border: 0; color: #94a3b8; background: transparent; font-size: 17px; }
.favorite-button.active { color: #f59e0b; }
.count-chip, .tag, .attachment-chip { display: inline-flex; align-items: center; padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); background: var(--surface-soft); font-size: 10px; }
.count-chip.attention { color: #b45309; border-color: #f8d38b; background: #fffbeb; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 15px; }
.tag { color: #0062c4; border-color: #c7d2fe; background: #eef2ff; }
.case-open, .task-open { color: #2563eb; background: #dbeafe; }
.case-dormant { color: #a16207; background: #fef3c7; }
.case-done, .task-done { color: #047857; background: #d1fae5; }
.case-archived, .task-cancelled { color: #64748b; background: #e2e8f0; }
.priority-low { color: #64748b; background: #f1f5f9; }
.priority-normal { color: #2563eb; background: #dbeafe; }
.priority-high { color: #c2410c; background: #ffedd5; }
.priority-urgent { color: #be123c; background: #ffe4e6; }
.badge.warning { color: #b45309; background: #fef3c7; }
.badge.active { color: #047857; background: #d1fae5; }

.case-detail-grid, .customer-file-grid { display: grid; grid-template-columns: 325px minmax(0, 1fr); gap: 18px; align-items: start; }
.case-summary { position: sticky; top: 88px; }
.case-reference { display: inline-flex; margin-bottom: 12px; padding: 5px 9px; border-radius: 7px; color: #0062c4; background: #eef2ff; font-family: Consolas, monospace; font-weight: 700; }
.case-summary h2, .customer-card h2 { margin: 0 0 8px; font-size: 20px; }
.case-summary p, .customer-card p { color: var(--text-muted); }
.detail-list { display: grid; gap: 10px; margin: 20px 0 0; }
.detail-list > div { display: grid; grid-template-columns: 105px 1fr; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.detail-list dt { color: var(--text-muted); font-size: 11px; }
.detail-list dd { margin: 0; font-weight: 600; }
.text-button { padding: 0; border: 0; color: var(--deskora-accent); background: transparent; font-weight: 700; }
.participant { display: flex; gap: 9px; align-items: center; padding: 8px 0; }
.avatar.small { width: 30px; height: 30px; font-size: 10px; }
.participant strong, .participant small { display: block; }
.participant small { color: var(--text-muted); }
.case-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.timeline { position: relative; display: grid; }
.timeline::before { content: ""; position: absolute; left: 18px; top: 18px; bottom: 18px; width: 1px; background: var(--border); }
.timeline-entry { position: relative; display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border: 0; border-bottom: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; }
.timeline-icon, .file-icon { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #c7d2fe; border-radius: 10px; color: #4f46e5; background: #eef2ff; }
.timeline-entry strong, .timeline-entry small, .file-row strong, .file-row small { display: block; }
.timeline-entry small, .file-row small { margin-top: 2px; color: var(--text-muted); }
.timeline-entry time { color: var(--text-muted); font-size: 10px; }
.file-row { width: 100%; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border: 0; border-bottom: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; }
.customer-avatar { --customer-color: #4f6bed; width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 18px; color: white; background: var(--customer-color); font-size: 18px; font-weight: 800; }
.customer-note { margin-top: 16px; padding: 12px; border-radius: 9px; color: var(--text-muted); background: var(--surface-soft); white-space: pre-wrap; }

.segmented { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.segmented button { min-height: 31px; padding: 4px 12px; border: 0; border-radius: 6px; color: var(--text-muted); background: transparent; }
.segmented button.active { color: #0062c4; background: var(--surface); box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }
.calendar-panel { overflow: hidden; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays > div { padding: 10px; border-right: 1px solid var(--border); color: var(--text-muted); background: var(--surface-soft); font-size: 10px; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; min-height: 128px; padding: 8px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--surface); }
.calendar-day.outside { background: var(--surface-soft); }
.calendar-day.holiday { background: color-mix(in srgb, #fff7ed 62%, var(--surface)); }
.calendar-day.today { box-shadow: inset 0 0 0 2px #248bec; }
.calendar-date { width: 26px; height: 26px; border: 0; border-radius: 50%; color: var(--text); background: transparent; font-weight: 700; }
.today .calendar-date { color: white; background: #4f46e5; }
.holiday-label { position: absolute; top: 10px; right: 8px; color: #c2410c; font-size: 8px; }
.calendar-events { display: grid; gap: 3px; margin-top: 5px; }
.calendar-event { overflow: hidden; padding: 4px 6px; border: 0; border-left: 3px solid #248bec; border-radius: 4px; color: #3730a3; background: #eef2ff; font-size: 9px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event.overdue { border-color: #e11d48; color: #9f1239; background: #fff1f2; }
.calendar-event.pre { border-color: #f59e0b; color: #92400e; background: #fffbeb; }
.calendar-more { color: var(--text-muted); font-size: 8px; }

.command-search { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid #a5b4fc; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 4px rgba(99, 102, 241, .09); }
.command-search span { color: #248bec; font-size: 24px; }
.command-search input { min-height: 34px; padding: 0; border: 0; box-shadow: none; font-size: 17px; }
.search-results { max-height: 520px; overflow: auto; margin-top: 14px; }
.search-result { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; gap: 11px; align-items: center; padding: 10px; border: 0; border-bottom: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; }
.search-result:hover { background: var(--deskora-accent-soft); }
.search-result-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #4f46e5; background: #eef2ff; }
.search-result strong, .search-result small { display: block; }
.search-result small { color: var(--text-muted); }

.upload-zone { display: flex; align-items: center; gap: 18px; min-height: 125px; padding: 22px; border: 2px dashed #a5b4fc; border-radius: 14px; background: color-mix(in srgb, #eef2ff 68%, var(--surface)); transition: .18s ease; }
.upload-zone.dragging { border-color: #4f46e5; background: #e0e7ff; transform: scale(1.005); }
.upload-zone.compact { display: grid; place-items: center; text-align: center; }
.upload-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, #248bec, #087ce5); font-size: 23px; }
.upload-zone h3 { margin: 0 0 4px; }
.upload-zone p { margin: 0; color: var(--text-muted); }
.upload-zone .btn { margin-left: auto; }
.document-type-icon { width: 34px; height: 28px; display: inline-grid; place-items: center; border-radius: 6px; color: #0062c4; background: #eef2ff; font-size: 8px; font-weight: 900; }
.inbox-new { color: #2563eb; background: #dbeafe; }
.inbox-processing { color: #b45309; background: #fef3c7; }
.inbox-done { color: #047857; background: #d1fae5; }
.inbox-upload-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.document-review-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); gap: 18px; }
.document-preview { min-height: 650px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #dbe2ea; }
.document-preview iframe { width: 100%; height: 650px; border: 0; background: white; }
.review-actions { display: grid; gap: 8px; margin-top: 14px; }
.import-summary { display: flex; justify-content: space-between; gap: 16px; margin: 18px 0 10px; padding: 11px; border-radius: 9px; background: var(--surface-soft); }
.import-table { max-height: 360px; }

.mail-direction { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #2563eb; background: #dbeafe; font-weight: 900; }
.mail-direction.received { color: #047857; background: #d1fae5; }
.mail-direction.prepared { color: #b45309; background: #fef3c7; }
.email-prepared { color: #b45309; background: #fef3c7; }
.email-sent { color: #2563eb; background: #dbeafe; }
.email-received { color: #047857; background: #d1fae5; }
.mail-import-list { display: grid; }
.mail-import-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.mail-import-row input { width: 16px; min-height: 16px; }
.mail-import-row strong, .mail-import-row small { display: block; }
.mail-import-row small { color: var(--text-muted); }
.email-body { min-height: 180px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.attachment-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.email-attachment-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 240px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.email-attachment-option { display: flex; align-items: flex-start; gap: 9px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.email-attachment-option input { width: 16px; min-height: 16px; margin-top: 2px; }
.email-attachment-option span, .email-attachment-option strong, .email-attachment-option small { display: block; min-width: 0; }
.email-attachment-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-attachment-option small { margin-top: 2px; color: var(--text-muted); }

.pdf-tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.pdf-tool-card { min-height: 150px; display: grid; align-content: center; justify-items: start; gap: 7px; padding: 20px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: var(--surface); text-align: left; box-shadow: 0 3px 10px rgba(15, 23, 42, .04); transition: .18s ease; }
.pdf-tool-card:hover { border-color: #a5b4fc; background: #f7f7ff; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(79, 70, 229, .11); }
.pdf-tool-card > span { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; color: #4f46e5; background: #eef2ff; font-weight: 900; }
.pdf-tool-card strong { font-size: 14px; }
.pdf-tool-card small { color: var(--text-muted); }
.processing-line { display: flex; align-items: center; gap: 10px; margin-top: 15px; padding: 11px; border-radius: 9px; background: var(--surface-soft); }
.spinner { width: 17px; height: 17px; border: 2px solid #c7d2fe; border-top-color: #4f46e5; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.template-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.template-card-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; color: #4f46e5; background: #eef2ff; }
.template-card strong, .template-card span, .template-card small { display: block; }
.template-card span, .template-card small { color: var(--text-muted); }
.template-editor.advanced { min-height: 420px; }
.version-details { margin-top: 15px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.version-row { width: 100%; display: block; padding: 8px; border: 0; border-bottom: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; }
.permission-grid, .check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.permission-card { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.permission-card input { width: 16px; min-height: 16px; }
.diff-table del { color: #9f1239; background: #fff1f2; text-decoration: none; }
.diff-table ins { color: #047857; background: #ecfdf5; text-decoration: none; }
.document-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.document-diff > div { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; }
.document-diff pre { max-height: 520px; overflow: auto; white-space: pre-wrap; }

.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { position: sticky; top: 90px; display: grid; gap: 4px; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.settings-nav a { padding: 8px 10px; border-radius: 7px; color: var(--text-muted); text-decoration: none; }
.settings-nav a:hover { color: #0062c4; background: #eef2ff; }

.deskora-editor-layout { display: grid; grid-template-columns: 300px minmax(760px, 1fr); gap: 16px; align-items: start; }
.deskora-editor-stage { min-width: 0; }
.word-toolbar { position: sticky; top: 70px; z-index: 11; border: 1px solid var(--border); border-radius: 11px 11px 0 0; background: var(--surface); box-shadow: 0 7px 20px rgba(15, 23, 42, .08); }
.toolbar-row-main, .toolbar-row-secondary { min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 6px 8px; }
.toolbar-row-main { border-bottom: 1px solid var(--border); }
.word-toolbar.readonly .tool-button, .word-toolbar.readonly select:not(#editor-zoom), .word-toolbar.readonly input { pointer-events: none; opacity: .55; }
.tool-button.active { color: #0062c4; border-color: #a5b4fc; background: #eef2ff; }
.font-select { width: 138px; }
.size-select { width: 68px; }
.toolbar-number { display: inline-flex; align-items: center; gap: 4px; margin: 0 5px; color: var(--text-muted); font-size: 10px; }
.toolbar-number input { width: 50px; min-height: 29px; padding: 3px 6px; }
.toolbar-search { position: relative; width: 220px; }
.toolbar-search input { min-height: 31px; padding: 4px 8px; font-size: 10px; }
#editor-snippet-results { position: absolute; top: 34px; left: 0; right: 0; z-index: 20; max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 12px 25px rgba(15, 23, 42, .15); }
#editor-snippet-results:empty { display: none; }
#editor-snippet-results button { width: 100%; display: block; padding: 8px; border: 0; border-bottom: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; }
#editor-snippet-results strong, #editor-snippet-results small { display: block; }
#editor-snippet-results small { color: var(--text-muted); }
.page-status { padding: 4px 9px; border-radius: 999px; color: #0062c4; background: #eef2ff; font-size: 10px; font-weight: 700; }
.editor-ruler { position: relative; height: 24px; overflow: hidden; border-inline: 1px solid var(--border); color: #64748b; background: linear-gradient(90deg, transparent 0, transparent 9px, #cbd5e1 10px) 0 0 / 10px 6px, var(--surface-soft); }
.editor-ruler > span { position: absolute; top: 4px; color: #4f46e5; font-size: 10px; }
.deskora-pages-stage { min-height: calc(100vh - 190px); overflow: auto; padding: 30px 26px 70px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 12px 12px; background: #d9dee7; }
#deskora-pages { width: max-content; margin: 0 auto; zoom: var(--editor-zoom, .9); }
.deskora-page { --page-margin-left: 25mm; --page-margin-right: 20mm; --page-margin-top: 20mm; --page-margin-bottom: 20mm; position: relative; width: 210mm; height: 297mm; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; margin: 0 auto 20mm; padding: var(--page-margin-top) var(--page-margin-right) var(--page-margin-bottom) var(--page-margin-left); overflow: hidden; color: #111827; background: white; box-shadow: 0 12px 30px rgba(15, 23, 42, .22); font-family: Arial, sans-serif; font-size: 11pt; line-height: 1.15; }
.page-badge { position: absolute; top: -10mm; right: 0; padding: 4px 9px; border-radius: 999px; color: white; background: rgba(15, 23, 42, .76); font-family: "Segoe UI", sans-serif; font-size: 9px; }
.deskora-page-header { min-width: 0; }
.deskora-letter-head { min-height: 29mm; display: grid; grid-template-columns: 1fr 67mm; gap: 12mm; }
.deskora-window-row { min-height: 46mm; display: grid; grid-template-columns: 90mm 1fr; gap: 12mm; margin-top: 2mm; }
.deskora-delivery-note { min-height: 4mm; padding-top: 2.6mm; font-size: 8.2pt; font-weight: 700; line-height: 1.15; color: #111827; }
.deskora-delivery-note:empty { min-height: 0; padding-top: 0; }
.deskora-delivery-note + .recipient-address { padding-top: 1.8mm; }
.deskora-letter-subject { min-height: 8mm; margin: 3mm 0 3mm; font-weight: 700; overflow-wrap: anywhere; }
.continuation-header { display: flex; justify-content: space-between; gap: 10mm; margin-bottom: 8mm; padding-bottom: 3mm; border-bottom: .3mm solid #cbd5e1; color: #64748b; font-size: 8pt; }
.deskora-page-body { min-height: 0; overflow: hidden; outline: none; caret-color: #111827; }
.deskora-page-body:focus { box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .25); }
.deskora-page-body p, .deskora-page-body div, .deskora-page-body blockquote { margin-top: 0; margin-bottom: 6pt; }
.deskora-page-body ul, .deskora-page-body ol { margin-top: 0; margin-bottom: 6pt; }
.deskora-page-footer { display: flex; justify-content: space-between; gap: 10mm; min-height: 7mm; padding-top: 2.5mm; border-top: .25mm solid #cbd5e1; color: #64748b; font-size: 7.5pt; }
.deskora-tab { display: inline-block; width: 12.5mm; white-space: pre; }
.embedded-image-block { min-height: 8mm; margin: 2mm 0 3mm !important; line-height: 0; }
.embedded-signature, .embedded-stamp { display: block; width: auto; height: auto; border: 0; background: transparent; object-fit: contain; object-position: left bottom; }
.embedded-signature { max-width: 50mm; max-height: 22mm; }
.embedded-stamp { max-width: 45mm; max-height: 28mm; }
.signature-upload-preview { min-height: 92px; display: grid; place-items: center; padding: 10px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--text-muted); background: #fff; }
.signature-upload-preview img { display: block; width: auto; height: auto; max-width: 100%; max-height: 110px; object-fit: contain; }
.editor-details { border: 1px solid var(--border); border-radius: 9px; }
.editor-details summary { padding: 9px; color: var(--text-muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.editor-details > div { padding: 0 9px 9px; }
.modal-xl { width: min(96vw, 1280px); }

@media (max-width: 1320px) {
  .deskora-editor-layout { grid-template-columns: 260px minmax(700px, 1fr); }
  .case-detail-grid, .customer-file-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .global-search-trigger { min-width: 190px; }
}

@media (max-width: 1100px) {
  .dashboard-grid, .case-detail-grid, .customer-file-grid, .template-grid, .document-review-grid, .settings-layout, .deskora-editor-layout { grid-template-columns: 1fr; }
  .case-summary, .settings-nav, .deskora-editor-layout .editor-side { position: static; }
  .settings-nav { grid-template-columns: repeat(3, 1fr); }
  .document-preview, .document-preview iframe { min-height: 480px; height: 480px; }
}

@media (max-width: 780px) {
  .global-search-trigger span:nth-child(2), .global-search-trigger kbd { display: none; }
  .global-search-trigger { min-width: 38px; width: 38px; }
  .calendar-grid, .calendar-weekdays { min-width: 760px; }
  .calendar-panel { overflow-x: auto; }
  .permission-grid, .check-grid, .template-grid, .document-diff, .email-attachment-picker { grid-template-columns: 1fr; }
  .upload-zone { display: grid; text-align: center; }
  .upload-zone .btn { margin: 0; }
}

@media print {
  body * { visibility: hidden !important; }
  #deskora-pages, #deskora-pages * { visibility: visible !important; }
  #deskora-pages { position: absolute; inset: 0 auto auto 0; zoom: 1 !important; }
  .deskora-page { width: 210mm; height: 297mm; margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .deskora-page:last-child { break-after: auto; page-break-after: auto; }
  .page-badge { display: none !important; }
}
