/* ==========================================================================
   PharmPro — Base Design System
   --------------------------------------------------------------------------
   Har page yeh file load karta hai. Ismein sirf woh cheezen hain jo POORI
   app mein ek jaisi hain:
     • Design tokens (rang, font, spacing)
     • Header, Sidebar, Footer  (har page par bilkul same)
     • Buttons, Forms, Cards, Tables
     • Responsive rules (mobile + tablet + desktop)

   Koi icon font (Font Awesome) nahi — saare icons inline SVG ya text se.
   Font: Inter (professional UI font) + sahi tracking/line-height.
   ========================================================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Bold text ka halfy/black shadow fix ----------
   Browser <strong>/<b> par default font-weight:bold (700) lagata hai. Jab Inter
   ka 700 weight render hote waqt synthetic bolding lagti hai, jis se aksar lafz
   HALFY / black shadow wale dikhte hain (khaali, dhimi, jaise dobara print ho).
   Is liye hum 600 (Semibold) par force karte hain — ye real weight hai, saaf
   dikhta hai, shadow nahi aata. Saath hi text rendering standardise karte hain
   taake har browser mein same look aaye. */
strong, b {
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-shadow: none;
    text-stroke: 0;
}

/* Document/paragraph ke andar strong bhi readable rahe */
.doc-section strong,
.doc-note strong,
li strong { font-weight: 600; }

/* ---------- Design Tokens ---------- */
:root {
    /* Brand */
    --brand:        #1d4ed8;
    --brand-hover:  #1e40af;
    --brand-light:  #eff6ff;
    --brand-border: #bfdbfe;

    /* Neutrals */
    --ink:        #0f172a;
    --ink-soft:   #334155;
    --muted:      #64748b;
    --muted-light:#94a3b8;

    /* Surfaces */
    --surface:    #ffffff;
    --surface-alt:#f8fafc;
    --surface-hi: #f1f5f9;
    --border:     #cbd5e1;
    --border-soft:#dde5ee;

    /* Box outlines — boxes/containers clear nazar aayein */
    --outline:      #b6c2d1;
    --outline-soft: #cfd8e3;

    /* Status */
    --success:    #059669;
    --success-bg: #ecfdf5;
    --warning:    #d97706;
    --warning-bg: #fffbeb;
    --danger:     #dc2626;
    --danger-bg:  #fef2f2;
    --info:       #2563eb;
    --info-bg:    #eff6ff;

    /* Layout */
    --header-h:   78px;
    --sidebar-w:  252px;
    --content-max:1440px;

    /* Shape — professional, sharp corners (2px sirf sabse chhoti controls ke liye) */
    --r-sm:  0px;
    --r:     0px;
    --r-md:  0px;
    --r-lg:  0px;
    --r-pill: 20px;   /* sirf badges / pills round rehte hain */

    /* Depth */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-soft);
    background: var(--surface-alt);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

h1, h2, h3, h4 { color: var(--ink); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }

/* Simple, unobtrusive focus ring for keyboard users only */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--surface-hi); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==========================================================================
   HEADER — har page par same
   ========================================================================== */
.app-header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.app-header__inner {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Sidebar toggle — sirf mobile/tablet par dikhta hai */
.nav-toggle {
    display: none;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
    color: var(--ink-soft);
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.nav-toggle:hover { background: var(--surface-hi); }
.nav-toggle svg { width: 18px; height: 18px; }

/* Header brand — Settings se saved pharmacy logo yahan aata hai.
   Header mein sirf logo (jo apne andar brand name rakhta hai) — koi alag text nahi. */
.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.header-brand__logo {
    max-height: 54px;
    width: auto;
    object-fit: contain;
}

/* Header logo load ho raha hai — abhi tak koi dikhne wala image nahi.
   Jaise hi branding (Cloudinary ya cached) aa jaye, JS is class ko hata deta hai.
   Isse default logo (images/logo.png) galti se flash nahi hota. */
.header-brand__logo.is-loading {
    visibility: hidden;
}
.header-brand__name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-brand a { display: flex; align-items: center; gap: 10px; min-width: 0; }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* Notification bell */
.bell {
    position: relative;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
    color: var(--ink-soft);
    transition: background 0.15s ease;
}
.bell:hover { background: var(--surface-hi); }
.bell svg { width: 18px; height: 18px; }
.bell__badge {
    position: absolute;
    top: -5px; right: -5px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    border: 2px solid var(--surface);
    border-radius: var(--r-pill);
    font-size: 0.62rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.bell-menu {
    position: absolute;
    top: calc(100% + 8px); right: 0;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    overflow: hidden;
    display: none;
}
.bell-menu.open { display: block; }
.bell-menu__head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
}
.bell-menu__body { max-height: 300px; overflow-y: auto; }
.bell-menu__foot {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}
.bell-menu__foot a { color: var(--brand); }

.alert-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.82rem;
}
.alert-row:last-child { border-bottom: none; }
.alert-row__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.alert-row__dot.low { background: var(--warning); }
.alert-row__dot.out { background: var(--danger); }
.alert-row__dot.expiry { background: var(--brand); }
.alert-row__text { min-width: 0; }
.alert-row__name { color: var(--ink); font-weight: 500; display: block; }
.alert-row__meta { color: var(--muted); font-size: 0.75rem; }

.bell-empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 0.82rem; }

