/* =====================================================
   PURENEST PRO - CLONE (matches maruthibroiler.co.in)
   ===================================================== */

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-500.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-600.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-700.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-800.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ── Design Tokens ──────────────────────────────────── */
:root {
    --primary:       #3e60d5;
    --primary-dark:  #3453ba;
    --primary-light: rgba(62, 96, 213, 0.1);
    --success:       #10b981;
    --success-light: #d1fae5;
    --danger:        #ff5b5b;
    --danger-light:  #fee2e2;
    --warning:       #f9b922;
    --warning-light: #fff3cd;
    --info:          #39afd1;

    --bg:       #f1f3fa;
    --surface:  #ffffff;
    --border:   #eef2f7;
    --border-2: #dee2e6;

    --text:      #313a46;
    --text-2:    #6c757d;
    --text-muted:#98a6ad;

    --sidebar-bg:    #3F497F;
    --sidebar-text:  #cbd5e1;
    --sidebar-hover: rgba(255,255,255,0.1);
    --sidebar-active:#ffffff;

    --radius-sm: 4px;
    --radius:    6px;
    --radius-lg: 10px;

    --shadow-xs: 0 1px 2px rgba(15,23,42,0.06);
    --shadow-sm: 0 2px 6px 0 rgba(154,161,171,.1);
    --shadow:    0 0 35px 0 rgba(154,161,171,.15);
    --shadow-lg: 0 5px 20px 0 rgba(154,161,171,.2);

    --sidebar-w: 260px;
    --topbar-h: 50px;
    --content-p: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-y: auto;
}

input, select, textarea, button, optgroup, option {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

[data-feather] {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
}

/* ── Layout ─────────────────────────────────────────── */
.app-container { display: flex; min-height: 100vh; width: 100%; max-width: 100vw; overflow-x: hidden; }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 11000;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease, left 0.3s ease;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: var(--content-p);
    padding-top: calc(var(--topbar-h) + var(--content-p));
    padding-bottom: 40px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-w);
    height: var(--topbar-h);
    background: #465ED7;
    z-index: 10000;
    isolation: isolate;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), right 0.3s ease;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

h1 { font-size: clamp(1.1rem, 4vw, 1.25rem); font-weight: 800; color: var(--text); line-height: 1.3; }
h2 { font-size: clamp(1rem, 3.5vw, 1.15rem); font-weight: 700; color: var(--text); }
h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-2); }
h4 { font-size: 0.85rem; font-weight: 700; color: var(--text-2); }
p  { color: var(--text-2); font-size: 0.85rem; }

.text-muted { color: var(--text-muted) !important; }

