body {
    background: #f5f7fb;
    color: #1f2937
}

.app-shell {
    display: flex;
    min-height: 100vh
}

.sidebar {
    width: 260px;
    background: #111827;
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    padding: 20px
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 26px
}

.brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px
}

.sidebar nav a {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 5px
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #2563eb;
    color: #fff
}

.main {
    margin-left: 260px;
    width: calc(100% - 260px)
}

.topbar {
    height: 72px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 28px
}

.content {
    padding: 28px
}

.card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, .06)
}

.btn {
    border-radius: 10px;
}

.form-control,
.form-select {
    border-radius: 10px
}

.table>:not(caption)>*>* {
    padding: 14px
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f1
}

.login-card {
    width: 380px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .10);
    padding: 34px
}

.invoice-box {
    background: #fff;
    border-radius: 18px;
    padding: 32px
}

.invoice-actions {
    display: flex;
    gap: 8px
}

.case-field {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px
}

.case-field strong {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px
}

.item-total-bar {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px
}

@media(max-width:900px) {
    .sidebar {
        position: static;
        width: 100%
    }
    .app-shell {
        display: block
    }
    .main {
        margin-left: 0;
        width: 100%
    }
}

@media print {
    @page {
        size: A4;
        margin: 12mm
    }
    body {
        background: #fff!important
    }
    .sidebar,
    .topbar,
    .invoice-actions,
    .no-print {
        display: none!important
    }
    .main {
        margin-left: 0!important;
        width: 100%!important
    }
    .content {
        padding: 0!important
    }
    .invoice-box {
        box-shadow: none!important;
        border-radius: 0!important;
        padding: 0!important
    }
    .card {
        box-shadow: none!important
    }
    a[href]:after {
        content: ""!important
    }
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px
}

.quick-action {
    display: block;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    transition: .2s;
    color: #111827
}

.quick-action strong {
    display: block;
    font-size: 17px;
    margin-bottom: 6px
}

.quick-action span {
    display: block;
    color: #64748b;
    font-size: 14px;
    line-height: 1.4
}

.quick-action:hover {
    background: #2563eb;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, .20)
}

.quick-action:hover span {
    color: #dbeafe
}

.stat-card small {
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 12px
}

@media(max-width:1100px) {
    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:640px) {
    .quick-grid {
        grid-template-columns: 1fr
    }
}

.prescription-form label {
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    margin-bottom: 5px
}

.medicine-suggestions {
    display: none;
    position: absolute;
    z-index: 50;
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
    width: 100%;
    max-height: 220px;
    overflow: auto;
    margin-top: 4px
}

.medicine-suggestion-item {
    display: block;
    width: 100%;
    background: #fff;
    border: 0;
    text-align: left;
    padding: 10px 12px;
    font-size: 14px
}

.medicine-suggestion-item:hover {
    background: #eff6ff
}

.rx-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff
}

.rx-notes {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    margin-top: 18px
}

.prescription-box table th {
    background: #f8fafc
}


/* ==========================================================
   MOBILE/TABLET ONLY HAMBURGER MENU
   Desktop CSS/layout is untouched.
   ========================================================== */

.mws-mobile-menu-btn,
.mws-mobile-overlay {
    display: none;
}