/* Logout */
.btn-logout {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink-soft);
    padding: 8px 14px;
    border-radius: var(--r);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-logout:hover { background: var(--danger-bg); border-color: #fecaca; color: var(--danger); }
.btn-logout svg { width: 15px; height: 15px; }

/* ==========================================================================
   SIDEBAR — har page par same links, bas active item badalta hai
   ========================================================================== */
.app-sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    padding: 18px 0;
    overflow-y: auto;
    z-index: 900;
    transition: transform 0.25s ease;
}

.sidebar-label {
    padding: 14px 22px 6px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-light);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}
.sidebar-link svg {
    width: 17px; height: 17px;
    flex-shrink: 0;
    stroke-width: 1.9;
}
.sidebar-link:hover { background: var(--surface-hi); color: var(--brand); text-decoration: none; }
.sidebar-link.is-active {
    background: var(--brand-light);
    color: var(--brand);
    border-left-color: var(--brand);
    font-weight: 600;
}

/* Backdrop jo mobile par sidebar ke peeche aata hai */
.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 890;
    display: none;
}
.sidebar-backdrop.open { display: block; }

/* ==========================================================================
   CONTENT AREA
   ========================================================================== */
.app-main {
    margin-left: var(--sidebar-w);
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
    display: flex;
    flex-direction: column;
}
.app-main--full { margin-left: 0; }   /* sidebar ke bina pages (support/terms/privacy) */


.app-content {
    flex: 1;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 28px 24px;
}

