:root {
    --navy-950: #101a36;
    --navy-900: #172342;
    --navy-800: #20325f;
    --blue-700: #2859a6;
    --blue-600: #336fc2;
    --blue-100: #eaf2ff;
    --cyan-500: #29a3c8;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --canvas: #eef2f7;
    --text: #172033;
    --muted: #667085;
    --muted-2: #98a2b3;
    --border: #e3e8ef;
    --success: #178956;
    --success-bg: #eaf8f1;
    --warning: #a66208;
    --warning-bg: #fff5df;
    --danger: #c73e4b;
    --danger-bg: #fff0f1;
    --info: #2467b2;
    --info-bg: #eaf3ff;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 10px 30px rgba(16, 24, 40, .08);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--canvas);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) 1fr; }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #dbe5fb;
    background:
        radial-gradient(circle at 20% -10%, rgba(64, 111, 190, .38), transparent 36%),
        linear-gradient(180deg, var(--navy-900), var(--navy-950));
    border-right: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
    z-index: 20;
}
.brand { height: 84px; display: flex; align-items: center; gap: 13px; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-size: 22px; font-weight: 800; color: white; background: linear-gradient(145deg, #4b86df, #2c4f91); box-shadow: 0 8px 20px rgba(0,0,0,.22); }
.brand strong { display: block; color: white; font-size: 18px; letter-spacing: .08em; }
.brand span { display: block; margin-top: 1px; font-size: 11px; color: #9fb0d2; }
.main-nav { padding: 18px 14px; overflow-y: auto; }
.nav-caption { padding: 14px 12px 8px; color: #7388b2; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-item { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 13px; margin: 3px 0; border-radius: 11px; color: #b8c6e2; font-weight: 600; transition: .18s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); transform: translateX(2px); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(69,119,202,.72), rgba(52,92,158,.46)); box-shadow: inset 3px 0 0 #71a8ff; }
.nav-icon { width: 23px; height: 23px; display: grid; place-items: center; font-size: 17px; color: #91a5ce; }
.nav-item.active .nav-icon { color: #fff; }
.nav-badge { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 20px; text-align: center; font-size: 11px; background: rgba(255,255,255,.11); }
.sidebar-footer { margin-top: auto; padding: 16px; }
.support-card { display: flex; gap: 10px; align-items: center; padding: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.04); }
.support-dot { width: 9px; height: 9px; border-radius: 50%; background: #44d38a; box-shadow: 0 0 0 4px rgba(68,211,138,.12); }
.support-card strong, .support-card span { display: block; }
.support-card strong { color: #eef3ff; font-size: 12px; }
.support-card span { margin-top: 2px; color: #8598bd; font-size: 11px; }

.main-area { min-width: 0; }
.topbar { height: 84px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 24px; padding: 0 30px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.topbar-title { min-width: 180px; }
.eyebrow { display: block; margin-bottom: 2px; color: var(--muted-2); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.topbar h1 { margin: 0; font-size: 22px; line-height: 1.1; letter-spacing: -.02em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.global-search { width: min(360px, 28vw); height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.global-search span { color: var(--muted); font-size: 20px; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; }
.global-search input::placeholder { color: #9aa5b4; }
kbd { padding: 2px 6px; border: 1px solid #d7dde6; border-radius: 5px; color: #7b8797; background: white; box-shadow: var(--shadow-sm); font-size: 10px; }
.icon-button { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; color: #566174; background: white; cursor: pointer; transition: .15s ease; }
.icon-button:hover { color: var(--blue-700); border-color: #cbd7e8; background: var(--blue-100); }
.has-indicator::after { content: ""; position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: #e4535d; }
.user-menu { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 5px; border-radius: 11px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: white; font-size: 12px; font-weight: 800; background: linear-gradient(145deg, #2e65b1, #1e345f); }
.user-copy strong, .user-copy span { display: block; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy span { color: var(--muted); font-size: 10px; }
.chevron { color: var(--muted-2); }
.mobile-menu { display: none; }

.content-area { min-height: calc(100vh - 84px); padding: 26px 30px 48px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h2 { margin: 0 0 5px; font-size: 25px; letter-spacing: -.025em; }
.page-heading p { margin: 0; color: var(--muted); max-width: 720px; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-header h3 { margin: 0; font-size: 15px; }
.card-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.card-body { padding: 19px; }
.card-footer { padding: 14px 18px; border-top: 1px solid var(--border); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 145px; padding: 19px; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 110px; height: 110px; top: -55px; right: -45px; border-radius: 50%; background: var(--blue-100); opacity: .75; }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--blue-700); background: var(--blue-100); font-size: 18px; }
.metric-trend { padding: 4px 7px; border-radius: 20px; color: var(--success); background: var(--success-bg); font-size: 10px; font-weight: 800; }
.metric-value { display: block; margin-top: 17px; font-size: 30px; line-height: 1; font-weight: 800; letter-spacing: -.035em; }
.metric-label { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 18px; }
.insight-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.insight { padding: 18px; display: flex; align-items: center; gap: 14px; }
.insight strong { display: block; font-size: 22px; }
.insight span { color: var(--muted); font-size: 12px; }
.progress-ring { --p: 74; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--blue-600) calc(var(--p) * 1%), #e8edf4 0); }
.progress-ring::before { content: ""; width: 38px; height: 38px; border-radius: 50%; background: white; }
.activity-list { display: grid; gap: 2px; }
.activity-item { position: relative; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; padding: 12px 2px; }
.activity-item + .activity-item { border-top: 1px solid #edf0f4; }
.activity-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--blue-700); background: var(--blue-100); font-weight: 800; font-size: 11px; }
.activity-copy strong { display: block; font-size: 12px; }
.activity-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.activity-time { color: var(--muted-2); font-size: 10px; white-space: nowrap; }

.btn { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 12px; cursor: pointer; transition: .15s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { color: white; border-color: var(--blue-700); background: linear-gradient(180deg, #346fbe, #28589c); box-shadow: 0 6px 14px rgba(40,88,156,.2); }
.btn-primary:hover { background: #27569a; }
.btn-secondary { color: #39455a; border-color: #d8dee8; background: white; }
.btn-secondary:hover { border-color: #bcc8d9; background: #f7f9fc; }
.btn-success { color: white; background: var(--success); }
.btn-danger { color: var(--danger); border-color: #f0c9ce; background: var(--danger-bg); }
.btn-ghost { color: var(--blue-700); background: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 11px; }
.btn-icon { width: 34px; padding: 0; }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 13px 15px; margin-bottom: 14px; }
.toolbar .field { margin: 0; }
.toolbar-spacer { margin-left: auto; }
.search-field { position: relative; min-width: 280px; }
.search-field::before { content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 18px; }
.search-field input { padding-left: 36px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { color: #475467; font-size: 11px; font-weight: 750; }
.field .hint { color: var(--muted-2); font-size: 10px; }
.form-control, .form-select, .form-textarea { width: 100%; min-height: 40px; border: 1px solid #d6dde7; border-radius: 9px; padding: 8px 11px; outline: 0; color: var(--text); background: white; transition: .15s ease; }
.form-textarea { min-height: 86px; resize: vertical; }
.form-control:focus, .form-select:focus, .form-textarea:focus { border-color: #7fa7dc; box-shadow: 0 0 0 3px rgba(51,111,194,.10); }
.form-control[readonly] { color: #536072; background: #f6f8fb; }
.input-group { display: flex; }
.input-group .form-control { border-radius: 9px 0 0 9px; }
.input-suffix { min-width: 52px; display: grid; place-items: center; padding: 0 10px; border: 1px solid #d6dde7; border-left: 0; border-radius: 0 9px 9px 0; color: var(--muted); background: #f7f9fc; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.field-span-2 { grid-column: span 2; }
.field-span-3 { grid-column: span 3; }
.checkbox-row { display: flex; align-items: center; gap: 8px; color: #475467; font-size: 12px; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--blue-700); }

.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th { position: sticky; top: 0; z-index: 1; padding: 11px 13px; border-bottom: 1px solid var(--border); color: #687386; background: #f8fafc; text-align: left; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.data-table td { padding: 13px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
.data-table tbody tr { transition: .12s ease; }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-title { display: block; color: #202a3b; font-size: 12px; font-weight: 750; }
.cell-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--muted); }
.font-semibold { font-weight: 700; }
.nowrap { white-space: nowrap; }

.status { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-success { color: var(--success); background: var(--success-bg); }
.status-warning { color: var(--warning); background: var(--warning-bg); }
.status-danger { color: var(--danger); background: var(--danger-bg); }
.status-info { color: var(--info); background: var(--info-bg); }
.status-neutral { color: #657083; background: #f0f2f5; }
.priority { padding: 3px 7px; border-radius: 6px; font-size: 10px; font-weight: 800; }
.priority-high { color: var(--danger); background: var(--danger-bg); }
.priority-normal { color: var(--info); background: var(--info-bg); }
.priority-low { color: #596579; background: #f1f3f6; }

.case-hero { padding: 20px; margin-bottom: 18px; background: linear-gradient(110deg, white 60%, #f1f6ff); }
.case-hero-main { display: flex; align-items: center; gap: 17px; }
.case-initials { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, #3c77c6, #213e74); font-size: 17px; font-weight: 800; }
.case-hero h2 { margin: 0; font-size: 22px; }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.case-hero-actions { margin-left: auto; display: flex; gap: 8px; }
.case-route { margin-top: 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px; background: #fbfcfe; }
.route-point strong, .route-point span { display: block; }
.route-point span { color: var(--muted); font-size: 10px; }
.route-arrow { color: var(--blue-600); font-size: 22px; }

.tabs { display: flex; gap: 4px; padding: 5px; margin-bottom: 17px; border: 1px solid var(--border); border-radius: 11px; background: white; overflow-x: auto; }
.tab { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.tab:hover { color: var(--blue-700); background: #f6f9fd; }
.tab.active { color: var(--blue-700); background: var(--blue-100); }
.details-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .7fr); gap: 18px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.info-item { padding-bottom: 13px; border-bottom: 1px solid #edf0f4; }
.info-item label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.info-item strong { font-size: 12px; }
.workflow-stack { display: grid; gap: 10px; }
.workflow-card { display: grid; grid-template-columns: 40px 1fr auto; gap: 11px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 11px; }
.workflow-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--blue-700); background: var(--blue-100); }
.workflow-card strong, .workflow-card span { display: block; }
.workflow-card strong { font-size: 12px; }
.workflow-card span { margin-top: 2px; color: var(--muted); font-size: 10px; }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(310px, .62fr); gap: 18px; align-items: start; }
.sticky-summary { position: sticky; top: 106px; }
.summary-list { display: grid; gap: 12px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.summary-row strong { color: var(--text); font-size: 13px; }
.summary-row.total { margin-top: 4px; padding-top: 13px; border-top: 1px dashed #ced5df; color: var(--text); font-weight: 800; }
.summary-row.total strong { font-size: 21px; color: var(--blue-700); }
.amount-words { margin-top: 14px; padding: 12px; border-radius: 9px; color: #4d5d72; background: #f4f7fb; font-size: 11px; line-height: 1.55; }
.editor-line { display: grid; grid-template-columns: minmax(240px, 1fr) 86px 120px 120px 40px; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #edf0f4; }
.editor-line.header { color: var(--muted); background: #f8fafc; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.editor-line .form-control { min-height: 35px; padding: 6px 8px; font-size: 11px; }
.editor-line.is-saving { opacity: .55; }
.editor-line:last-child { border-bottom: 0; }
.line-total { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.add-line { padding: 12px; border-top: 1px solid var(--border); }

.attachment-list { display: grid; gap: 9px; }
.attachment { display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 11px; transition: .15s ease; }
.attachment.received { border-color: #c5ead8; background: #fbfffd; }
.attachment-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: #657083; background: #f1f3f6; }
.attachment.received .attachment-icon { color: var(--success); background: var(--success-bg); }
.attachment strong, .attachment span { display: block; }
.attachment strong { font-size: 12px; }
.attachment span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.completion-box { padding: 15px; border-radius: 11px; color: #255b45; background: linear-gradient(130deg, #eaf8f1, #f6fffa); }
.completion-top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; }
.progress { height: 7px; margin-top: 9px; border-radius: 10px; background: rgba(23,137,86,.14); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--success); }

.setting-nav { display: grid; gap: 4px; }
.setting-nav a { padding: 10px 11px; border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.setting-nav a.active, .setting-nav a:hover { color: var(--blue-700); background: var(--blue-100); }
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }

.empty-state { padding: 50px 20px; text-align: center; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 16px; color: var(--blue-700); background: var(--blue-100); font-size: 24px; font-weight: 800; }
.empty-state h2 { margin: 0 0 7px; }
.empty-state p { margin: 0 auto 18px; max-width: 460px; color: var(--muted); }

.toast-host { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 420px; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 12px 13px; border: 1px solid var(--border); border-radius: 11px; background: white; box-shadow: var(--shadow-md); animation: toast-in .2s ease; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast strong { display: block; font-size: 12px; }
.toast span { color: var(--muted); font-size: 11px; }
.toast button { border: 0; color: var(--muted); background: transparent; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.busy-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(16,26,54,.16); backdrop-filter: blur(2px); }
.spinner { width: 38px; height: 38px; border: 4px solid rgba(255,255,255,.5); border-top-color: var(--blue-700); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 44%) 1fr; background: white; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 70px clamp(40px, 7vw, 105px); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.login-brand .brand-mark { flex: 0 0 auto; }
.login-panel h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.035em; }
.login-panel > p { margin: 0 0 28px; color: var(--muted); }
.login-form { max-width: 430px; }
.login-actions { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; }
.login-actions a { color: var(--blue-700); font-size: 11px; font-weight: 700; }
.login-form .btn { width: 100%; min-height: 46px; }
.demo-credentials { margin-top: 22px; padding: 13px; border: 1px solid #dce6f3; border-radius: 10px; color: #4f6077; background: #f5f9ff; font-size: 11px; }
.login-visual { position: relative; display: grid; align-content: center; padding: 55px; color: white; background:
    radial-gradient(circle at 82% 12%, rgba(63,118,206,.62), transparent 35%),
    linear-gradient(140deg, #172441, #0f1832 68%); overflow: hidden; }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.login-visual::before { width: 520px; height: 520px; right: -220px; top: -160px; }
.login-visual::after { width: 360px; height: 360px; left: -180px; bottom: -160px; }
.login-visual-content { position: relative; z-index: 1; max-width: 650px; }
.login-visual h2 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 56px); line-height: 1.08; letter-spacing: -.04em; }
.login-visual p { max-width: 570px; color: #b8c6df; font-size: 15px; }
.login-preview { margin-top: 35px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.login-preview-card { padding: 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 13px; background: rgba(255,255,255,.055); backdrop-filter: blur(8px); }
.login-preview-card strong { display: block; font-size: 20px; }
.login-preview-card span { color: #9fb0ce; font-size: 10px; }
.validation-summary-errors { margin-bottom: 14px; padding: 10px 12px; border: 1px solid #f3c9cd; border-radius: 9px; color: var(--danger); background: var(--danger-bg); font-size: 11px; }
.validation-summary-errors ul { margin: 0; padding-left: 16px; }

@media (max-width: 1180px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid, .details-grid { grid-template-columns: 1fr; }
    .editor-grid { grid-template-columns: 1fr; }
    .sticky-summary { position: static; }
    .global-search { display: none; }
}
@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
    .sidebar.open { transform: translateX(0); }
    .mobile-menu { display: grid; }
    .topbar { padding: 0 18px; }
    .content-area { padding: 22px 18px 40px; }
    .user-copy, .chevron { display: none; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { min-height: 100vh; padding: 44px 28px; }
    .settings-grid { grid-template-columns: 1fr; }
    .setting-nav { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
    .metrics-grid, .insight-strip, .form-grid, .form-grid-3, .info-grid { grid-template-columns: 1fr; }
    .field-span-2, .field-span-3 { grid-column: span 1; }
    .page-heading { flex-direction: column; }
    .page-actions { justify-content: flex-start; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar-spacer { margin-left: 0; }
    .search-field { min-width: 0; }
    .case-hero-main { align-items: flex-start; flex-wrap: wrap; }
    .case-hero-actions { width: 100%; margin-left: 0; }
    .editor-line { grid-template-columns: 1fr 70px 90px 34px; }
    .editor-line > :nth-child(4) { display: none; }
    .topbar-title .eyebrow { display: none; }
    .topbar h1 { font-size: 18px; }
    .topbar-actions { gap: 5px; }
    .topbar-actions > .icon-button.has-indicator { display: none; }
}

/* MVC application extensions */
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.validation-summary-errors { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #f1c5cb; border-radius: 10px; color: #a82838; background: #fff2f4; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.field-validation-error { color: #b42318; font-size: 10px; }
.input-validation-error { border-color: #e07a86 !important; }
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; font-size: 12px; }
.alert-success { color: #166534; border: 1px solid #bbdfc4; background: #ecfdf3; }
.alert-danger { color: #9f2732; border: 1px solid #efc1c7; background: #fff1f3; }
.alert button { border: 0; background: transparent; cursor: pointer; color: inherit; }
.empty-state { padding: 48px 22px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 15px; }
.details-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.detail-box { padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfe; }
.detail-box label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.detail-box strong { display: block; font-size: 12px; word-break: break-word; }
.detail-box.span-2 { grid-column: span 2; }
.detail-box.span-4 { grid-column: span 4; }
.workflow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.workflow-step { position: relative; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.workflow-step.done { border-color: #b7ddc3; background: #f1fbf5; }
.workflow-step.current { border-color: #8db3e5; background: #f1f6ff; box-shadow: 0 0 0 2px rgba(51,111,194,.08); }
.workflow-step strong, .workflow-step span { display: block; }
.workflow-step span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.actions-menu { position: relative; display: inline-block; }
.actions-dropdown { position: absolute; right: 0; top: calc(100% + 7px); z-index: 40; min-width: 220px; display: none; padding: 6px; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: 0 18px 45px rgba(21,35,64,.18); }
.actions-menu.open .actions-dropdown { display: grid; }
.actions-dropdown a, .actions-dropdown button { width: 100%; display: flex; align-items: center; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; color: #344054; background: transparent; cursor: pointer; text-align: left; font-size: 11px; font-weight: 700; }
.actions-dropdown a:hover, .actions-dropdown button:hover { color: var(--blue-700); background: #f3f7fd; }
.inline-form { display: inline; }
.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 22px; background: rgba(10,18,38,.66); }
.modal-backdrop.open { display: flex; }
.modal-card { width: min(720px, 96vw); max-height: 94vh; overflow: auto; border-radius: 15px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-card.sm { width: min(520px, 96vw); }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; }
.modal-head { border-bottom: 1px solid var(--border); }
.modal-foot { border-top: 1px solid var(--border); background: #fbfcfe; }
.modal-body { padding: 18px; }
.modal-head h3 { margin: 0; font-size: 15px; }
.icon-close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: #f1f3f6; cursor: pointer; }
.quotation-lines input { min-width: 90px; }
.quotation-lines .description-input { min-width: 330px; }
.table-input { width: 100%; min-height: 34px; border: 1px solid #d6dde7; border-radius: 7px; padding: 6px 8px; }
.summary-panel { margin-left: auto; width: min(420px, 100%); }
.summary-row { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid #edf0f4; }
.summary-row.total { font-size: 16px; font-weight: 800; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }
.stack { display: grid; gap: 18px; }
.document-card { overflow: hidden; }
.document-preview-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.bank-account-card { padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.bank-account-card + .bank-account-card { margin-top: 10px; }
.bank-account-card header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.bank-account-card dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; margin: 0; font-size: 11px; }
.bank-account-card dt { color: var(--muted); }
.bank-account-card dd { margin: 0; font-family: Consolas, monospace; word-break: break-all; }
.attachment-list { display: grid; gap: 9px; }
.attachment-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.attachment-row.complete { border-color: #b9dec5; background: #f4fcf7; }
.attachment-row strong, .attachment-row span { display: block; }
.attachment-row span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.upload-inline { display: flex; align-items: center; gap: 7px; }
.upload-inline input[type=file] { max-width: 190px; font-size: 10px; }
.settings-section { scroll-margin-top: 95px; }
.letterhead-preview { width: 100%; max-height: 150px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top right,#e6effd,transparent 35%),#f4f7fb; }
.login-card { width: min(440px, 100%); padding: 28px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(22,39,72,.16); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand .brand-mark { flex: 0 0 auto; }
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.security-note { margin-top: 16px; padding: 11px; border-radius: 9px; color: #5e6778; background: #f5f7fa; font-size: 10px; line-height: 1.55; }
.arabic { direction: rtl; font-family: Tahoma, Arial, sans-serif; }

@media (max-width: 1050px) {
  .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-steps { grid-template-columns: repeat(2, 1fr); }
  .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .details-grid, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .field-span-2, .field-span-3, .detail-box.span-2, .detail-box.span-4 { grid-column: span 1; }
  .workflow-steps { grid-template-columns: 1fr; }
  .page-heading { flex-direction: column; }
  .page-actions { justify-content: flex-start; }
}

/* Case worklist workflow */
.case-worklist-table { min-width: 1560px; }
.case-worklist-table td { min-width: 125px; }
.case-worklist-table td:first-child { min-width: 150px; }
.case-worklist-table td:nth-child(2) { min-width: 190px; }
.case-worklist-table td:nth-child(4) { min-width: 210px; }
.case-worklist-table td:nth-child(5) { min-width: 180px; }
.document-cell .cell-title,
.document-cell .cell-subtitle { display: block; }
.document-cell .status { display: inline-flex; margin: 5px 0 3px; }
.table-primary-link { color: var(--blue-700); }
.table-primary-link:hover { text-decoration: underline; }
.actions-cell { width: 1%; min-width: 96px !important; white-space: nowrap; overflow: visible; }
.grid-actions-menu .actions-dropdown {
    position: fixed;
    right: auto;
    top: auto;
    z-index: 160;
    width: 250px;
    max-height: min(540px, calc(100vh - 16px));
    overflow-y: auto;
    overscroll-behavior: contain;
}
.actions-dropdown form { margin: 0; }
.actions-dropdown .action-group-label {
    display: block;
    padding: 7px 10px 4px;
    color: #8a94a6;
    font-size: 9px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.actions-dropdown .action-divider { display: block; height: 1px; margin: 5px 4px; background: #edf0f4; }
.actions-dropdown .action-disabled {
    display: block;
    padding: 8px 10px;
    color: #98a2b3;
    font-size: 10px;
    line-height: 1.4;
    white-space: normal;
}
.actions-dropdown button.action-primary { color: var(--blue-700); background: #edf4ff; }
.actions-dropdown button.action-primary:hover { background: #e1edff; }
.actions-dropdown button.action-success { color: #13733b; background: #edf9f1; }
.actions-dropdown button.action-success:hover { background: #def3e6; }
.workflow-calculation-summary { padding: 0; background: transparent; }

/* Case filters and general attachments */
.case-filter-toolbar { flex-wrap: wrap; align-items: end; }
.case-filter-toolbar .search-field { flex: 1 1 280px; }
.compact-field { min-width: 155px; }
.compact-field label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.general-attachment-upload { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) auto; gap: 12px; align-items: end; padding: 14px; border: 1px dashed #b7c3d5; border-radius: 11px; background: #f8fafc; }
.general-attachment-upload .field { margin: 0; }
.upload-button-field { align-self: end; }
.compact-empty { padding: 18px; }
@media (max-width: 900px) {
  .general-attachment-upload { grid-template-columns: 1fr; }
}

/* v1.0.6 interaction and layout hardening */
.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.ui-icon,
.action-icon,
.action-chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    color: #98a2b3;
}

.form-card .card-body {
    padding: 22px;
}

.form-grid-aligned {
    gap: 18px 20px;
}

.case-identity-grid,
.beneficiary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.beneficiary-name-field {
    grid-column: span 2;
}

.beneficiary-address-field {
    grid-column: span 3;
}

.form-grid-aligned .field {
    min-width: 0;
    margin: 0;
    display: grid;
    grid-template-rows: minmax(17px, auto) 44px minmax(0, auto);
    align-content: start;
    gap: 6px;
}

.form-grid-aligned .field label {
    min-height: 17px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.25;
}

.form-grid-aligned .field > .field-validation-error,
.form-grid-aligned .field > .field-validation-valid {
    min-height: 13px;
    line-height: 1.2;
}

.form-control,
.form-select {
    min-height: 44px;
    height: 44px;
    padding: 9px 12px;
    border-color: #cfd8e6;
    border-radius: 10px;
    background-color: #fff;
}

.form-select {
    padding-right: 36px;
}

.form-control:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: #afbdd0;
}

.form-select:disabled,
.form-control:disabled {
    color: #8a94a6;
    background: #f5f7fa;
    cursor: not-allowed;
}

.form-select[aria-busy="true"] {
    color: #667085;
    background-image: linear-gradient(90deg, transparent, rgba(51,111,194,.08), transparent);
    background-size: 220% 100%;
    animation: loading-sheen 1.15s linear infinite;
}

@keyframes loading-sheen {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

.field-help {
    width: 16px;
    height: 16px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #c9d5e6;
    border-radius: 50%;
    color: var(--blue-700);
    background: #f5f8fd;
    font-size: 9px;
    font-weight: 800;
    cursor: help;
}

.route-editor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 20px;
    padding: 22px;
}

.route-meta-field {
    grid-column: span 2;
}

.route-notes-field {
    grid-column: span 4;
    grid-template-rows: minmax(17px, auto) auto minmax(0, auto) !important;
}

.route-notes-field .form-textarea {
    min-height: 104px;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.validation-summary:empty {
    display: none;
}

/* Consistent filter alignment */
.case-filter-toolbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(150px, .8fr)) auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
    margin-bottom: 14px;
}

.case-filter-toolbar .field {
    min-width: 0;
    margin: 0;
    gap: 5px;
}

.case-filter-toolbar .compact-field {
    min-width: 0;
}

.case-filter-toolbar .search-field {
    min-width: 0;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}


/* Compact drill-down action menu */
.grid-actions-menu .actions-dropdown {
    width: 286px;
    max-height: none;
    overflow: visible;
    padding: 7px;
    border-color: #d9e1ec;
    border-radius: 13px;
    box-shadow: 0 20px 55px rgba(15, 31, 58, .2);
}

.action-trigger {
    min-width: 88px;
}

.action-panel {
    display: none;
    gap: 2px;
}

.action-panel.is-active {
    display: grid;
}

.action-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: -1px -1px 4px;
    padding: 9px 10px;
    border-radius: 9px;
    color: #1f3152;
    background: linear-gradient(135deg, #f3f7fd, #edf3fb);
}

.action-panel-title span {
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 11px;
    font-weight: 800;
}

.action-panel-title small {
    max-width: 130px;
    overflow: hidden;
    color: #60708a;
    font-size: 9px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions-dropdown a,
.actions-dropdown button {
    min-height: 34px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 0 9px;
    border-radius: 8px;
    line-height: 1.2;
}

.actions-dropdown a > span:not(.action-count),
.actions-dropdown button > span:not(.action-count) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions-dropdown .action-group-label {
    padding: 8px 9px 3px;
    color: #7e8ba0;
}

.actions-dropdown .action-divider {
    margin: 5px 3px;
}

.action-panel-back {
    margin-bottom: 4px;
    color: #1f4f91 !important;
    background: #edf4ff !important;
    font-weight: 800 !important;
}

.action-panel-back:hover {
    background: #e1edff !important;
}

.action-count {
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 999px;
    color: #3b5f91;
    background: #eaf1fb;
    text-align: center;
    font-size: 9px;
    font-weight: 800;
}

.action-icon-excel {
    color: #1f7a4d;
}

.action-icon-word {
    color: #245ea9;
}

.actions-dropdown button.is-loading::after,
.btn.is-loading::after {
    content: "";
    width: 12px;
    height: 12px;
    margin-left: auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: action-spin .7s linear infinite;
}

@keyframes action-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1380px) {
    .case-filter-toolbar {
        grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(150px, .8fr)) repeat(2, minmax(170px, .9fr));
    }

    .filter-actions {
        grid-column: span 5;
        justify-content: flex-end;
    }
}

@media (max-width: 1150px) {
    .case-identity-grid,
    .beneficiary-grid,
    .route-editor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .beneficiary-address-field {
        grid-column: span 1;
    }

    .route-meta-field {
        grid-column: span 1;
    }

    .route-notes-field {
        grid-column: span 2;
    }
}

@media (max-width: 820px) {
    .case-filter-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .filter-search-field,
    .filter-actions {
        grid-column: span 2;
    }

    .filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .case-identity-grid,
    .beneficiary-grid,
    .route-editor-grid,
    .case-filter-toolbar {
        grid-template-columns: 1fr;
    }

    .beneficiary-name-field,
    .beneficiary-address-field,
    .route-meta-field,
    .route-notes-field,
    .filter-search-field,
    .filter-actions {
        grid-column: span 1;
    }
}

/* v1.0.8 attachments, account administration, audit and name transliteration */
.is-hidden { display: none !important; }
.justify-end { justify-content: flex-end; }
.btn-ghost { border-color: transparent; color: var(--muted); background: transparent; }
.btn-ghost:hover { color: var(--blue-700); background: #f2f6fc; }

.input-action-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-action-group .form-control { padding-inline-end: 48px; }
.input-action-button {
    position: absolute;
    inset-inline-end: 5px;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #356bb4;
    background: #edf4ff;
    cursor: pointer;
}
.input-action-button:hover { background: #dceaff; }
.input-action-button:disabled { opacity: .55; cursor: wait; }
.auto-translation-state {
    margin-inline-start: auto;
    padding: 3px 7px;
    border-radius: 999px;
    color: #416894;
    background: #edf4ff;
    font-size: 9px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}
.auto-translation-state[data-state="manual"] { color: #8a5a00; background: #fff4d5; }
.auto-translation-state[data-state="success"] { color: #14713a; background: #e9f8ef; }
.auto-translation-state[data-state="error"] { color: #a33131; background: #fff0f0; }

.attachment-section { overflow: hidden; }
.required-document-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    background: #f7f9fc;
}
.required-document-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas:
        "icon copy"
        "action action";
    gap: 10px 12px;
    padding: 15px;
    border: 1px solid #dfe5ee;
    border-radius: 13px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.required-document-card:hover { border-color: #c6d3e4; box-shadow: 0 8px 20px rgba(29, 50, 86, .06); }
.required-document-card.is-complete { border-color: #b8dfc5; background: linear-gradient(145deg, #fff, #f5fcf7); }
.document-type-icon,
.attachment-file-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #356bb4;
    background: #edf4ff;
}
.required-document-card.is-complete .document-type-icon { color: #187440; background: #e6f7ec; }
.document-type-icon .ui-icon,
.attachment-file-icon .ui-icon { width: 20px; height: 20px; }
.required-document-copy { grid-area: copy; min-width: 0; }
.required-document-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.required-document-title strong { font-size: 12px; }
.required-badge {
    padding: 2px 6px;
    border-radius: 999px;
    color: #6b7382;
    background: #eef1f5;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.required-document-copy > .arabic { display: block; margin-top: 3px; color: #69758a; font-size: 10px; text-align: left; }
.required-file-state { margin-top: 9px; }
.required-file-state a { display: inline-flex; max-width: 100%; align-items: center; gap: 6px; color: #2463aa; }
.required-file-state a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.required-file-state small { display: block; margin-top: 4px; color: var(--muted); }
.missing-file-state { display: inline-flex; align-items: center; gap: 6px; color: #8b6470; font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #e09a42; }
.required-upload-form {
    grid-area: action;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 11px;
    border-top: 1px solid #edf0f4;
}
.selected-required-file {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.visually-hidden-file {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.file-select-button { cursor: pointer; user-select: none; }

.general-attachment-body { display: grid; gap: 18px; background: #f8fafc; }
.general-attachment-list { display: grid; gap: 9px; }
.general-attachment-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #dfe5ee;
    border-radius: 12px;
    background: #fff;
}
.general-attachment-copy { min-width: 0; }
.general-attachment-copy a { display: block; overflow: hidden; color: #1f568f; text-overflow: ellipsis; white-space: nowrap; }
.general-attachment-copy span,
.general-attachment-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.attachment-card-actions { display: flex; align-items: center; gap: 6px; }
.attachment-card-actions form { margin: 0; }
.attachment-icon-action { width: 34px; height: 34px; color: #486581; background: #f2f5f9; }
.attachment-icon-action:hover { color: #205fa6; background: #e8f1fc; }
.attachment-icon-action.danger { color: #b33b3b; background: #fff1f1; }
.attachment-icon-action.danger:hover { background: #ffe3e3; }

.multi-attachment-upload {
    overflow: hidden;
    border: 1px solid #cdd8e8;
    border-radius: 14px;
    background: #fff;
}
.multi-upload-dropzone {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 26px;
    border: 2px dashed #b9c8dc;
    border-radius: 12px;
    margin: 12px;
    color: #40536d;
    background: linear-gradient(145deg, #fbfdff, #f3f7fc);
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.multi-upload-dropzone.is-dragging { border-color: #3b75bd; background: #edf5ff; transform: scale(1.003); }
.multi-upload-dropzone > div:nth-child(2) { min-width: 0; }
.multi-upload-dropzone strong,
.multi-upload-dropzone span { display: block; }
.multi-upload-dropzone span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.upload-illustration {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #2f6db5, #4d8bd2);
    box-shadow: 0 10px 24px rgba(47, 109, 181, .22);
}
.upload-illustration .ui-icon { width: 24px; height: 24px; }
.selected-file-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 12px 12px;
}
.selected-file-chip {
    min-width: 0;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border: 1px solid #dfe6ef;
    border-radius: 9px;
    background: #f9fbfd;
}
.selected-file-chip span { min-width: 0; }
.selected-file-chip strong,
.selected-file-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file-chip strong { font-size: 9px; }
.selected-file-chip small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.selected-file-chip button { width: 26px; height: 26px; border: 0; border-radius: 7px; color: #a33b3b; background: #fff0f0; cursor: pointer; }
.multi-upload-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border-top: 1px solid #e7ebf1;
    background: #fbfcfe;
}
.multi-upload-description { margin: 0; }

.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 500;
    width: min(380px, calc(100vw - 36px));
    display: grid;
    gap: 9px;
}
.toast-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(20, 35, 60, .18);
    font-size: 11px;
    font-weight: 700;
}
.toast-success { color: #17653a; border-color: #a9d8ba; }
.toast-error { color: #9a3030; border-color: #efb5b5; }
.toast-message button { border: 0; color: inherit; background: transparent; cursor: pointer; font-size: 18px; }

/* Accounts and permissions */
.account-toolbar { align-items: center; }
.compact-search-form { display: flex; align-items: center; gap: 8px; }
.compact-search-form .form-control { width: min(290px, 40vw); }
.account-table { min-width: 850px; }
.account-user-cell { display: flex; align-items: center; gap: 11px; }
.account-user-cell > div { min-width: 0; }
.account-user-cell strong,
.account-user-cell span { display: block; }
.account-user-cell span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.account-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid !important;
    place-items: center;
    border-radius: 11px;
    color: #fff !important;
    background: linear-gradient(135deg, #244f86, #4685cb);
    font-size: 11px !important;
    font-weight: 800;
}
.role-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.role-badge { padding: 4px 7px; border-radius: 999px; color: #42516a; background: #eef2f7; font-size: 8px; font-weight: 800; }
.role-administrator { color: #7b3d00; background: #fff0dc; }
.role-operations { color: #1c5c9a; background: #e9f3ff; }
.role-finance { color: #1d6b42; background: #e8f8ef; }
.role-viewer { color: #586273; background: #eef1f5; }
.status-muted { color: #6d7582; background: #eef0f3; }
.role-selection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.role-select-card {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 13px;
    border: 1px solid #dce3ed;
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
}
.role-select-card:has(input:checked) { border-color: #77a6db; background: #f2f7fd; box-shadow: inset 0 0 0 1px #77a6db; }
.role-select-card input { position: absolute; top: 10px; right: 10px; }
.role-select-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #356bb4; background: #eaf3fd; }
.role-select-card strong,
.role-select-card small { display: block; }
.role-select-card small { margin-top: 4px; padding-right: 18px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.toggle-field { align-content: start; }
.switch-control { height: 44px; display: flex !important; align-items: center !important; gap: 9px !important; padding: 0 12px; border: 1px solid #d6dde7; border-radius: 9px; background: #fff; cursor: pointer; }
.switch-control input { width: 34px; height: 18px; accent-color: #2f6db5; }
.switch-control strong { font-size: 10px; }
.readonly-state { height: 44px; display: flex; align-items: center; }
.account-management-layout { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); }
.compact-stack { gap: 12px; }
.security-notes p { margin: 0 0 8px; color: #596579; font-size: 10px; line-height: 1.5; }
.permission-matrix { min-width: 920px; }
.permission-matrix td:not(:first-child),
.permission-matrix th:not(:first-child) { text-align: center; }

/* Audit */
.audit-count { min-width: 130px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 11px; background: #fff; text-align: right; }
.audit-count strong,
.audit-count span { display: block; }
.audit-count strong { color: #234f84; font-size: 20px; }
.audit-count span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.audit-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 10px; align-items: end; padding: 14px; }
.audit-filter-grid .field { margin: 0; }
.audit-search-field { grid-column: span 2; }
.filter-actions { display: flex; gap: 7px; }
.audit-table { min-width: 1050px; }
.table-subtext { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.audit-action { display: inline-flex; padding: 4px 7px; border-radius: 7px; color: #245f9f; background: #edf4fc; font-size: 9px; font-weight: 800; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; }
.audit-details-layout { grid-template-columns: minmax(350px, .7fr) minmax(0, 1.3fr); }
.audit-json { max-height: 620px; overflow: auto; margin: 0; padding: 15px; border-radius: 10px; color: #dce7f5; background: #172337; font: 10px/1.55 Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 1100px) {
    .required-document-grid { grid-template-columns: 1fr; }
    .audit-filter-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
    .account-management-layout, .audit-details-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .multi-upload-dropzone { flex-direction: column; text-align: center; }
    .selected-file-list, .role-selection-grid { grid-template-columns: 1fr; }
    .multi-upload-footer { grid-template-columns: 1fr; }
    .general-attachment-card { grid-template-columns: 38px minmax(0, 1fr); }
    .attachment-card-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .audit-filter-grid { grid-template-columns: 1fr; }
    .audit-search-field { grid-column: span 1; }
    .compact-search-form { width: 100%; flex-wrap: wrap; }
    .compact-search-form .form-control { width: 100%; }
}

.pagination-bar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.25rem;border-top:1px solid var(--border,#dbe4f0);font-size:.9rem}.pagination-actions{display:flex;align-items:center;gap:.75rem}@media(max-width:700px){.pagination-bar{align-items:flex-start;flex-direction:column}}

/* v1.1.2 Arabic beneficiary name and product footer */
.arabic-name-field {
    grid-template-rows: auto 48px auto auto !important;
}
.arabic-name-heading {
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.arabic-name-heading > label {
    min-height: 0 !important;
    margin: 0;
}
.arabic-name-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.arabic-name-input {
    height: 48px;
    min-height: 48px;
    padding: 8px 16px;
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.9;
    letter-spacing: 0;
}
.arabic-name-input::placeholder { font-weight: 400; }
.arabic-regenerate-button {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 1px solid #c9d8eb;
    border-radius: 8px;
    color: #245f9f;
    background: #f4f8fd;
    font: inherit;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}
.arabic-regenerate-button:hover { background: #e8f2ff; }
.arabic-regenerate-button:disabled { opacity: .55; cursor: wait; }
.arabic-regenerate-button .ui-icon { width: 13px; height: 13px; }
.field-guidance {
    display: block;
    min-height: 14px;
    color: #7a8699;
    font-size: 9px;
    line-height: 1.45;
}
.powered-by {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1px 7px;
    align-items: center;
    padding: 12px 13px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 11px;
    color: rgba(255,255,255,.82);
    background: rgba(255,255,255,.055);
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.powered-by:hover {
    color: #fff;
    border-color: rgba(126,181,244,.45);
    background: rgba(72,126,194,.19);
    transform: translateY(-1px);
}
.powered-by span {
    grid-row: span 2;
    color: #7eb5f4;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.powered-by strong { display: block; color: #fff; font-size: 10px; }
.powered-by small { display: block; color: rgba(255,255,255,.58); font-size: 8px; }
@media (max-width: 760px) {
    .arabic-name-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
    .arabic-name-actions { width: 100%; justify-content: space-between; }
}


/* v1.5.7 Cross-currency payment settlement */
.payment-settlement-modal {
    width: min(860px, 96vw);
    max-height: min(94vh, 980px);
    overflow: hidden;
    border: 1px solid rgba(46, 91, 151, .14);
    border-radius: 24px;
    background: #f8fbff;
    box-shadow: 0 35px 95px rgba(9, 29, 58, .36);
}
.payment-settlement-head {
    min-height: 104px;
    padding: 19px 22px;
    border-bottom-color: #dce7f4;
    background: linear-gradient(115deg, #ffffff 0%, #f8fbff 62%, #eaf3ff 100%);
}
.payment-modal-title { min-width: 0; display: flex; align-items: center; gap: 14px; }
.payment-modal-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(145deg, #4b91ee, #2865bd);
    box-shadow: 0 12px 24px rgba(43, 105, 190, .26);
}
.payment-modal-icon .ui-icon { width: 22px; height: 22px; }
.payment-modal-title h3 { margin: 2px 0 0; color: #142644; font-size: 21px; letter-spacing: -.02em; }
.payment-modal-title p { max-width: 610px; margin: 5px 0 0; color: #6b7b93; font-size: 10px; line-height: 1.5; }
.payment-settlement-head .workflow-modal-step { color: #2f6fca; font-size: 8px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.payment-settlement-head .icon-close { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid #d3dfef; border-radius: 12px; color: #54657d; background: rgba(255,255,255,.86); font-size: 20px; }
.payment-settlement-body { max-height: calc(94vh - 190px); overflow-y: auto; padding: 20px; }
.payment-balance-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
}
.payment-balance-strip article {
    min-width: 0;
    padding: 15px 17px;
    border: 1px solid #dbe5f1;
    border-radius: 15px;
    background: #fff;
}
.payment-balance-strip article.is-highlighted {
    color: #fff;
    border-color: #245ca5;
    background: linear-gradient(135deg, #173b69, #2869bd);
    box-shadow: 0 12px 28px rgba(34, 92, 163, .2);
}
.payment-balance-strip span,
.payment-balance-strip strong,
.payment-balance-strip small { display: block; }
.payment-balance-strip article > span { color: #718096; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.payment-balance-strip article.is-highlighted > span { color: rgba(255,255,255,.72); }
.payment-balance-strip strong { margin-top: 7px; color: #172b4d; font-size: 21px; line-height: 1.15; }
.payment-balance-strip article.is-highlighted strong { color: #fff; }
.payment-balance-strip small { margin-top: 6px; color: #8491a4; font-size: 9px; line-height: 1.45; }
.payment-balance-strip article.is-highlighted small { color: rgba(255,255,255,.72); }
.payment-balance-arrow { display: grid !important; place-items: center; color: #7f91a8; font-size: 22px; font-weight: 800; }
.payment-form-section {
    margin-top: 14px;
    padding: 16px 17px 3px;
    border: 1px solid #dfe7f1;
    border-radius: 17px;
    background: #fff;
}
.payment-form-section > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf1f6;
}
.payment-form-section > header > div { display: flex; align-items: center; gap: 9px; }
.payment-form-section > header > div > span {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #2f6fc5;
    background: #eaf3ff;
    font-size: 9px;
    font-weight: 900;
}
.payment-form-section h4 { margin: 0; color: #203451; font-size: 12px; }
.payment-form-section header small { color: #7c899b; font-size: 9px; text-align: right; }
.payment-form-grid { gap: 0 14px; }
.payment-form-grid .field { margin-bottom: 13px; }
.payment-form-grid .field label { color: #354967; font-size: 10px; }
.payment-form-grid .form-control,
.payment-form-grid .form-select,
.payment-notes-field .form-textarea { min-height: 46px; border-color: #cfdaea; border-radius: 12px; background: #fcfdff; }
.payment-form-grid .form-control:focus,
.payment-form-grid .form-select:focus,
.payment-notes-field .form-textarea:focus { background: #fff; }
.payment-money-input .form-control { border-radius: 12px 0 0 12px; }
.payment-money-input .input-suffix {
    min-width: 70px;
    border-color: #cfdaea;
    border-radius: 0 12px 12px 0;
    color: #285f9f;
    background: #eef5fd;
    font-size: 10px;
}
.payment-rate-source-card,
.payment-application-preview {
    min-height: 82px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 13px;
    padding: 12px 14px;
    border: 1px solid #dbe5f1;
    border-radius: 13px;
    background: #f7faff;
}
.payment-rate-source-card span,
.payment-application-preview span { color: #6f7d91; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.payment-rate-source-card strong { margin-top: 5px; color: #285f9f; font-size: 13px; }
.payment-rate-source-card small { margin-top: 4px; color: #8793a4; font-size: 8px; line-height: 1.4; }
.payment-application-preview {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #fff;
    border-color: #173f72;
    background: linear-gradient(135deg, #102b4e, #183e6c);
}
.payment-application-preview > div { min-width: 0; }
.payment-application-preview span { color: rgba(255,255,255,.68); }
.payment-application-preview small { display: block; margin-top: 4px; color: rgba(255,255,255,.58); font-size: 8px; line-height: 1.4; }
.payment-application-preview strong { flex: 0 0 auto; color: #fff; font-size: 18px; }
.payment-notes-field { margin: 14px 0 0; }
.payment-notes-field .form-textarea { min-height: 72px; }
.payment-settlement-foot { min-height: 72px; padding: 13px 20px; background: #fff; }
.payment-settlement-foot > div:first-child strong,
.payment-settlement-foot > div:first-child span { display: block; }
.payment-settlement-foot > div:first-child strong { color: #203451; font-size: 10px; }
.payment-settlement-foot > div:first-child span { margin-top: 3px; color: #7b899c; font-size: 8px; }
@media (max-width: 720px) {
    .payment-settlement-modal { width: min(96vw, 620px); border-radius: 18px; }
    .payment-settlement-head { min-height: 90px; padding: 15px; }
    .payment-modal-icon { width: 42px; height: 42px; border-radius: 12px; }
    .payment-modal-title h3 { font-size: 17px; }
    .payment-modal-title p { display: none; }
    .payment-settlement-body { padding: 14px; }
    .payment-balance-strip { grid-template-columns: 1fr; }
    .payment-balance-arrow { height: 20px; transform: rotate(90deg); }
    .payment-form-section > header { align-items: flex-start; flex-direction: column; gap: 5px; }
    .payment-form-section header small { text-align: left; }
    .payment-form-grid { grid-template-columns: 1fr; }
    .payment-form-grid .field-span-2 { grid-column: span 1; }
    .payment-settlement-foot { align-items: stretch; flex-direction: column; }
    .payment-settlement-foot .page-actions { width: 100%; justify-content: flex-end; }
}
.payment-form-section .field-label-action {
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.payment-form-section .field-label-action label { margin: 0; }
.payment-form-section .field-label-action a {
    color: #2d69b7;
    font-size: 8px;
    font-weight: 800;
    white-space: nowrap;
}
.payment-form-section .field-label-action a:hover { text-decoration: underline; }
.payment-form-section .field-hint {
    display: block;
    min-height: 13px;
    color: #7f8da1;
    font-size: 8px;
    line-height: 1.4;
}
.payment-settlement-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}
.payment-settlement-body {
    min-height: 0;
    max-height: none;
}


/* v1.5.8 Payment form row alignment */
.payment-form-grid {
    align-items: start;
}
.payment-form-grid .field {
    min-height: 93px;
    grid-template-rows: 18px 46px 24px;
    align-content: start;
    gap: 5px;
    margin-bottom: 8px;
}
.payment-form-grid .field > label,
.payment-form-grid .field > .field-label-action {
    height: 18px;
    min-height: 18px;
    display: flex;
    align-items: center;
    line-height: 18px;
}
.payment-form-grid .field > label {
    margin: 0;
}
.payment-form-grid .form-control,
.payment-form-grid .form-select,
.payment-form-grid .input-group,
.payment-form-grid .input-suffix {
    height: 46px;
    min-height: 46px;
}
.payment-form-grid .input-group .form-control {
    height: 46px;
    min-height: 46px;
}
.payment-form-grid .field-hint {
    height: 24px;
    min-height: 24px;
    overflow: hidden;
    line-height: 12px;
}
.payment-form-grid > .payment-rate-source-card,
.payment-form-grid > .payment-application-preview {
    height: 82px;
    min-height: 82px;
    align-self: start;
    margin-bottom: 8px;
}
@media (max-width: 720px) {
    .payment-form-grid .field {
        min-height: 0;
        grid-template-rows: 18px 46px auto;
    }
    .payment-form-grid .field-hint {
        height: auto;
        min-height: 13px;
        overflow: visible;
    }
}