/* ── Cards ───────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* ── Forms ───────────────────────────────────────────── */
.form-group  { margin-bottom: 0.9rem; }
.form-label  {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control, input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="search"], select, textarea, .form-select {
    width: 100%;
    padding: 0.6rem 1rem;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
    box-shadow: var(--shadow-xs);
}
.form-control:hover, input:hover, select:hover, textarea:hover {
    border-color: #94a3b8;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(62, 96, 213, 0.15);
    transform: translateY(-1px);
}
.form-control::placeholder { color: #94a3b8; }
select.form-control, select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
}
.btn-primary         { background: var(--primary);  color: #fff; border-color: var(--primary); }
.btn-primary:hover   { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 2px 6px 0 rgba(62, 96, 213, 0.4); transform: translateY(-1px); color: #fff; }
.btn-success         { background: var(--success);  color: #fff; border-color: var(--success); }
.btn-success:hover   { background: #0e9a6f; color: #fff; }
.btn-danger          { background: var(--danger);   color: #fff; border-color: var(--danger); }
.btn-danger:hover    { background: #e64444; color: #fff; }
.btn-secondary       { background: #fff; color: var(--text-2); border-color: var(--border-2); }
.btn-secondary:hover { background: #f1f5f9; color: var(--text); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--text-2);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* ── Tables ──────────────────────────────────────────── */
.table-responsive { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }

table, .data-table  { width: 100%; border-collapse: collapse; background: var(--surface); }
thead  { background: #f8fafc; }

th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-2);
    white-space: nowrap;
    background: #f1f5ff;
}
td {
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text);
    border-bottom: 1px solid #f1f5f9;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }

td.actions, .col-actions { white-space: nowrap; }
td.actions a, .col-actions a { margin-right: 4px; }

/* ── Login / Auth ────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 60%, #dbeafe 100%);
    padding: 1rem;
}

:root {
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.3);
}

body.auth-wrapper {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    position: relative;
    overflow: hidden;
}
body.auth-wrapper::before, body.auth-wrapper::after {
    content: ''; position: absolute; width: 500px; height: 500px;
    border-radius: 50%; z-index: -1; filter: blur(80px); opacity: 0.4;
}
body.auth-wrapper::before { background: #6366f1; top: -10%; left: -10%; }
body.auth-wrapper::after  { background: #ec4899; bottom: -10%; right: -10%; }

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    padding: 3.5rem 2.5rem;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-logo {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.login-header { text-align: center; margin-bottom: 2.5rem; }
.login-header h1 {
    font-size: 2.5rem; font-weight: 900; letter-spacing: -0.04em;
    background: var(--brand-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}
.login-header p { color: #64748b; font-weight: 600; font-size: 0.95rem; }

.animated-logo {
    animation: pulse-logo 3s infinite ease-in-out;
    background: var(--brand-gradient);
    width: 90px; height: 90px; border-radius: 26px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem; border: 4px solid #fff;
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.2);
    font-size: 2.6rem; color: #fff; font-weight: 900;
}

.auth-card .form-label { font-weight: 700; color: #475569; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.auth-card .form-control {
    border: 2px solid #f1f5f9; background: #f8fafc; border-radius: 14px;
    padding: 0.8rem 1rem; font-weight: 500;
    transition: all 0.3s;
}
.auth-card .form-control:focus {
    border-color: #6366f1; background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.btn-login {
    background: var(--brand-gradient);
    color: #fff; border: none; padding: 1rem; border-radius: 16px;
    font-weight: 800; font-size: 1rem; letter-spacing: 0.02em;
    cursor: pointer; transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    width: 100%; margin-top: 2rem;
    text-transform: uppercase;
}
.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
    color: #fff;
}

/* ── Sidebar Nav ─────────────────────────────────────── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 8px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.nav-item svg, .nav-item i { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}
.nav-item.active {
    color: #ffffff;
    background: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    margin: 0 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
    height: 70px;
    padding: 0 20px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    letter-spacing: -0.01em;
    flex-shrink: 0;
}
.brand-logo {
    width: 38px; height: 38px; object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    background: #fff; border-radius: 8px; padding: 4px;
}
.nav-section-label {
    padding: 14px 20px 6px;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.nav-dropdown { display: flex; flex-direction: column; }
.nav-dropdown-btn {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 8px 20px; color: var(--sidebar-text);
    text-decoration: none; font-size: 0.875rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    border: none; background: transparent; width: 100%; text-align: left;
}
.nav-dropdown-btn:hover { color: #ffffff; background: rgba(255,255,255,0.08); }
.nav-dropdown-btn svg:last-child {
    margin-left: auto; width: 14px; height: 14px; transition: transform 0.3s ease;
}
.nav-dropdown.open .nav-dropdown-btn svg:last-child { transform: rotate(180deg); }
.nav-dropdown.open .nav-dropdown-btn { color: #fff; background: rgba(255,255,255,0.05); }

.nav-sub-menu {
    display: none; flex-direction: column;
    background: rgba(0,0,0,0.15); padding: 4px 0;
}
.nav-dropdown.open .nav-sub-menu { display: flex; }

.nav-sub-item {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 6px 20px 6px 48px;
    color: rgba(255,255,255,0.6);
    text-decoration: none; font-size: 0.825rem;
    transition: all 0.2s ease;
}
.nav-sub-item:hover { color: #ffffff; }
.nav-sub-item.active { color: #ffffff; font-weight: 600; }
.nav-sub-item i, .nav-sub-item svg { width: 14px !important; height: 14px !important; }

/* ── Animations ──────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }

/* ── Status Badges / Chips ───────────────────────────── */
.badge, [class*="pm-chip"] {
    display: inline-flex; align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-success, .chip-success { background: var(--success-light); color: var(--success); }
.badge-danger, .chip-danger   { background: var(--danger-light); color: var(--danger); }
.badge-warning, .chip-warning { background: var(--warning-light); color: #b07d0c; }
.badge-primary, .chip-primary { background: var(--primary-light); color: var(--primary); }
.badge-admin { background: #fee2e2; color: #b91c1c; }
.badge-manager { background: #d1fae5; color: #047857; }

/* ── Alerts ─────────────────────────────────────────── */
.alert {
    background: #fff1f2; border: none;
    border-left: 5px solid #ef4444; color: #991b1b;
    padding: 1rem; border-radius: 12px;
    font-weight: 600; margin-bottom: 1.5rem; font-size: 0.9rem;
}
.alert-success { background: var(--success-light); border-left-color: var(--success); color: #065f46; }
.alert-warning { background: var(--warning-light); border-left-color: var(--warning); color: #92400e; }

/* ── Page Header (matches maruthi) ──────────────────── */
.page-header-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.page-header-card h2 {
    margin: 0; color: var(--primary); font-size: 1rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    display: flex; align-items: center; gap: 0.5rem;
}
.page-header-card h2 .icon {
    background: var(--primary-light); color: var(--primary);
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ── KPI Cards (Dashboard) ──────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.kpi-card {
    border-radius: 14px;
    padding: 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    min-height: 130px;
    display: flex; flex-direction: column; justify-content: space-between;
    box-shadow: var(--shadow);
}
.kpi-card .kpi-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.95; }
.kpi-card .kpi-value { font-size: 2rem; font-weight: 800; margin-top: 0.5rem; line-height: 1; }
.kpi-card .kpi-icon {
    position: absolute; right: 1.5rem; top: 1.5rem;
    background: rgba(255,255,255,0.2); padding: 8px; border-radius: 8px;
}
.kpi-card .kpi-circle {
    position: absolute; right: -30px; bottom: -30px;
    width: 140px; height: 140px; border-radius: 50%;
    background: rgba(255,255,255,0.1);
}
.kpi-blue   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.kpi-green  { background: linear-gradient(135deg, #10b981, #047857); }
.kpi-purple { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.kpi-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi-pink   { background: linear-gradient(135deg, #ec4899, #be185d); }
.kpi-teal   { background: linear-gradient(135deg, #14b8a6, #0f766e); }

/* Quick action buttons (dashboard) */
.quick-actions {
    display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.quick-action {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.25rem; border-radius: 12px;
    color: #fff; font-weight: 700; font-size: 0.85rem;
    text-transform: uppercase; letter-spacing: 0.03em;
    text-decoration: none; transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.quick-action:hover { transform: translateY(-2px); color: #fff; }
.quick-action .qa-icon { display: inline-flex; align-items: center; justify-content: center; }
.qa-buy       { background: linear-gradient(135deg, #f97316, #ea580c); }
.qa-wholesale { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.qa-pos       { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Responsive ──────────────────────────────────────── */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 10500;
    display: none; backdrop-filter: blur(2px);
}
.btn-toggle {
    background: transparent; border: none; color: #fff;
    cursor: pointer; padding: 8px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px; transition: background 0.2s;
}
.btn-toggle:hover { background: rgba(255,255,255,0.1); }

@media (max-width: 1100px) {
    :root { --sidebar-w: 0px; --content-p: 16px; }
    .sidebar { transform: translateX(-100%); width: 260px !important; }
    .main-content { margin-left: 0 !important; padding-top: calc(var(--topbar-h) + 16px); }
    .topbar { left: 0 !important; padding: 0 16px; }
    body.sidebar-active { overflow: hidden !important; }
    body.sidebar-active .sidebar { transform: translateX(0); }
    body.sidebar-active .sidebar-overlay { display: block; }
}

/* ── User Profile (topbar) ──────────────────────────── */
.user-profile {
    display: flex; align-items: center; gap: 0.75rem;
    color: #fff; cursor: pointer; padding: 0 0.5rem;
}
.user-profile .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 800; color: #fff;
}
.user-profile .role { font-size: 0.7rem; opacity: 0.85; text-transform: uppercase; font-weight: 600; }

.user-dropdown { position: relative; cursor: pointer; user-select: none; }
.dropdown-menu {
    position: absolute; top: calc(100% + 15px); right: 0;
    width: auto; min-width: 200px; background: #fff;
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: none; flex-direction: column; padding: 8px 0;
    z-index: 1100; border: 1px solid rgba(0,0,0,0.05);
    animation: dropdownFade 0.2s ease-out;
    transform-origin: top right;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-menu.show { display: flex; }
.dropdown-item {
    padding: 12px 20px; color: var(--text);
    text-decoration: none; font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: center; gap: 12px;
    transition: all 0.2s; white-space: nowrap;
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.dropdown-item svg { width: 16px; height: 16px; stroke-width: 2; }
.dropdown-divider { height: 1px; background: var(--border); margin: 8px 0; }
.dropdown-menu::after {
    content: ''; position: absolute; top: -6px; right: 20px;
    width: 12px; height: 12px; background: #fff;
    transform: rotate(45deg);
    border-top: 1px solid rgba(0,0,0,0.05);
    border-left: 1px solid rgba(0,0,0,0.05);
}

/* ── Form pages (procurement / b2b / processing) ────── */
.entry-form {
    background: #fff; border: 1px solid var(--border);
    border-radius: 8px; padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.entry-form h3 {
    font-size: 1rem; font-weight: 700; color: var(--text);
    margin: 0 0 1rem 0; text-transform: uppercase; letter-spacing: 0.05em;
    display: flex; align-items: center; gap: 0.5rem;
}
.entry-form h3 .icon {
    background: var(--primary-light); color: var(--primary);
    width: 28px; height: 28px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
}

.entry-form .form-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.entry-form .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.entry-form .form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.entry-form .form-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.entry-form .form-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 768px) {
    .entry-form .form-grid { grid-template-columns: 1fr 1fr; }
    .entry-form .form-grid.cols-3, .entry-form .form-grid.cols-4,
    .entry-form .form-grid.cols-5, .entry-form .form-grid.cols-6 { grid-template-columns: 1fr; }
}

/* ── Item Row table (procurement / b2b / processing) ── */
.item-rows {
    width: 100%; border-collapse: collapse;
    background: var(--surface); margin-top: 0.5rem;
}
.item-rows thead th {
    background: linear-gradient(135deg, #6366f1, #a855f7) !important;
    color: #fff !important; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; padding: 10px 8px;
    border: none;
}
.item-rows tbody td {
    padding: 6px; vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.item-rows tbody tr { background: #f8fafc; }
.item-rows .form-control, .item-rows select { margin: 0; background: #fff; }
.item-rows .row-num {
    display: inline-block; min-width: 24px; text-align: center;
    font-weight: 700; color: var(--primary);
}
.add-row-btn {
    background: none; border: none; color: var(--primary);
    font-weight: 700; cursor: pointer; padding: 0.5rem;
    display: inline-flex; align-items: center; gap: 0.4rem;
    text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em;
}
.add-row-btn:hover { color: var(--primary-dark); }

.remove-row {
    background: none; border: none; color: #ef4444;
    cursor: pointer; padding: 4px; font-size: 1.1rem;
}
.remove-row:hover { color: #b91c1c; }

/* ── Form Footer (totals / submit) ───────────────────── */
.form-footer {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem;
    padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.form-footer .totals {
    display: flex; gap: 2rem;
}
.form-footer .totals .stat { text-align: left; }
.form-footer .totals .stat-label {
    font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.form-footer .totals .stat-value { font-size: 1.25rem; font-weight: 800; color: var(--text); }

.form-footer .payable { text-align: right; }
.payable .payable-label {
    font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.payable .payable-amount {
    font-size: 2rem; font-weight: 900; color: var(--success);
}

/* ── Inventory tile grid (Inventory page) ────────────── */
.inv-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.5rem;
}
.inv-tile {
    border-radius: 14px; padding: 1.25rem; color: #fff;
    position: relative; overflow: hidden;
    box-shadow: var(--shadow);
}
.inv-tile .inv-label {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
    background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 20px;
}
.inv-tile .inv-name { font-size: 1.1rem; font-weight: 800; margin-top: 0.5rem; }
.inv-tile .inv-birds { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; opacity: 0.9; margin-top: 0.75rem; }
.inv-tile .inv-birds-val { font-size: 1.4rem; font-weight: 800; }
.inv-tile .inv-weight { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; opacity: 0.9; margin-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.3); padding-top: 0.5rem; }
.inv-tile .inv-weight-val { font-size: 1.2rem; font-weight: 700; }

/* ── Display Properties (Device Info) ───────────────── */
.device-grid {
    display: grid; gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-bottom: 1.5rem;
}
.device-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: 10px; padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid;
    display: flex; flex-direction: column;
}
.device-card.dc-blue   { border-top-color: #3b82f6; }
.device-card.dc-green  { border-top-color: #10b981; }
.device-card.dc-orange { border-top-color: #f59e0b; }
.device-card .dc-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.device-card .dc-icon {
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff;
}
.device-card .dc-title { font-weight: 700; color: var(--text); font-size: 1rem; }
.device-card .dc-subtitle { font-size: 0.8rem; color: var(--text-muted); }
.device-card .dc-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; }
.device-card .dc-row:last-child { border-bottom: none; }
.device-card .dc-key { color: var(--text); font-weight: 500; }
.device-card .dc-val { color: var(--primary); font-weight: 700; }
.device-card.dc-orange .dc-val { color: var(--warning); }

/* ── Tabs (voucher / etc) ───────────────────────────── */
.tabs-bar {
    display: flex; gap: 0.5rem; background: #fff;
    border: 1px solid var(--border); border-radius: 10px;
    padding: 0.5rem; margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}
.tab-btn {
    padding: 0.6rem 1.1rem; border: none; background: transparent;
    color: var(--text-muted); font-weight: 700;
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
    cursor: pointer; border-radius: 8px;
    display: inline-flex; align-items: center; gap: 0.4rem;
    transition: all 0.2s;
}
.tab-btn:hover { color: var(--primary); background: var(--primary-light); }
.tab-btn.active {
    background: var(--success-light); color: var(--success);
    box-shadow: 0 2px 6px rgba(16,185,129,0.15);
}
.tab-btn.active.receipt { background: #d1fae5; color: #047857; }
.tab-btn.active.payment { background: #fee2e2; color: #b91c1c; }

/* ── Ledger cards (Chart of Accounts) ───────────────── */
.ledger-grid {
    display: grid; gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-bottom: 1.5rem;
}
.ledger-card {
    border-radius: 14px; padding: 1.5rem; color: #fff;
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
    min-height: 200px; display: flex; flex-direction: column;
    justify-content: space-between;
}
.ledger-card .lc-tag {
    display: inline-block; font-size: 0.7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.05em;
    background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 20px;
}
.ledger-card .lc-name { font-size: 1.3rem; font-weight: 800; margin: 0.5rem 0; }
.ledger-card .lc-amount { font-size: 1.6rem; font-weight: 900; }
.ledger-card .lc-action {
    background: rgba(255,255,255,0.25); color: #fff; padding: 0.6rem 1rem;
    border-radius: 8px; text-align: center; text-transform: uppercase;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
    text-decoration: none; transition: all 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.ledger-card .lc-action:hover { background: rgba(255,255,255,0.4); color: #fff; }
.lc-asset  { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.lc-cash   { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.lc-rcv    { background: linear-gradient(135deg, #10b981, #047857); }
.lc-pay    { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.lc-exp    { background: linear-gradient(135deg, #f97316, #c2410c); }

/* ── Report filter bar ──────────────────────────────── */
.filter-bar {
    background: #fff; border: 1px solid var(--border);
    border-radius: 8px; padding: 1rem;
    margin-bottom: 1rem; box-shadow: var(--shadow-sm);
    display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end;
}
.filter-bar .form-group { margin: 0; min-width: 140px; }
.filter-bar .filter-actions { display: flex; gap: 0.5rem; margin-left: auto; }

/* ── Search bar ─────────────────────────────────────── */
.search-bar {
    background: #fff; border: 1px solid var(--border);
    border-radius: 8px; padding: 0.4rem 0.75rem;
    display: flex; align-items: center; gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}
.search-bar input { border: none; outline: none; flex: 1; padding: 0.4rem; background: transparent; box-shadow: none; }
.search-bar input:focus { box-shadow: none; transform: none; }
.search-bar svg { color: var(--text-muted); width: 16px; height: 16px; }

/* ── Branch switcher (top-right) ────────────────────── */
.branch-switcher {
    background: rgba(255,255,255,0.15); color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.4rem 0.75rem; border-radius: 8px;
    font-size: 0.8rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.branch-switcher select {
    background: transparent; color: #fff; border: none;
    font-weight: 600; font-size: 0.8rem; padding: 0; min-width: 140px;
}
.branch-switcher select option { color: var(--text); background: #fff; }
.branch-switcher svg { width: 16px; height: 16px; }

/* ── Two-column layout (transfer / vouchers etc) ────── */
.two-col {
    display: grid; gap: 1.25rem;
    grid-template-columns: 1fr 1fr;
}
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

/* ── Reports (table actions) ────────────────────────── */
.report-table th { background: #f1f5ff; }
.report-table tfoot td {
    font-weight: 800; background: #f8fafc;
    border-top: 2px solid var(--border-2);
}
.report-actions { display: flex; gap: 0.4rem; }
.act-btn {
    width: 28px; height: 28px; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-light); color: var(--primary);
    border: 1px solid transparent; cursor: pointer;
    transition: all 0.2s;
}
.act-btn:hover { background: var(--primary); color: #fff; }
.act-btn.print { background: var(--success-light); color: var(--success); }
.act-btn.print:hover { background: var(--success); color: #fff; }

/* ── Modal (override Bootstrap defaults) ────────────── */
.modal-content {
    border-radius: 12px; border: none;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    background: var(--primary); color: #fff;
    border-top-left-radius: 12px; border-top-right-radius: 12px;
    padding: 1rem 1.5rem;
}
.modal-header .btn-close { filter: invert(1) brightness(2); }
.modal-title { font-weight: 700; color: #fff; }

/* ── POS terminal (retail) ──────────────────────────── */
.pos-container { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; }
@media (max-width: 1100px) { .pos-container { grid-template-columns: 1fr; } }
.pos-menu { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.pos-categories { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.pos-cat {
    padding: 0.5rem 1rem; border: 1px solid var(--border);
    background: #fff; border-radius: 8px;
    cursor: pointer; font-weight: 600; font-size: 0.8rem;
    color: var(--text-muted);
}
.pos-cat.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pos-tiles {
    display: grid; gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.pos-tile {
    background: #fff; border: 2px solid var(--border);
    border-radius: 8px; padding: 1rem; text-align: center;
    cursor: pointer; transition: all 0.2s;
    position: relative;
}
.pos-tile:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.pos-tile .pos-tile-name { font-weight: 700; color: var(--text); font-size: 0.9rem; margin: 0.5rem 0; }
.pos-tile .pos-tile-price { color: var(--success); font-weight: 700; }
.pos-tile .pos-tile-stock {
    position: absolute; top: 6px; right: 6px;
    background: #fee2e2; color: #b91c1c;
    padding: 2px 8px; border-radius: 12px;
    font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.pos-tile .pos-tile-unit { color: var(--text-muted); font-size: 0.7rem; font-weight: 600; }

.pos-cart {
    background: #fff; border: 1px solid var(--border);
    border-radius: 8px; padding: 1rem;
    display: flex; flex-direction: column;
}
.pos-cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.pos-cart-header h3 { margin: 0; font-size: 1rem; }
.pos-cart-empty { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.pos-cart-items { flex: 1; overflow-y: auto; max-height: 320px; margin-bottom: 1rem; }
.pos-cart-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; }
.pos-cart-item-name { flex: 1; font-size: 0.85rem; font-weight: 600; }
.pos-cart-item-price { color: var(--success); font-weight: 700; font-size: 0.85rem; }
.pos-cart-item-remove { color: #ef4444; background: none; border: none; cursor: pointer; }

.pos-pay-options { display: flex; gap: 0.5rem; margin: 1rem 0; }
.pos-pay {
    flex: 1; padding: 0.75rem; border: 2px solid var(--border);
    background: #fff; border-radius: 8px;
    text-align: center; cursor: pointer;
    font-weight: 700; font-size: 0.8rem;
    text-transform: uppercase; color: var(--text-muted);
}
.pos-pay.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.pos-cart-totals { padding: 1rem; background: #f8fafc; border-radius: 8px; margin-bottom: 1rem; }
.pos-cart-totals .row { display: flex; justify-content: space-between; padding: 0.25rem 0; font-size: 0.85rem; }
.pos-cart-totals .row.total { font-size: 1.1rem; font-weight: 900; color: var(--success); border-top: 1px solid var(--border); margin-top: 0.5rem; padding-top: 0.5rem; }
