@font-face {
    font-family: "Cairo";
    src: local("Cairo");
    font-display: swap;
}

:root {
    --primary: #0b5791;
    --primary-dark: #073f6d;
    --primary-soft: #eaf3fb;
    --secondary: #ff6500;
    --page-bg: #f5f8fc;
    --surface: #ffffff;
    --text: #123c5a;
    --muted: #71879a;
    --border: #e3ecee;
    --danger: #d94b5b;
    --shadow: 0 14px 36px rgba(23, 58, 65, .08);
    --radius-lg: 22px;
    --radius-md: 16px;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--page-bg);
    color: var(--text);
    font-family: Cairo, "Segoe UI", Tahoma, sans-serif;
}
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }

.app-shell { min-height: 100vh; }
.app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    width: 280px;
    flex-direction: column;
    padding: 24px 18px;
    overflow-y: auto;
    color: #fff;
    background:
        radial-gradient(circle at 18% 8%, rgba(255,255,255,.12), transparent 24%),
        linear-gradient(165deg, #0b5791 0%, #073f6d 58%, #082c4b 100%);
    box-shadow: -12px 0 40px rgba(7, 63, 109, .18);
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; }
.brand-link { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 15px;
    background: rgba(255,255,255,.13);
    font-size: 23px;
    font-weight: 800;
}
.brand-link strong { display: block; font-size: 17px; }
.brand-link small { display: block; margin-top: 3px; color: rgba(255,255,255,.67); font-size: 11px; }
.sidebar-close { display: none; border: 0; background: transparent; color: white; font-size: 28px; }
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 7px; margin-top: 34px; }
.nav-caption { margin: 18px 13px 6px; color: rgba(255,255,255,.48); font-size: 11px; letter-spacing: .4px; }
.nav-link-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border-radius: 13px;
    color: rgba(255,255,255,.82);
    text-decoration: none;
    transition: .2s ease;
}
.nav-link-item:hover, .nav-link-item.active {
    color: #fff;
    background: rgba(255,255,255,.13);
    transform: translateX(-2px);
}
.nav-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: rgba(255,255,255,.09); font-size: 17px; }
.sidebar-footer { padding: 18px 12px 0; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.62); }
.system-status { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; color: rgba(255,255,255,.84); }
.system-status span { width: 8px; height: 8px; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 0 5px rgba(110,231,183,.12); }
.sidebar-overlay { display: none; }