@media (max-width: 991px) {
    body {
        overflow-x: hidden;
    }
    .mws-mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        background: #ffffff;
        color: #0f172a;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
        margin-right: 12px;
        flex: 0 0 42px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
    }
    .mws-mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 998;
    }
    body.mws-menu-open .mws-mobile-overlay {
        display: block;
    }
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 260px !important;
        max-width: 82vw !important;
        z-index: 999 !important;
        transform: translateX(-110%);
        transition: transform .25s ease;
        overflow-y: auto;
    }
    body.mws-menu-open .sidebar {
        transform: translateX(0);
    }
    .main,
    .content,
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    header,
    .topbar {
        margin-left: 0 !important;
        width: 100% !important;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .card,
    .table-responsive {
        max-width: 100%;
    }
    table {
        max-width: 100%;
    }
    .card:has(table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .btn {
        margin: 0.34rem 0;
    }
}

@media (min-width: 992px) {
    .mws-mobile-menu-btn,
    .mws-mobile-overlay {
        display: none !important;
    }
}

.report-card{background:linear-gradient(135deg,#ffffff,#f8fbff);border:1px solid #e9eef8;border-radius:20px;padding:22px;box-shadow:0 12px 35px rgba(15,23,42,.06)}
.report-card .label{color:#64748b;font-size:12px;text-transform:uppercase;letter-spacing:.06em}.report-card .value{font-size:30px;font-weight:800;margin-top:4px}.badge-soft{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}.tooth-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:10px}.tooth-box{border:1px solid #dbe3ef;background:#fff;border-radius:14px;padding:12px;text-align:center}.tooth-box small{display:block;color:#64748b}.mws-mobile-menu-btn{display:none;position:fixed;top:12px;left:12px;z-index:1100;border:0;background:#111827;color:#fff;border-radius:10px;padding:8px 12px}.mws-mobile-overlay{display:none}
@media(max-width:900px){.mws-mobile-menu-btn{display:block}.sidebar{position:fixed;left:-280px;top:0;bottom:0;width:260px;transition:.2s;z-index:1050}.mws-menu-open .sidebar{left:0}.mws-mobile-overlay{display:none;position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:1040}.mws-menu-open .mws-mobile-overlay{display:block}.topbar{padding-left:68px}.table{min-width:720px}.card{overflow-x:auto}}


/* Final dental clinic polish */
.hero-card{background:linear-gradient(135deg,#1d4ed8,#06b6d4);color:#fff;border-radius:24px;padding:28px;display:flex;justify-content:space-between;align-items:center;gap:20px;box-shadow:0 20px 50px rgba(29,78,216,.22)}
.hero-card .eyebrow{display:inline-block;font-size:12px;text-transform:uppercase;letter-spacing:.08em;opacity:.85;margin-bottom:6px}.hero-card p{opacity:.92}.stat-card{min-height:122px}.stat-card h2{font-size:24px;font-weight:800;margin:8px 0 0}.tooth-pill{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:34px;border-radius:999px;background:#eef6ff;color:#1d4ed8;border:1px solid #bfdbfe}.tooth-number-large{display:inline-flex;width:58px;height:58px;align-items:center;justify-content:center;border-radius:18px;background:#1d4ed8;color:#fff;font-size:26px;font-weight:800}.table thead th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#64748b;background:#f8fafc}.table tbody tr:hover{background:#fbfdff}.badge-soft{font-weight:600;text-transform:capitalize}.empty-state{padding:42px;text-align:center;color:#64748b}.content h4,.content h5{font-weight:800}.btn-outline-secondary,.btn-outline-primary,.btn-outline-danger{background:#fff}.case-field{height:100%}.quick-action{min-height:118px}.report-card .value{word-break:break-word}
@media(max-width:768px){.hero-card{display:block}.hero-card .btn{margin-top:18px}.stat-card h2{font-size:20px}.content{padding:20px}.topbar{height:auto;min-height:72px}}


/* v2.0.2 definitive mobile header fix: keep hamburger away from logo/brand */
@media (max-width: 991px) {
    .mws-mobile-menu-btn {
        display: inline-flex !important;
        position: fixed !important;
        top: 14px !important;
        left: auto !important;
        right: 14px !important;
        z-index: 1200 !important;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        margin: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 12px !important;
        background: #111827 !important;
        color: #ffffff !important;
        border: 0 !important;
        box-shadow: 0 10px 24px rgba(15,23,42,.22) !important;
    }
    .topbar {
        padding-left: 18px !important;
        padding-right: 74px !important;
        min-height: 72px !important;
    }
    .topbar h5,
    .topbar small {
        max-width: calc(100vw - 110px);
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .sidebar .brand {
        padding-right: 56px;
    }
}
