:root {
    --navy: #162840;
    --navy-2: #203958;
    --teal: #0f766e;
    --blue: #2563eb;
    --line: #d7e0ec;
    --soft: #f3f6fb;
    --ink: #172333;
    --muted: #66758a;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; background: radial-gradient(circle at top right, #eef6ff 0, var(--soft) 340px); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 276px; background: linear-gradient(180deg, #142640, #0f1f34); color: #fff; position: fixed; inset: 0 auto 0 0; padding: 18px 14px; transition: transform .2s ease; z-index: 20; box-shadow: 12px 0 34px rgba(15,35,60,.18); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; line-height: 1.25; font-weight: 700; padding: 10px 12px 22px; }
.brand span { overflow-wrap: anywhere; }
.sidebar .brand .sidebar-logo { display: block; width: 46px !important; height: 46px !important; max-width: 46px !important; max-height: 46px !important; object-fit: contain; flex: 0 0 46px; border-radius: 8px; background: #fff; padding: 5px; }
.sidebar nav { padding-bottom: 18px; }
.sidebar-section { margin: 16px 9px 7px; color: #8fb4d6; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sidebar a { display: flex; align-items: center; min-height: 40px; color: #dce7f7; text-decoration: none; padding: 9px 12px; border-radius: 8px; margin-bottom: 4px; border: 1px solid transparent; line-height: 1.25; }
.sidebar a:hover, .sidebar a.active { background: rgba(15,118,110,.92); color: #fff; border-color: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 #5eead4; }
.sidebar a.active { font-weight: 800; }
.sidebar-group { margin-bottom: 7px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.03); overflow: hidden; }
.sidebar-group[open] { background: rgba(255,255,255,.04); }
.sidebar-group > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 12px; color: #fff; cursor: pointer; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-group > summary::-webkit-details-marker { display: none; }
.sidebar-group > summary:hover { background: rgba(255,255,255,.05); }
.sidebar-group > summary i { font-style: normal; color: #8fb4d6; transition: transform .18s ease; }
.sidebar-group[open] > summary i { transform: rotate(180deg); }
.sidebar-main-link { margin: 8px 10px 6px; background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }
.sidebar-submenu { display: grid; gap: 4px; padding: 0 10px 10px; }
.sidebar-submenu a { min-height: 36px; padding: 8px 11px 8px 22px; margin-bottom: 0; border-radius: 7px; background: rgba(8,15,26,.26); position: relative; font-size: 13px; }
.sidebar-submenu a::before { content: ""; position: absolute; left: 11px; top: 50%; width: 6px; height: 6px; border-radius: 999px; background: rgba(94,234,212,.85); transform: translateY(-50%); }
.sidebar-submenu a:hover, .sidebar-submenu a.active { background: rgba(37,99,235,.28); box-shadow: inset 3px 0 0 #93c5fd; }
.sidebar a.sidebar-logout { color: #fecaca; }
.sidebar .sidebar-logout { width: 100%; border: 0; text-align: left; background: transparent; color: #fecaca; min-height: 40px; padding: 9px 12px; border-radius: 8px; margin-bottom: 4px; }
.sidebar .sidebar-logout:hover { background: rgba(185,28,28,.9); color: #fff; }
.sidebar-close { display: none; }
.main-content { margin-left: 276px; width: calc(100% - 276px); min-height: 100vh; }
.topbar { min-height: 70px; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 14px; padding: 10px 22px; position: sticky; top: 0; z-index: 10; box-shadow: 0 8px 22px rgba(25,42,70,.05); }
.topbar-brand { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.topbar-logo { width: 42px; height: 42px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; box-shadow: 0 8px 18px rgba(27,43,65,.08); }
.topbar-title { min-width: 0; text-align: center; line-height: 1.15; }
.topbar-title strong, .topbar-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title strong { max-width: min(44vw, 520px); font-size: 16px; color: #10243a; }
.topbar-title span { max-width: min(48vw, 560px); margin-top: 3px; color: var(--muted); font-size: 12px; }
.account-menu { justify-self: end; }
.account-button { width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #0f766e); color: #fff; font-weight: 800; box-shadow: 0 10px 20px rgba(37,99,235,.22); }
.account-dropdown { border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-width: 190px; box-shadow: 0 16px 34px rgba(27,43,65,.14); }
.account-name { font-weight: 800; color: var(--ink); padding: 3px 6px 0; }
.account-date { color: var(--muted); font-size: 12px; padding: 2px 6px 4px; }
.employee-copy-bar { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; gap: 8px; align-items: center; padding: 10px 22px; background: linear-gradient(90deg, #ecfeff, #f8fbff); border-bottom: 1px solid var(--line); }
.storage-limit-alert { padding: 13px 22px; background: #b91c1c; color: #fff; border-bottom: 1px solid #7f1d1d; text-align: center; font-size: 14px; line-height: 1.45; box-shadow: 0 5px 16px rgba(127,29,29,.2); }
.storage-limit-alert strong { margin-right: 4px; }
.storage-limit-alert a { color: #fff; font-weight: 800; text-decoration: underline; white-space: nowrap; }
.employee-open { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 13px; border-radius: 8px; background: #fff; border: 1px solid #b7d4f5; color: #0f3d65; text-decoration: none; font-weight: 800; white-space: nowrap; }
.employee-open:hover { border-color: var(--teal); color: var(--teal); }
.content-wrap { padding: 22px; }
.panel { background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 18px; box-shadow: 0 10px 30px rgba(27,43,65,.07); overflow-x: auto; }
.patient-search-results { position: absolute; left: 0; right: 0; top: calc(100% - 2px); z-index: 1050; background: #fff; border: 1px solid var(--line); border-radius: 0 0 10px 10px; box-shadow: 0 18px 32px rgba(27,43,65,.15); overflow: hidden; max-height: 280px; overflow-y: auto; }
.patient-result-item { width: 100%; text-align: left; border: 0; border-bottom: 1px solid #edf2f7; background: #fff; padding: 10px 12px; display: grid; gap: 2px; }
.patient-result-item:hover { background: #f5fbff; }
.patient-result-item strong { display: block; color: var(--ink); font-size: 14px; }
.patient-result-item span { display: block; color: var(--muted); font-size: 12px; }
.quick-patient-modal { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(10,20,35,.58); padding: 20px; overflow-y: auto; }
.quick-patient-modal.open { display: grid; place-items: center; }
.quick-patient-dialog { width: min(960px, 100%); }
.quick-patient-card { background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(248,251,255,.98)); border: 1px solid rgba(215,224,236,.95); border-radius: 22px; box-shadow: 0 30px 70px rgba(15,23,42,.22); overflow: hidden; }
.quick-patient-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid #e8eef7; }
.quick-patient-kicker { color: #0f766e; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.quick-patient-head h5 { margin: 0; font-size: 22px; font-weight: 900; color: #10243a; }
.quick-patient-close { width: 38px; height: 38px; border: 0; border-radius: 999px; background: #eef4ff; color: #103055; font-size: 24px; line-height: 1; font-weight: 700; }
.quick-patient-body { padding: 20px; }
.quick-patient-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 20px; border-top: 1px solid #e8eef7; background: #f8fbff; }
body.modal-open { overflow: hidden; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-title h4 { font-size: 24px; font-weight: 800; margin: 0; }
.stat { background: linear-gradient(180deg, #fff, #f9fbff); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-height: 102px; box-shadow: 0 8px 22px rgba(27,43,65,.05); }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 8px; }
.stat-link { display: block; color: var(--ink); text-decoration: none; }
.stat-link:hover { border-color: var(--teal); box-shadow: 0 12px 28px rgba(15,118,110,.14); transform: translateY(-1px); }
.stat-link .label, .stat-link .value { display: block; }
.mini-card { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; color: var(--ink); text-decoration: none; background: #fff; box-shadow: 0 6px 18px rgba(27,43,65,.04); }
.mini-card span { font-size: 22px; font-weight: 800; color: var(--teal); }
.mini-card:hover { border-color: var(--teal); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table th, .table td { white-space: nowrap; vertical-align: middle; }
.form-label { font-weight: 600; }
.form-control, .form-select { border-color: #d5deeb; border-radius: 7px; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 .2rem rgba(37,99,235,.14); }
.btn { border-radius: 7px; font-weight: 600; }
.btn-primary { background: linear-gradient(135deg, #2563eb, #0f766e); border: 0; box-shadow: 0 8px 18px rgba(37,99,235,.16); }
.btn-primary:hover { filter: brightness(.96); }
.table { margin-bottom: 0; }
.table thead th { color: #24364c; background: #f4f7fb; border-bottom: 1px solid var(--line); }
.table tbody tr:hover { background: #f7fbff; }
.quick-actions { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.quick-actions a, .report-tile { color: var(--ink); text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; box-shadow: 0 8px 22px rgba(27,43,65,.05); min-height: 50px; display: flex; align-items: center; }
.quick-actions a:hover, .report-tile:hover { border-color: var(--teal); box-shadow: 0 12px 28px rgba(15,118,110,.12); transform: translateY(-1px); }
.report-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.report-tile strong { display: block; font-size: 16px; margin-bottom: 7px; }
.report-tile span { display: block; color: var(--muted); line-height: 1.45; }
.security-list { display: grid; gap: 10px; }
.security-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.security-item strong, .security-item span { display: block; }
.security-item > div span { color: var(--muted); margin-top: 3px; line-height: 1.4; }
.employee-link-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.employee-link-actions { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 8px; width: min(680px, 100%); }
.sidebar-toggle { display: none; align-items: center; justify-content: center; gap: 8px; width: 42px; height: 42px; padding: 0; }
.hamburger-icon { width: 18px; display: grid; gap: 4px; }
.hamburger-icon span { display: block; height: 2px; background: currentColor; border-radius: 999px; transition: transform .2s ease, opacity .2s ease; }
.sidebar-backdrop { display: none; }
.invoice-table td { vertical-align: middle; }
.invoice-totals { display: grid; gap: 8px; justify-content: end; text-align: right; padding-top: 12px; border-top: 1px solid var(--line); }
.invoice-totals strong { display: inline-block; min-width: 110px; font-size: 16px; }
.settings-logo { max-height: 86px; max-width: 180px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.medicine-entry-tabs { border-bottom: 2px solid var(--line); }
.medicine-entry-tabs .nav-link { font-weight: 700; color: var(--navy); }
.medicine-entry-tabs .nav-link.active { color: #0f766e; border-bottom: 3px solid #0f766e; }
.entry-tab-box { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.selected-medicine-preview { color: #0f766e; font-weight: 700; min-height: 22px; }
.bulk-action-bar { display:flex; align-items:center; gap:12px; margin:0 0 10px; }
.bulk-action-bar span { color:var(--muted); font-weight:700; }
.select-cell { width:42px; text-align:center; }
.select-cell input { width:18px; height:18px; cursor:pointer; }
.invoice-card { position: relative; background: #fff; border: 1px solid #cfe1f7; border-radius: 8px; padding: 0 28px 24px; box-shadow: 0 14px 34px rgba(2,132,199,.1); overflow: hidden; }
.invoice-card::before { content: "+"; position: absolute; top: 42px; right: 285px; color: #e0f2fe; font-size: 92px; line-height: 1; font-weight: 800; z-index: 0; }
.invoice-top-strip { height: 14px; margin: 0 -28px 22px; background: linear-gradient(90deg, var(--invoice-primary,#1f446d) 0 58%, var(--invoice-accent,#4295ed) 58% 100%); }
.invoice-brand-row, .invoice-info-row, .invoice-items-table, .invoice-bottom-row, .invoice-sign-row, .invoice-footer-note { position: relative; z-index: 1; }
.invoice-brand-row { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #bfdbfe; }
.invoice-brand-left { display: flex; gap: 16px; align-items: flex-start; }
.invoice-logo { width: 74px; height: 74px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.invoice-brand-left h2 { margin: 0 0 6px; font-size: 25px; color: #0f2f57; }
.invoice-brand-left p { margin: 2px 0; color: #536173; }
.invoice-meta { min-width: 260px; text-align: right; }
.invoice-label { color: var(--invoice-primary,#1f446d); font-weight: 900; letter-spacing: .04em; text-transform: uppercase; font-size: clamp(28px,5vw,54px); line-height:1; }
.invoice-meta h3 { color: var(--navy); margin: 4px 0 10px; font-size: 25px; }
.invoice-meta-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; color: #5d6b7c; }
.invoice-meta-grid strong { color: var(--ink); }
.invoice-status { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; }
.invoice-status-success { background: #dcfce7; color: #166534; }
.invoice-status-warning { background: #fef3c7; color: #92400e; }
.invoice-status-danger { background: #fee2e2; color: #991b1b; }
.invoice-total-due { margin-top: 12px; margin-left: auto; width: 200px; background: var(--invoice-primary,#1f446d); color: #fff; border-radius: 6px; padding: 11px 14px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 10px 22px rgba(29,78,216,.18); }
.invoice-total-due span { font-size: 12px; text-transform: uppercase; }
.invoice-total-due strong { font-size: 20px; }
.invoice-info-row { display: grid; grid-template-columns: 1.35fr .85fr; gap: 18px; margin-bottom: 18px; }
.invoice-customer-box, .invoice-payment-box, .invoice-terms { border: 1px solid #bfdbfe; border-radius: 8px; padding: 14px; background: linear-gradient(180deg, #f8fbff, #eef7ff); }
.invoice-customer-box h5, .invoice-payment-box h5, .invoice-terms h5 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; color: #0369a1; font-weight: 800; }
.invoice-customer-box strong { display: block; font-size: 17px; color: #0f2f57; margin-bottom: 4px; }
.invoice-customer-box p, .invoice-terms p { margin: 0 0 8px; color: #5d6b7c; }
.invoice-contact-grid { display: grid; grid-template-columns: 76px 1fr; gap: 4px 10px; font-size: 13px; }
.invoice-contact-grid span { color: #66758a; }
.invoice-contact-grid b { color: var(--ink); }
.invoice-payment-box div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 7px 0; }
.invoice-payment-box div:last-child { border-bottom: 0; }
.invoice-items-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.invoice-items-table th { background: var(--invoice-accent,#4295ed); color: #fff; font-size: 12px; text-transform: uppercase; padding: 10px 9px; }
.invoice-items-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); }
.invoice-items-table tbody tr:nth-child(even) { background: #f0f7ff; }
.invoice-bottom-row { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
.invoice-summary { display: grid; gap: 0; }
.invoice-summary div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 7px 0; }
.invoice-summary .grand { background: var(--invoice-primary,#1f446d); color: #fff; border: none; border-radius: 6px; padding: 11px 14px; margin: 6px 0; font-size: 18px; box-shadow: 0 10px 22px rgba(29,78,216,.14); }
.invoice-sign-row { display: flex; justify-content: space-between; gap: 32px; margin-top: 38px; color: #66758a; }
.invoice-sign-row span { min-width: 190px; border-top: 1px solid #9aa7b6; padding-top: 8px; text-align: center; }
.invoice-footer-note { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); color: #66758a; text-align: center; }
.print-body { background: #fff; padding: 0; }
.invoice-print-card { box-shadow: none; border: none; border-radius: 0; width: min(100%, var(--invoice-paper-width,210mm)); min-height: 0; margin: 0 auto; box-sizing:border-box; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--soft); padding: 20px; }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 26px; box-shadow: 0 12px 30px rgba(27,43,65,.08); }
.login-body { background:
    radial-gradient(circle at top left, rgba(37,99,235,.20), transparent 34%),
    radial-gradient(circle at bottom right, rgba(15,118,110,.18), transparent 30%),
    linear-gradient(135deg, #f4f8ff 0%, #eefdf8 100%);
}
.login-page-shell { width: min(1120px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; gap: 26px; align-items: center; }
.login-brand-panel { color: #10243a; padding: 24px 10px 24px 0; }
.login-brand-badge { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.72); border: 1px solid rgba(37,99,235,.14); color: #0f766e; font-weight: 800; box-shadow: 0 10px 24px rgba(27,43,65,.08); margin-bottom: 16px; }
.login-brand-panel h1 { font-size: clamp(34px, 4vw, 54px); line-height: 1.02; margin: 0 0 10px; font-weight: 900; letter-spacing: -.03em; }
.login-brand-panel p { margin: 0 0 20px; font-size: 16px; color: var(--muted); max-width: 540px; }
.login-feature-list { display: grid; gap: 12px; max-width: 520px; }
.login-feature-list div { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.72); border: 1px solid rgba(215,224,236,.8); box-shadow: 0 16px 30px rgba(27,43,65,.07); }
.login-feature-list strong { color: #123047; }
.login-feature-list span { color: var(--muted); font-size: 13px; }
.login-card-modern { position: relative; overflow: hidden; width: 100%; max-width: 460px; border: 1px solid rgba(215,224,236,.95); border-radius: 22px; padding: 28px; box-shadow: 0 24px 60px rgba(27,43,65,.14); backdrop-filter: blur(12px); background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.94)); }
.login-card-modern::before { content: ""; position: absolute; inset: auto -70px -70px auto; width: 190px; height: 190px; background: radial-gradient(circle, rgba(37,99,235,.14), transparent 70%); pointer-events: none; }
.login-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.login-kicker { display: inline-block; color: #0f766e; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; margin-bottom: 6px; }
.login-card-top h3 { margin: 0; font-size: 28px; color: #10243a; font-weight: 900; }
.login-avatar { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: #fff; font-weight: 900; background: linear-gradient(135deg, #2563eb, #0f766e); box-shadow: 0 16px 30px rgba(37,99,235,.22); }
.login-subtitle { color: var(--muted); margin-bottom: 18px; }
.login-card-modern .form-control { border-radius: 14px; border-color: #d7e0ec; box-shadow: none; }
.login-card-modern .form-control:focus { border-color: rgba(37,99,235,.75); box-shadow: 0 0 0 .2rem rgba(37,99,235,.12); }
.login-submit { border-radius: 14px; min-height: 48px; margin-top: 6px; }
.login-footer-links { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 16px; color: var(--muted); font-size: 13px; }
.login-footer-links a { color: #0f766e; text-decoration: none; font-weight: 800; }
.login-footer-links a:hover { text-decoration: underline; }
.barcode-panel { text-align: center; }
.barcode-svg { max-width: 100%; height: auto; background: #fff; }
.barcode-print-card { width: 82mm; margin: 12mm auto; padding: 8mm; border: 1px solid #d7e0ec; text-align: center; font-family: Arial, sans-serif; }
.barcode-print-card h3 { margin: 0 0 4px; font-size: 18px; }
.barcode-print-card p { margin: 0 0 10px; font-size: 12px; }
.detail-tile { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; min-height: 74px; }
.detail-tile span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.detail-tile strong { overflow-wrap: anywhere; }
.barcode-scan-box { max-width: 780px; }
.prescription-print-body { margin: 0; background: #e5e7eb; color: #111827; font-family: Georgia, "Times New Roman", serif; }
.prescription-sheet { position: relative; width: 210mm; min-height: 297mm; margin: 12px auto; background: #fffdf1; box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow: hidden; display: flex; flex-direction: column; }
.prescription-size-a5 { width: 148mm; min-height: 210mm; }
.prescription-size-letter { width: 216mm; min-height: 279mm; }
.rx-motto { text-align: center; color: #b91c1c; font-size: clamp(18px, 3vw, 28px); font-weight: 800; padding: 12px 12px 8px; }
.rx-green-line { height: 7px; border-top: 2px solid #0f5132; border-bottom: 3px solid #0f5132; background: #fef3c7; }
.rx-header { display: grid; grid-template-columns: 1fr .55fr 1fr; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #8aa79a; }
.rx-header h1 { margin: 0; color: #172554; font-size: clamp(18px, 3vw, 30px); font-weight: 800; }
.rx-header h3 { margin: 3px 0; font-size: clamp(11px, 1.7vw, 15px); text-decoration: underline; }
.rx-header p { margin: 0; font-size: clamp(9px, 1.4vw, 12px); line-height: 1.35; }
.rx-right { text-align: right; }
.rx-center { text-align: center; display: grid; place-items: center; align-content: center; gap: 4px; color: #14532d; font-weight: 800; }
.rx-center img { max-width: 58px; max-height: 58px; object-fit: contain; }
.rx-patient-row { display: grid; grid-template-columns: 1.8fr .8fr .8fr 1fr; gap: 12px; padding: 9px 18px; border-bottom: 1px solid #d1d5db; font-size: clamp(10px, 1.5vw, 13px); }
.rx-patient-row span { border-bottom: 1px dotted #777; min-height: 20px; }
.rx-body { flex: 1; display: grid; grid-template-columns: 32% 68%; min-height: 0; }
.rx-left-box { margin: 14px 10px 10px 16px; padding: 12px; background: #fff2bd; border: 1px solid #c7a86a; box-shadow: 0 2px 5px rgba(0,0,0,.12); font-size: clamp(10px, 1.45vw, 13px); line-height: 1.45; }
.rx-left-box h4 { margin: 0 0 8px; color: #1d4ed8; font-size: clamp(12px, 1.8vw, 16px); }
.rx-write-area { position: relative; min-height: 130mm; padding: 16px; }
.rx-symbol { color: #16a34a; font-size: clamp(28px, 5vw, 48px); font-weight: 800; font-family: Georgia, serif; }
.rx-watermark-img { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); max-width: 58%; max-height: 58%; opacity: .13; object-fit: contain; pointer-events: none; }
.rx-watermark-text { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%) rotate(-28deg); opacity: .1; font-size: clamp(42px, 8vw, 96px); font-weight: 900; color: #334155; white-space: nowrap; pointer-events: none; }
.rx-next-visit { text-align: right; padding: 0 26px 12px; font-weight: 700; font-size: clamp(10px, 1.5vw, 13px); }
.rx-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 18px 26px 24px; border-top: 5px double #4973a6; background: #fffaf0; }
.rx-footer h4 { margin: 0 0 7px; color: #7f1d1d; border-bottom: 1px solid #b98585; font-size: clamp(12px, 1.8vw, 16px); }
.rx-footer p { margin: 0; line-height: 1.45; font-size: clamp(10px, 1.5vw, 13px); }
.rx-print-actions { position: fixed; right: 18px; bottom: 18px; }
.rx-print-actions button { border: 0; border-radius: 8px; padding: 10px 18px; background: #2563eb; color: #fff; font-weight: 800; }
@media print {
    .prescription-print-body { background: #fff; }
    .prescription-sheet { width: 100% !important; min-height: 100vh !important; margin: 0; box-shadow: none; }
    .rx-print-actions { display: none; }
    @page { size: A4; margin: 0; }
    .prescription-size-a5 { page: a5prescription; }
    .prescription-size-letter { page: letterprescription; }
}
@page a5prescription { size: A5; margin: 0; }
@page letterprescription { size: Letter; margin: 0; }
@media (max-width: 760px) {
    .prescription-sheet { width: calc(100vw - 18px); min-height: 140vw; }
    .rx-header { grid-template-columns: 1fr; text-align: center; }
    .rx-right { text-align: center; }
    .rx-patient-row { grid-template-columns: 1fr 1fr; }
    .rx-body { grid-template-columns: 1fr; }
    .rx-write-area { min-height: 420px; }
    .rx-footer { grid-template-columns: 1fr; }
}
@media print {
    @page { size: A4; margin: 10mm; }
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-body { padding: 0; background: #fff; }
    .invoice-card { box-shadow: none; border: none; padding: 0 10mm 8mm; font-size: 12px; }
    .invoice-top-strip { margin: 0 -10mm 14px; }
    .invoice-brand-row { margin-bottom: 12px; padding-bottom: 12px; }
    .invoice-logo { width: 58px; height: 58px; }
    .invoice-brand-left h2, .invoice-meta h3 { font-size: 20px; }
    .invoice-info-row { margin-bottom: 12px; }
    .invoice-customer-box, .invoice-payment-box, .invoice-terms { padding: 10px; }
    .invoice-items-table th, .invoice-items-table td { padding: 7px 6px; }
    .invoice-bottom-row { grid-template-columns: 1fr 300px; gap: 16px; }
    .invoice-sign-row { margin-top: 26px; }
    .invoice-footer-note { margin-top: 12px; }
}
@media (max-width: 900px) {
    body.sidebar-open { overflow: hidden; }
    .sidebar { transform: translateX(-100%); width: min(86vw, 310px); padding-top: 20px; z-index: 30; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: grid; place-items: center; position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.1); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
    .sidebar-close:hover { background: rgba(255,255,255,.18); }
    .sidebar .brand { padding-right: 46px; }
    .sidebar-group > summary { min-height: 42px; }
    .sidebar-submenu a { font-size: 12px; }
    .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(10,20,35,.58); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 25; }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .main-content { margin-left: 0; width: 100%; }
    .sidebar-toggle { display: inline-flex; }
    body.sidebar-open .hamburger-icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    body.sidebar-open .hamburger-icon span:nth-child(2) { opacity: 0; }
    body.sidebar-open .hamburger-icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    .topbar { grid-template-columns: 42px minmax(0, 1fr) 42px; padding: 10px 14px; gap: 8px; }
    .topbar-title strong { max-width: 54vw; font-size: 14px; }
    .topbar-title span { max-width: 56vw; font-size: 11px; }
    .employee-copy-bar { grid-template-columns: 1fr auto; padding: 10px 14px; }
    .employee-copy-bar .form-control { grid-column: 1 / -1; order: 3; font-size: 12px; }
    .employee-open { min-height: 36px; }
    .content-wrap { padding: 14px; }
    .panel { padding: 14px; margin-bottom: 14px; }
    .invoice-brand-row, .invoice-brand-left { display: block; }
    .invoice-meta { text-align: left; margin-top: 16px; }
    .invoice-info-row, .invoice-bottom-row, .invoice-billto { grid-template-columns: 1fr; }
    .invoice-card { padding: 0 16px 18px; }
    .invoice-top-strip { margin: 0 -16px 16px; }
    .invoice-card::before { display: none; }
    .invoice-total-due { margin-left: 0; width: 100%; }
    .invoice-sign-row { flex-direction: column; gap: 28px; }
    .quick-actions, .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .employee-link-panel { display: block; }
    .employee-link-actions { grid-template-columns: 1fr; margin-top: 12px; }
}
@media (max-width: 560px) {
    body { font-size: 13px; }
    .btn { min-height: 38px; }
    .topbar .sidebar-toggle { padding-left: 12px; padding-right: 12px; }
    .topbar-logo { width: 38px; height: 38px; }
    .account-button, .sidebar-toggle { width: 38px; height: 38px; }
    .content-wrap { padding: 12px; }
    .panel { border-radius: 8px; padding: 12px; box-shadow: 0 8px 20px rgba(27,43,65,.06); }
    .mobile-slider,
    .stat-slider,
    .card-slider {
        display: grid !important;
        grid-auto-flow: column;
        grid-auto-columns: minmax(238px, 82%);
        grid-template-columns: none !important;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 2px 12px 14px;
        margin-left: -12px;
        margin-right: -12px;
    }
    .mobile-slider::-webkit-scrollbar,
    .stat-slider::-webkit-scrollbar,
    .card-slider::-webkit-scrollbar { height: 6px; }
    .mobile-slider::-webkit-scrollbar-thumb,
    .stat-slider::-webkit-scrollbar-thumb,
    .card-slider::-webkit-scrollbar-thumb { background: #c5d2e4; border-radius: 999px; }
    .mobile-slider > *,
    .stat-slider > *,
    .card-slider > * {
        width: 100%;
        max-width: none;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
    .mobile-slider a,
    .stat-slider .stat,
    .card-slider .stat,
    .card-slider .mini-card {
        min-height: 112px;
        border-color: rgba(37,99,235,.16);
        box-shadow: 0 14px 28px rgba(27,43,65,.09);
    }
    .mobile-slider a {
        align-items: flex-end;
        background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
        color: #123047;
        font-size: 15px;
        font-weight: 800;
    }
    .report-grid { grid-template-columns: 1fr; }
    .page-title { align-items: flex-start; flex-direction: column; }
    .page-title h4 { font-size: 21px; }
    .page-title > div { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; }
    .stat { min-height: 86px; padding: 14px; }
    .stat .value { font-size: 22px; }
    .mini-card { align-items: flex-start; gap: 10px; }
    .security-item { align-items: flex-start; flex-direction: column; }
    .mini-card strong { overflow-wrap: anywhere; }
    .form-control, .form-select, .input-group .btn { min-height: 40px; }
    .invoice-contact-grid, .invoice-meta-grid { grid-template-columns: 1fr; gap: 2px; }
    .invoice-payment-box div, .invoice-summary div { gap: 12px; }
    .quick-patient-modal { padding: 12px; }
    .quick-patient-head, .quick-patient-body, .quick-patient-footer { padding-left: 14px; padding-right: 14px; }
    .quick-patient-head h5 { font-size: 20px; }
    .login-page-shell { grid-template-columns: 1fr; }
    .login-brand-panel { padding-right: 0; }
    .login-card-modern { padding: 22px; border-radius: 18px; }
    .login-card-top h3 { font-size: 24px; }
    .login-footer-links { flex-direction: column; align-items: flex-start; }
}

.auto-list-tools{display:grid;grid-template-columns:minmax(220px,2fr) minmax(145px,1fr) minmax(145px,1fr) auto;gap:12px;align-items:end;padding:14px;margin:12px 0;background:#fff;border:1px solid #d9e3ef;border-radius:10px;box-shadow:0 5px 16px rgba(31,68,109,.06)}.auto-list-tools label{display:block;font-size:13px;font-weight:700;margin-bottom:5px;color:#172033}.auto-list-actions{display:flex;gap:7px;flex-wrap:wrap}.auto-list-count{grid-column:1/-1;color:#637083;font-size:12px}@media(max-width:900px){.auto-list-tools{grid-template-columns:1fr 1fr}.auto-list-search,.auto-list-actions{grid-column:1/-1}}@media(max-width:540px){.auto-list-tools{grid-template-columns:1fr}.auto-list-tools>div{grid-column:1!important}.auto-list-actions .btn{flex:1}}

.app-developer-footer{text-align:center;padding:18px 12px 22px;color:#6b778c;font-size:13px}.app-developer-footer a{color:#087f8c;font-weight:700;text-decoration:none}.app-developer-footer a:hover{text-decoration:underline}