.app-main { min-height: 100vh; margin-right: 280px; }
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 84px;
    padding: 14px 30px;
    border-bottom: 1px solid rgba(220,232,234,.86);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
}
.topbar-start { display: flex; align-items: center; gap: 14px; }
.topbar-start h2 { margin: 0; font-size: 20px; font-weight: 800; }
.topbar-start p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.menu-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); font-size: 21px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.pwa-install-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.user-avatar { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.user-details strong, .user-details small { display: block; }
.user-details strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.user-details small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.logout-button { padding: 9px 13px; border: 1px solid #f1d7da; border-radius: 11px; background: #fff; color: var(--danger); font-size: 12px; transition: .2s; }
.logout-button:hover { background: #fff1f2; }
.page-content { padding: 28px 30px 38px; }
.app-alert { border: 0; border-radius: 14px; box-shadow: var(--shadow); }

.welcome-banner {
    position: relative;
    display: flex;
    min-height: 245px;
    align-items: center;
    justify-content: space-between;
    padding: 38px 42px;
    overflow: hidden;
    border-radius: 26px;
    color: white;
    background: linear-gradient(120deg, #0b5791, #0a4d82 62%, #ff6500);
    box-shadow: 0 22px 44px rgba(11, 87, 145, .22);
}
.welcome-banner::after { content: ""; position: absolute; left: -70px; bottom: -115px; width: 290px; height: 290px; border: 42px solid rgba(255,255,255,.06); border-radius: 50%; }
.welcome-banner > div:first-child { position: relative; z-index: 2; max-width: 720px; }
.eyebrow { display: block; margin-bottom: 6px; color: #ff6500; font-size: 11px; font-weight: 800; letter-spacing: .3px; }
.welcome-banner .eyebrow { color: #ffe0cc; }
.welcome-banner h1 { margin: 5px 0 10px; font-size: clamp(26px, 3vw, 39px); font-weight: 800; }
.welcome-banner p { max-width: 660px; margin: 0; color: rgba(255,255,255,.8); font-size: 14px; line-height: 1.9; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.welcome-actions .btn { padding: 10px 18px; border-radius: 12px; font-size: 13px; }
.banner-visual { position: relative; width: 180px; height: 180px; flex: 0 0 180px; }
.visual-ring { position: absolute; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.ring-one { inset: 0; }
.ring-two { inset: 24px; }
.visual-symbol { position: absolute; inset: 48px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.23); border-radius: 30px; background: rgba(255,255,255,.12); font-size: 48px; }

.dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-top: 20px; }
.metric-card { display: flex; min-height: 138px; align-items: center; gap: 15px; padding: 21px; border: 1px solid rgba(226,236,238,.9); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); transition: .2s ease; }
.metric-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(23,58,65,.11); }
.metric-icon { display: grid; width: 52px; height: 52px; flex: 0 0 52px; place-items: center; border-radius: 16px; font-size: 20px; font-weight: 800; }
.metric-icon.teal { background: #e7f7f4; color: #0f766e; }
.metric-icon.blue { background: #edf5ff; color: #3272c8; }
.metric-icon.amber { background: #fff7e6; color: #bd7b15; font-size: 13px; }
.metric-icon.red { background: #fff0f2; color: #ce4457; }
.metric-card span { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin: 4px 0 2px; color: var(--text); font-size: 27px; font-weight: 800; }
.metric-card small { color: #8b9a9d; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .75fr); gap: 20px; margin-top: 20px; }
.dashboard-side { display: flex; flex-direction: column; gap: 20px; }
.content-card, .panel, .stat-card { border: 1px solid rgba(226,236,238,.9); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.content-card { padding: 23px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-heading h3 { margin: 0; font-size: 18px; font-weight: 800; }
.card-heading a { color: var(--primary); font-size: 12px; font-weight: 700; text-decoration: none; }
.card-heading.compact { margin-bottom: 12px; }
.quick-actions-list { display: flex; flex-direction: column; gap: 9px; }
.quick-actions-list a { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; padding: 11px; border: 1px solid transparent; border-radius: 14px; text-decoration: none; transition: .2s; }
.quick-actions-list a:hover { border-color: var(--border); background: #f8fbfb; transform: translateX(-2px); }
.quick-actions-list > a > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 18px; }
.quick-actions-list strong, .quick-actions-list small { display: block; }
.quick-actions-list strong { font-size: 12px; }
.quick-actions-list small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.quick-actions-list b { color: #9babad; }
.health-note { display: flex; align-items: flex-start; gap: 12px; background: linear-gradient(145deg,#f0faf8,#fff); }
.note-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 12px; background: #dff4ef; color: var(--primary); font-weight: 800; }
.health-note h4 { margin: 1px 0 5px; font-size: 13px; font-weight: 800; }
.health-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.empty-state { display: grid; min-height: 285px; place-items: center; align-content: center; padding: 30px; text-align: center; }
.empty-icon { display: grid; width: 64px; height: 64px; place-items: center; margin-bottom: 12px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); font-size: 26px; }
.empty-state h4 { margin: 0; font-size: 16px; font-weight: 800; }
.empty-state p { margin: 7px 0 15px; color: var(--muted); font-size: 12px; }
.app-table { margin-bottom: 0; }
.app-table thead th { padding: 12px; border-bottom-color: var(--border); color: #7c8f93; font-size: 11px; font-weight: 700; white-space: nowrap; }
.app-table tbody td { padding: 14px 12px; border-bottom-color: #edf2f3; font-size: 12px; }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 700; }
.database-warning { display: flex; gap: 15px; margin-bottom: 20px; padding: 20px; border: 1px solid #f1d8a9; border-radius: 18px; background: #fffaf0; color: #72511a; box-shadow: var(--shadow); }
.warning-icon { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 14px; background: #ffefc9; font-size: 22px; font-weight: 800; }
.database-warning h3 { margin: 0 0 5px; font-size: 16px; font-weight: 800; }
.database-warning p { margin: 0; font-size: 12px; line-height: 1.8; }
.code-command { direction: ltr; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #332b1e; color: #fff4d6; font-family: Consolas, monospace; font-size: 11px; text-align: left; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-title, h1 { font-size: 28px; font-weight: 800; }
.panel, .stat-card { padding: 22px; }
.btn { border-radius: 11px; }
.btn-primary { border-color: var(--primary); background: var(--primary); }
.btn-primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.form-control, .form-select { min-height: 44px; border-color: #dce7e9; border-radius: 11px; }
.form-control:focus, .form-select:focus { border-color: #7dc9c2; box-shadow: 0 0 0 .2rem rgba(11,87,145,.14); }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 22px; background: radial-gradient(circle at top right,#ff6500 0,transparent 28%), linear-gradient(145deg,#062f52,#0b5791 58%,#edf5fb); }
.login-card { width: min(450px,94vw); padding: 36px; border: 1px solid rgba(255,255,255,.65); border-radius: 25px; background: rgba(255,255,255,.97); box-shadow: 0 28px 90px rgba(0,0,0,.25); }
.toolbar { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 15px; }
.body-canvas { position: relative; height: 620px; max-width: 430px; margin: auto; overflow: hidden; border: 1px dashed #9bb9b5; border-radius: 20px; background: #f9fcfb; }
.body-shape { position: absolute; inset: 5% 23%; }
.head { position: absolute; top: 0; left: 35%; width: 30%; height: 13%; border-radius: 50%; background: #d6e5e3; }
.torso { position: absolute; top: 14%; left: 23%; width: 54%; height: 43%; border-radius: 38% 38% 25% 25%; background: #d6e5e3; }
.arm,.leg { position: absolute; border-radius: 20px; background: #d6e5e3; }
.arm { top: 17%; width: 15%; height: 40%; }
.arm.left { left: 4%; transform: rotate(7deg); }
.arm.right { right: 4%; transform: rotate(-7deg); }
.leg { top: 54%; width: 20%; height: 43%; }
.leg.left { left: 25%; }
.leg.right { right: 25%; }
.body-point { position: absolute; z-index: 5; width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50%; color: #fff; font-weight: 700; transform: translate(-50%,-50%); }
.body-point.pain { background: #d64545; }
.body-point.cup { background: var(--primary); }
.invoice-totals { max-width: 330px; margin-right: auto; }
.invoice-totals p { display: flex; justify-content: space-between; }
.invoice-totals .grand { padding-top: 10px; border-top: 2px solid #ddd; font-size: 20px; }

@media (max-width: 1200px) {
    .dashboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .app-sidebar { right: -290px; transition: right .25s ease; }
    .app-sidebar.is-open { right: 0; }
    .sidebar-close, .menu-toggle { display: block; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 1035; background: rgba(8,31,34,.48); }
    .sidebar-overlay.is-visible { display: block; }
    body.sidebar-open { overflow: hidden; }
    .app-main { margin-right: 0; }
    .app-topbar { padding: 13px 18px; }
    .page-content { padding: 20px 18px 30px; }
    .welcome-banner { padding: 28px; }
    .banner-visual { display: none; }
    .user-details { display: none; }
    .toolbar { grid-template-columns: 1fr; }
    .body-canvas { height: 520px; }
}
@media (max-width: 620px) {
    .topbar-start p, .logout-button { display: none; }
    .topbar-start h2 { font-size: 16px; }
    .welcome-banner { min-height: 260px; padding: 25px 21px; border-radius: 20px; }
    .welcome-actions { flex-direction: column; }
    .welcome-actions .btn { width: 100%; }
    .dashboard-stats { grid-template-columns: 1fr; }
    .dashboard-side { grid-template-columns: 1fr; }
    .content-card { padding: 18px; }
    .database-warning { flex-direction: column; }
}

/* Professional multi-line invoice */
.tax-context { display:flex; align-items:center; gap:10px; padding:12px 15px; border:1px solid #cde9e5; border-radius:13px; background:#f1fbf9; color:#46666a; }
.tax-context strong { color:var(--primary); }
.invoice-lines-table thead th { white-space:nowrap; color:#73888c; font-size:11px; }
.invoice-lines-table td { min-width:115px; }
.invoice-lines-table td:first-child { min-width:260px; }
.line-tax { display:flex; flex-direction:column; gap:3px; }
.line-tax-rate { color:var(--primary); font-weight:800; }
.line-tax-amount { color:var(--muted); }
.invoice-bottom-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(320px,.6fr); gap:18px; }
.invoice-summary-card h3 { margin-bottom:16px; font-size:17px; font-weight:800; }
.summary-row { display:flex; justify-content:space-between; gap:20px; padding:10px 0; border-bottom:1px solid #edf2f3; font-size:13px; }
.summary-row.grand { margin-top:5px; padding-top:16px; border-top:2px solid var(--primary); border-bottom:0; color:var(--primary); font-size:18px; }
.invoice-document { padding:34px; border:1px solid var(--border); border-radius:24px; background:#fff; box-shadow:var(--shadow); }
.invoice-document-head { display:flex; justify-content:space-between; gap:30px; padding-bottom:25px; border-bottom:1px solid var(--border); }
.invoice-document-head h2 { margin:10px 0 3px; font-size:20px; font-weight:800; }
.invoice-document-head p,.invoice-meta span { color:var(--muted); font-size:11px; }
.invoice-meta { display:flex; flex-direction:column; align-items:flex-end; gap:6px; direction:ltr; }
.invoice-meta strong { font-size:18px; }
.invoice-party-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:22px; }
.invoice-party-grid > div { display:flex; flex-direction:column; gap:5px; padding:15px; border-radius:14px; background:#f7fafb; }
.invoice-party-grid span,.invoice-party-grid small { color:var(--muted); font-size:10px; }
.invoice-print-table th { font-size:10px; white-space:nowrap; }
.invoice-print-table td { font-size:11px; }
.invoice-totals.modern { margin-top:25px; padding:18px; border-radius:16px; background:#f7fafb; }
@media (max-width:900px) { .invoice-bottom-grid { grid-template-columns:1fr; } .invoice-party-grid { grid-template-columns:1fr; } }
@media print { .app-sidebar,.app-topbar,.print-hide,.app-footer { display:none!important; } .app-main { margin:0!important; } .page-content { padding:0!important; } .invoice-document { border:0; box-shadow:none; padding:0; } }
.report-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
.report-mini { display:flex; flex-direction:column; gap:7px; padding:16px; border-radius:14px; background:#f7fafb; }
.report-mini span { color:var(--muted); font-size:11px; }
.report-mini strong { font-size:18px; }

/* Phase 3 clinical and accounting modules */
.content-card{padding:22px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);box-shadow:var(--shadow)}
.status-badge{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:var(--primary-soft);color:var(--primary);font-size:11px;font-weight:800}
.medical-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.procedure-card{display:flex;gap:16px}.procedure-card h3{font-size:17px;font-weight:800}.procedure-card p{color:var(--muted)}.procedure-icon{display:grid;width:52px;height:52px;flex:0 0 52px;place-items:center;border-radius:17px;background:var(--primary-soft);color:var(--primary);font-size:24px}.tag-row{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0}.tag-row span{padding:5px 9px;border-radius:999px;background:#f1f5f6;color:#527075;font-size:10px}.body-map-layout{display:grid;grid-template-columns:310px minmax(0,1fr);gap:18px}.map-tools{display:flex;flex-direction:column;gap:11px;align-self:start;position:sticky;top:105px}.map-tools h3{font-size:17px;font-weight:800}.map-help{margin:8px 0 0;color:var(--muted);font-size:11px;line-height:1.8}.otp-input{letter-spacing:6px;font-size:20px;font-weight:800;text-align:center;direction:ltr}.language-switch{margin:0}
html[dir="ltr"] .app-sidebar{right:auto;left:0;box-shadow:12px 0 40px rgba(9,45,48,.13)}html[dir="ltr"] .app-main{margin-right:0;margin-left:280px}html[dir="ltr"] .nav-link-item:hover,html[dir="ltr"] .nav-link-item.active{transform:translateX(2px)}html[dir="ltr"] .invoice-totals{margin-right:0;margin-left:auto}
@media(max-width:900px){.body-map-layout{grid-template-columns:1fr}.map-tools{position:static}.medical-grid{grid-template-columns:1fr}html[dir="ltr"] .app-sidebar{left:-290px;right:auto}html[dir="ltr"] .app-sidebar.is-open{left:0}html[dir="ltr"] .app-main{margin-left:0}}

/* Interactive clinical body maps */
.map-side-switch{display:grid;grid-template-columns:1fr 1fr;gap:6px}.map-side-switch button{border:1px solid var(--border);background:#fff;border-radius:10px;padding:9px;font-family:inherit}.map-side-switch button.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.body-map-card{overflow:hidden}.body-view-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.body-view-title span{color:var(--muted);font-size:11px}.medical-body-canvas{height:min(68vh,680px);min-height:560px;background:linear-gradient(#fbfdfd,#eef7f5);cursor:crosshair}.human-svg{position:absolute;inset:3% 12%;width:76%;height:94%;fill:#d7e5e3;stroke:#91aaa7;stroke-width:2;filter:drop-shadow(0 8px 12px #153b3b18)}.body-point{display:grid;place-items:center;cursor:pointer}.map-tools label{display:block;margin-top:10px;font-weight:700;font-size:12px}.map-help{padding:12px;border-radius:12px;background:#edf8f6;color:#456264;font-size:11px;line-height:1.8}
.login-page,.login-page *{font-family:'Cairo',sans-serif}.login-shell{width:min(960px,96vw);display:grid;grid-template-columns:1.05fr .95fr;overflow:hidden;border-radius:28px;box-shadow:0 30px 100px #002d2a66}.login-intro{display:flex;flex-direction:column;justify-content:center;padding:55px;color:#fff;background:linear-gradient(145deg,#075e57,#0f766e)}.login-intro h1{font-size:34px;margin:18px 0 10px}.login-intro p{color:#d5f1ed;line-height:2}.login-logo{display:grid;width:72px;height:72px;place-items:center;border-radius:22px;background:#ffffff20;border:1px solid #ffffff40;font-size:36px;font-weight:800}.login-shell .login-card{width:auto;max-width:none;border-radius:0;box-shadow:none;padding:48px}.login-card h2{font-weight:800}@media(max-width:760px){.login-shell{grid-template-columns:1fr}.login-intro{display:none}.login-shell .login-card{padding:32px}}


/* Phase 5.1: stable body-map coordinates in RTL/LTR and Arabic cultures */
.medical-body-canvas {
    position: relative;
    direction: ltr;
    isolation: isolate;
}
.medical-body-canvas .body-point {
    position: absolute;
    inset: auto auto auto auto;
    left: var(--point-x, 50%);
    top: var(--point-y, 50%);
    right: auto;
    bottom: auto;
    margin: 0;
    transform: translate(-50%, -50%);
}
.medical-body-canvas .human-svg { pointer-events: none; }

/* Phase 6: master-data cards and reports center */
.sidebar-master-cards{display:grid;gap:.55rem;padding:.4rem .75rem 1rem}.sidebar-master-card{display:flex;gap:.7rem;align-items:center;padding:.72rem .75rem;border:1px solid rgba(255,255,255,.1);border-radius:14px;background:rgba(255,255,255,.055);color:inherit;text-decoration:none;transition:.2s ease}.sidebar-master-card:hover{background:rgba(255,255,255,.12);transform:translateY(-1px);color:#fff}.sidebar-master-card>span{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:rgba(45,212,191,.16);font-size:1.05rem}.sidebar-master-card div{min-width:0;display:flex;flex-direction:column}.sidebar-master-card strong{font-size:.82rem}.sidebar-master-card small{font-size:.68rem;opacity:.68;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.report-launch-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.report-launch-card{display:flex;flex-direction:column;gap:.35rem;padding:1.2rem;border-radius:18px;border:1px solid #dbe8e7;background:#fff;text-decoration:none;color:#173c3a;box-shadow:0 10px 30px rgba(15,118,110,.06);transition:.2s ease}.report-launch-card:hover{transform:translateY(-3px);box-shadow:0 16px 35px rgba(11,87,145,.14);color:#0f766e}.report-launch-card>span{font-size:1.7rem}.report-launch-card strong{font-size:1rem}.report-launch-card small{color:#64748b;line-height:1.5}.permission-card{border:1px solid #dbe8e7;border-radius:14px;padding:1rem;background:#f8fbfb}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.25rem}.page-heading h1{margin:0 0 .3rem;font-size:1.55rem}.page-heading p{margin:0;color:#64748b}.metric-card{height:100%;padding:1rem;border:1px solid #dbe8e7;border-radius:16px;background:#fff}.metric-card small{display:block;color:#64748b;margin-bottom:.45rem}.metric-card strong{font-size:1.35rem;color:#0f766e}@media(max-width:1100px){.report-launch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.report-launch-grid{grid-template-columns:1fr}.page-heading{align-items:flex-start;flex-direction:column}}
@media print{.app-sidebar,.app-topbar,.sidebar-overlay,.page-heading .btn,form,.alert{display:none!important}.app-main,.page-content{margin:0!important;padding:0!important}.app-card,.metric-card{box-shadow:none!important;break-inside:avoid}}


/* LOGIC brand identity */
.brand-logo { display:grid; width:58px; height:48px; place-items:center; overflow:hidden; border-radius:14px; background:#fff; box-shadow:0 8px 22px rgba(0,0,0,.16); }
.brand-logo img { width:100%; height:100%; object-fit:contain; }
.brand-link strong { color:#fff; letter-spacing:1.2px; font-size:20px; }
.sidebar-submenu { margin-top:3px; }
.sidebar-submenu summary { display:grid; grid-template-columns:28px 1fr auto; align-items:center; gap:13px; padding:12px 14px; border-radius:13px; color:rgba(255,255,255,.9); cursor:pointer; list-style:none; transition:.2s ease; }
.sidebar-submenu summary::-webkit-details-marker { display:none; }
.sidebar-submenu summary:hover, .sidebar-submenu[open] summary { background:rgba(255,255,255,.13); }
.sidebar-submenu summary b { transition:transform .2s ease; }
.sidebar-submenu[open] summary b { transform:rotate(180deg); }
.submenu-links { display:flex; flex-direction:column; gap:4px; margin:6px 0 4px 13px; padding:7px 11px 7px 0; border-right:1px solid rgba(255,255,255,.18); }
.submenu-links a { display:flex; align-items:center; gap:10px; padding:9px 11px; border-radius:10px; color:rgba(255,255,255,.76); text-decoration:none; font-size:12px; }
.submenu-links a:hover, .submenu-links a.active { color:#fff; background:rgba(255,101,0,.2); }
.submenu-links a span { color:#ff9a57; }
.payment-summary-box { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:16px; padding:14px; border:1px solid #d8e5ef; border-radius:14px; background:#f8fbfe; }
.login-shell { display:grid; grid-template-columns:minmax(340px,1fr) minmax(360px,450px); align-items:center; gap:54px; width:min(1050px,94vw); }
.login-intro { color:#fff; text-align:center; }
.login-brand-image { display:block; width:min(560px,100%); max-height:340px; margin:0 auto 18px; object-fit:contain; border-radius:26px; box-shadow:0 24px 70px rgba(0,0,0,.2); }
.login-intro h1 { margin:0; font-size:32px; }
.login-intro p { color:rgba(255,255,255,.84); font-size:15px; }
.permission-card { min-height:82px; padding:16px; border:1px solid var(--border); border-radius:15px; background:#fff; cursor:pointer; transition:.2s; }
.permission-card:hover { border-color:#ff9a57; box-shadow:0 10px 26px rgba(11,87,145,.08); }
.btn-primary { box-shadow:0 7px 18px rgba(11,87,145,.16); }
.btn-primary:hover { box-shadow:0 9px 22px rgba(255,101,0,.18); }
@media(max-width:850px){ .login-shell{grid-template-columns:1fr;gap:20px}.login-intro h1,.login-intro p{display:none}.login-brand-image{max-height:210px}.payment-summary-box{grid-template-columns:1fr} }

/* Phase 8 — LOGIC identity: blue/orange only, transparent application logo. */
:root {
    --primary: #075a96;
    --primary-dark: #043e6c;
    --primary-soft: #eaf4fc;
    --secondary: #ff6500;
    --page-bg: #f4f7fb;
    --surface: #ffffff;
    --text: #0b416d;
    --muted: #6f8294;
    --border: #dce7f0;
    --shadow: 0 14px 36px rgba(4, 62, 108, .09);
}
.app-sidebar {
    background: radial-gradient(circle at 18% 8%, rgba(255,101,0,.16), transparent 25%), linear-gradient(165deg,#075a96 0%,#043e6c 64%,#032d4f 100%);
    box-shadow: -12px 0 40px rgba(4,62,108,.22);
}
.brand-logo {
    width:72px;
    height:58px;
    padding:0;
    overflow:visible;
    border-radius:0;
    background:transparent;
    box-shadow:none;
}
.brand-logo img { width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 5px 10px rgba(0,0,0,.18)); }
.system-status span { background:#ff7a1a; box-shadow:0 0 0 5px rgba(255,101,0,.16); }
.metric-icon.teal, .note-icon, .procedure-icon { background:#eaf4fc; color:#075a96; }
.health-note, .tax-context, .map-help { background:linear-gradient(145deg,#eef6fd,#fff); border-color:#cfe0ef; }
.form-control:focus,.form-select:focus { border-color:#5596c7; box-shadow:0 0 0 .2rem rgba(7,90,150,.14); }
.medical-body-canvas { background:linear-gradient(#fbfdff,#edf5fc); }
.human-svg { fill:#d8e6f1; stroke:#8ba9c0; }
.login-page {
    background: radial-gradient(circle at top right,rgba(255,101,0,.95) 0,transparent 29%), linear-gradient(145deg,#032d4f,#075a96 62%,#eaf4fc);
}
.login-intro {
    background:linear-gradient(145deg,#043e6c 0%,#075a96 68%,#ff6500 160%);
}
.login-intro p { color:#d9ebf8; }
.login-brand-image { width:min(430px,92%); max-height:300px; margin:0 auto; object-fit:contain; filter:drop-shadow(0 16px 30px rgba(0,0,0,.18)); }
.btn-success,.alert-success { background-color:#075a96!important; border-color:#075a96!important; color:#fff!important; }
.text-success { color:#075a96!important; }
.bg-success { background-color:#075a96!important; }
.report-launch-card:hover { color:#075a96; }
.sidebar-master-card>span { background:rgba(255,101,0,.18); color:#ffb27a; }

/* Phase 9 — delivery hardening, professional LOGIC mark, users, suppliers and e-invoices */
.brand-logo{width:64px;height:64px;flex:0 0 64px}.brand-logo img{width:64px;height:64px;object-fit:contain;filter:drop-shadow(0 7px 12px rgba(0,0,0,.24)) saturate(1.08)}
.brand-link{align-items:center}.brand-link>span:last-child{min-width:0}.brand-link small{line-height:1.5}
.user-chip-link{text-decoration:none;color:inherit}.user-chip-link:hover{color:var(--primary)}
.login-brand-image{display:none!important}.login-brand-mark{display:block;width:min(300px,70%);aspect-ratio:1;margin:0 auto 4px;object-fit:contain;filter:drop-shadow(0 18px 32px rgba(0,0,0,.28)) saturate(1.08)}
.login-wordmark{font-size:52px;line-height:1;font-weight:800;letter-spacing:8px;color:#ff6500;text-shadow:0 8px 24px rgba(0,0,0,.2);direction:ltr;margin-bottom:10px}
.login-intro h1{font-size:27px;margin:0 0 10px}.login-intro{background:linear-gradient(145deg,#032d4f 0%,#075a96 72%,#ff6500 175%)}
.status-active{background:#eaf4fc;color:#075a96;border-color:#bfd8eb}.status-inactive{background:#f1f4f7;color:#64748b;border-color:#dce3e9}
.user-income-card{margin:18px 0}.user-income-total{display:flex;min-width:190px;flex-direction:column;align-items:flex-end;padding:13px 18px;border-radius:15px;background:linear-gradient(135deg,#075a96,#043e6c);color:#fff}.user-income-total small,.user-income-total span{opacity:.78}.user-income-total strong{font-size:22px}.user-income-breakdown{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:15px}.user-income-breakdown>div{padding:13px;border:1px solid var(--border);border-radius:14px;background:#f8fbfe}.user-income-breakdown span{display:block;color:var(--muted);font-size:12px}.user-income-breakdown strong{display:block;margin-top:4px;color:var(--primary);font-size:18px}
.einvoice-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.einvoice-metric{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border:1px solid var(--border);border-radius:16px;background:#fff;text-decoration:none;box-shadow:var(--shadow)}.einvoice-metric strong{font-size:24px;color:var(--primary)}.einvoice-metric.active{border-color:#ff8b3f;box-shadow:0 0 0 3px rgba(255,101,0,.11)}
.zatca-pill{display:inline-flex;align-items:center;padding:5px 9px;border:1px solid transparent;border-radius:999px;font-size:11px;font-weight:700;white-space:nowrap}.zatca-sent{background:#eaf4fc;color:#075a96;border-color:#bcd8ea}.zatca-pending{background:#fff4ea;color:#b95000;border-color:#ffd0ad}.zatca-warning{background:#fff8df;color:#8a6500;border-color:#f3df94}.zatca-failed{background:#fff0f1;color:#b52c40;border-color:#f1bcc5}.response-cell{max-width:270px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tax-integration-note,.security-note{padding:12px 14px;margin-bottom:14px;border:1px solid #c8dcec;border-radius:13px;background:#eef6fd;color:#315b78;line-height:1.8}.filter-bar{display:flex;gap:8px;margin-bottom:14px}.filter-bar .form-control{max-width:520px}
.form-section{padding:18px 0;border-bottom:1px solid var(--border)}.form-section:first-child{padding-top:0}.form-section:last-of-type{border-bottom:0}.form-section-title{display:flex;align-items:center;gap:12px;margin-bottom:16px}.form-section-title>span{display:grid;width:34px;height:34px;place-items:center;border-radius:11px;background:var(--primary);color:#fff;font-weight:800}.form-section-title strong{display:block;color:var(--primary);font-size:16px}.form-section-title small{display:block;color:var(--muted);margin-top:2px}.tax-check{width:100%;padding:11px 14px;border:1px solid var(--border);border-radius:12px;background:#f8fbfe}.form-actions{display:flex;gap:8px;padding-top:18px}.supplier-details-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.supplier-details-grid .full-width{grid-column:1/-1}.details-list{display:grid;grid-template-columns:150px 1fr;gap:0;margin:0}.details-list dt,.details-list dd{padding:9px 0;border-bottom:1px solid var(--border)}.details-list dt{color:var(--muted)}.details-list dd{font-weight:600}.summary-row{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.summary-row>div{padding:16px;border-radius:14px;background:#f8fbfe}.summary-row span{display:block;color:var(--muted)}.summary-row strong{display:block;margin-top:5px;color:var(--primary);font-size:20px}.password-form-card{max-width:850px}.status-verified{background:#eaf4fc;color:#075a96}.status-notverified{background:#fff4ea;color:#b95000}.status-invalid,.status-expired{background:#fff0f1;color:#b52c40}
@media(max-width:900px){.user-income-breakdown,.einvoice-metrics{grid-template-columns:repeat(2,1fr)}.supplier-details-grid{grid-template-columns:1fr}.supplier-details-grid .full-width{grid-column:auto}}
@media(max-width:560px){.user-income-breakdown,.einvoice-metrics,.summary-row{grid-template-columns:1fr}.filter-bar{flex-direction:column}.filter-bar .form-control{max-width:none}.login-wordmark{font-size:40px}.login-brand-mark{width:190px}}

/* Phase 10 — professional patient medical profile */
.medical-screening-card{border-top:4px solid var(--secondary)}
.medical-warning-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 11px;border-radius:999px;background:#fff3e9;color:#a84400;font-size:11px;font-weight:800;border:1px solid #ffd1ae}
.medical-check-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.medical-check{display:flex;align-items:flex-start;gap:10px;padding:12px;border:1px solid #dce7f0;border-radius:14px;background:#fbfdff;cursor:pointer;transition:.18s ease}
.medical-check:hover{border-color:#87b5d6;box-shadow:0 8px 22px rgba(7,90,150,.08)}
.medical-check input{width:18px;height:18px;margin-top:2px;accent-color:var(--primary);flex:0 0 auto}
.medical-check span{display:flex;flex-direction:column;gap:2px}.medical-check b{font-size:12px;color:#164b73}.medical-check small{font-size:9px;color:#758b9d}
.medical-check.high-risk{background:#fff8f3;border-color:#ffd8bd}.medical-check.high-risk input{accent-color:var(--secondary)}
.medical-profile-tags{display:flex;flex-wrap:wrap;gap:7px}.medical-profile-tag{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#eef5fb;border:1px solid #d4e4f1;color:#15547d;font-size:11px;font-weight:700}.medical-profile-tag.alert-tag{background:#fff1e8;border-color:#ffcba8;color:#a84705}
.medical-alert-box{border:1px solid #ffd0ae;background:#fff7f1;border-radius:16px;padding:14px;color:#7b3c10}
@media(max-width:1100px){.medical-check-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.medical-check-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.medical-check-grid{grid-template-columns:1fr}}