/* Page title block */
.page-head { margin-bottom: 24px; }
.page-head h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex; align-items: center; gap: 10px;
}
.page-head h1 svg { width: 20px; height: 20px; stroke-width: 1.9; color: var(--brand); }
.page-head p { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

/* ==========================================================================
   FOOTER — har page par bilkul same (professional white strip)
   --------------------------------------------------------------------------
   Footer body ka direct child hai, is liye sidebar ke NEECHE chala jaata tha.
   margin-left se ise content area (sidebar ke right) mein shift karte hain,
   taake sidebar ke saath-saath ek hi row mein rahe, neeche na gire.
   ========================================================================== */
.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -1px 3px rgba(15, 23, 42, 0.04);
    color: var(--ink-soft);
    padding: 46px 32px 42px;
    margin-top: 48px;
    margin-left: var(--sidebar-w);
}
.app-footer--full { margin-left: 0; }   /* sidebar ke bina pages (support/terms/privacy) */
.app-footer__inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.footer-brand__logo {
    height: 72px;
    max-width: 260px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.footer-brand__text { min-width: 0; }
.footer-brand__name {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.footer-brand__tag { font-size: 0.86rem; color: var(--muted); margin-top: 3px; }

.footer-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.footer-links a {
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    transition: background 0.15s ease, color 0.15s ease;
}
.footer-links a:hover { background: var(--surface-hi); color: var(--brand); text-decoration: none; }
.footer-sep { color: var(--border); }

.footer-legal { font-size: 0.82rem; color: var(--muted); text-align: right; line-height: 1.7; }
.footer-legal strong { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   FLOATING WHATSAPP BUTTON
   --------------------------------------------------------------------------
   Screen ke bottom-right corner par FIXED rehta hai — page scroll karne par
   bhi apni hi jagah rahega. Click karne par "Need help?" bubble khulta hai.
   ========================================================================== */
.wa-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;   /* sirf button par click chale */
}

.wa-fab {
    pointer-events: auto;
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #25d366;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.42);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.wa-fab:hover { transform: scale(1.07); background: #1eb855; box-shadow: 0 8px 26px rgba(37, 211, 102, 0.55); }
.wa-fab:active { transform: scale(0.96); }

.wa-fab__icon { display: inline-flex; align-items: center; justify-content: center; }
.wa-fab__icon svg { width: 31px; height: 31px; }

/* Chhota sa pulse ring — naya message ka ehsaas */
.wa-fab__ping {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #25d366;
    opacity: 0;
    pointer-events: none;
}
.wa-widget.is-open .wa-fab__ping { animation: none; opacity: 0; }
.wa-fab::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #25d366;
    animation: waPing 2.4s ease-out infinite;
}
.wa-widget.is-open .wa-fab::after { animation: none; opacity: 0; }

@keyframes waPing {
    0%   { transform: scale(1);    opacity: 0.75; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}

/* ---- Bubble (click par khulta hai) ---- */
.wa-bubble {
    pointer-events: auto;
    position: relative;
    width: 300px;
    max-width: calc(100vw - 40px);
    background: var(--surface);
    border: 1px solid var(--outline);
    border-top: 3px solid #25d366;
    padding: 16px 16px 14px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.97);
    transform-origin: bottom right;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.wa-bubble.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* Bubble ka teesra (notification) nishan */
.wa-bubble::after {
    content: "";
    position: absolute;
    bottom: -9px;
    right: 22px;
    width: 16px;
    height: 16px;
    background: var(--surface);
    border-right: 1px solid var(--outline);
    border-bottom: 1px solid var(--outline);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.wa-bubble.is-open::after { opacity: 1; }

.wa-bubble__head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }

.wa-bubble__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #e7f9ef;
    color: #128c3f;
}
.wa-bubble__avatar svg { width: 24px; height: 24px; }

.wa-bubble__title { font-size: 0.96rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.wa-bubble__sub { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }

.wa-bubble__body {
    font-size: 0.84rem;
    color: var(--ink-soft);
    line-height: 1.55;
    margin-bottom: 12px;
}

.wa-bubble__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 11px 14px;
    background: #25d366;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--r-sm);
    transition: background 0.15s ease;
}
.wa-bubble__cta svg { width: 18px; height: 18px; }
.wa-bubble__cta:hover { background: #1eb855; text-decoration: none; }

.wa-bubble__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: background 0.15s ease, color 0.15s ease;
}
.wa-bubble__close:hover { background: var(--surface-hi); color: var(--ink); }

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.card__head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.card__head h2 {
    font-size: 1rem;
    font-weight: 600;
    display: flex; align-items: center; gap: 9px;
}
.card__head h2 svg { width: 17px; height: 17px; stroke-width: 1.9; color: var(--brand); }
.card__head p { font-size: 0.85rem; color: var(--muted); margin-top: 3px; }
.card__body { padding: 22px; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--r);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn svg { width: 15px; height: 15px; stroke-width: 2; flex-shrink: 0; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-hover); }

.btn--secondary { background: var(--surface); color: var(--ink-soft); border-color: var(--outline); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-hi); }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover:not(:disabled) { background: #047857; }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #b91c1c; }

.btn--danger-soft { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.btn--danger-soft:hover:not(:disabled) { background: #fee2e2; }

.btn--warning-soft { background: var(--warning-bg); color: var(--warning); border-color: #fde68a; }
.btn--warning-soft:hover:not(:disabled) { background: #fef3c7; }

.btn--sm { padding: 6px 12px; font-size: 0.8rem; }
.btn--block { width: 100%; }

/* ==========================================================================
   FORMS
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft);
}
.field__hint { font-size: 0.76rem; color: var(--muted); }

.input, .select, .textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--r);
    font-size: 0.9rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-light); }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}
.input:disabled, .select:disabled, .textarea:disabled {
    background: var(--surface-hi);
    color: var(--muted);
    cursor: not-allowed;
}
.textarea { resize: vertical; min-height: 90px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 16px;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* Toggle switch */
.switch-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; cursor: pointer;
}
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track {
    position: absolute; inset: 0;
    background: #cbd5e1;
    border-radius: var(--r-pill);
    transition: background 0.2s ease;
}
.switch__track::before {
    content: "";
    position: absolute;
    width: 17px; height: 17px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::before { transform: translateX(17px); }

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table thead th {
    text-align: left;
    padding: 11px 16px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--outline-soft);
    color: var(--ink-soft);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table__num { text-align: right; font-variant-numeric: tabular-nums; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger  { background: var(--danger-bg);  color: var(--danger); }
.badge--info    { background: var(--info-bg);    color: var(--info); }
.badge--neutral { background: var(--surface-hi); color: var(--muted); }

/* Search box */
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box svg {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    width: 15px; height: 15px;
    color: var(--muted);
    pointer-events: none;
}
.search-box .input { padding-left: 36px; }

/* Toolbar (search + actions) */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Empty state */
.empty-state {
    padding: 44px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}
.empty-state svg { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--muted-light); stroke-width: 1.5; }

/* Small screen helper */
.hide-sm { display: inline; }

/* ==========================================================================
   BOOT VEIL — data load hone tak ka halka covering
   --------------------------------------------------------------------------
   Pehle pages blank/white dikhate the. Ab ek halka veil + skeleton dikhta hai
   jise shell preboot() foran hata deta hai. Isse page "load ho raha hai"
   mehsoos hota hai, blank nahi.
   ========================================================================== */
#ppBoot {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: var(--surface-alt);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

#ppBoot .pp-boot__logo {
    max-height: 72px;
    max-width: 210px;
    width: auto;
    object-fit: contain;
    opacity: 0.95;
}

#ppBoot .pp-boot__bar {
    width: 180px;
    height: 3px;
    background: var(--surface-hi);
    overflow: hidden;
    position: relative;
}

#ppBoot .pp-boot__bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 40%;
    background: var(--brand);
    animation: ppBootSlide 1.1s ease-in-out infinite;
}

@keyframes ppBootSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

#ppBoot .pp-boot__text {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    :root { --sidebar-w: 260px; }

    .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .app-sidebar.open { transform: translateX(0); }

    .nav-toggle { display: inline-flex; }
    .app-main { margin-left: 0; }
    .app-content { padding: 22px 18px; }
    .app-footer { margin-left: 0; }
}

@media (max-width: 768px) {
    :root { --header-h: 68px; }
    .app-header__inner { padding: 0 16px; gap: 10px; }
    .app-content { padding: 18px 14px; }
    .hide-sm { display: none; }

    .header-brand__logo { max-height: 44px; }
    .btn-logout span { display: none; }
    .btn-logout { padding: 8px 10px; }

    .app-footer { padding: 20px 14px 18px; margin-top: 20px; }
    .app-footer__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
    .footer-brand { gap: 10px; width: 100%; }
    .footer-brand__logo { height: 38px; max-width: 118px; }
    .footer-brand__name { font-size: 0.88rem; white-space: normal; }
    .footer-brand__tag { display: none; }
    .footer-links { gap: 2px; }
    .footer-links a { font-size: 0.8rem; padding: 5px 8px; }
    .footer-legal { text-align: left; font-size: 0.72rem; line-height: 1.6; }

    /* Floating WhatsApp button mobile par chhota, screen ke andar fit */
    .wa-widget { right: 14px; bottom: 14px; gap: 10px; }
    .wa-fab { width: 52px; height: 52px; }
    .wa-fab__icon svg { width: 27px; height: 27px; }
    .wa-bubble { width: calc(100vw - 28px); padding: 14px 14px 12px; }
    .wa-bubble__body { font-size: 0.8rem; }
    .wa-bubble__cta { padding: 10px 12px; font-size: 0.85rem; }

    .page-head h1 { font-size: 1.2rem; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
    .bell-menu { width: calc(100vw - 32px); right: -52px; }
    .card__body { padding: 18px 16px; }

    .app-footer { padding: 16px 12px 14px; margin-top: 16px; }
    .app-footer__inner { gap: 12px; }
    .footer-brand__logo { height: 32px; max-width: 100px; }
    .footer-brand__name { font-size: 0.82rem; }
    .footer-links a { font-size: 0.76rem; padding: 4px 6px; }
    .footer-legal { font-size: 0.68rem; }

    .wa-widget { right: 12px; bottom: 12px; }
    .wa-fab { width: 48px; height: 48px; }
    .wa-fab__icon svg { width: 25px; height: 25px; }
    .wa-bubble { width: calc(100vw - 24px); }
    .wa-bubble__title { font-size: 0.9rem; }
    .wa-bubble__sub { font-size: 0.7rem; }
}
