/* =====================================================
   GLOBAL STYLES
   ===================================================== */

   body {
    font-family: 'Plus Jakarta Sans', 'DM Sans', 'Segoe UI', sans-serif;
     background: #0D0818;
     margin: 0;
     color: #FFFFFF;
     line-height: 1.45;
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
 }
 
 a {
     color: #8B5CF6;
     text-decoration: none;
 }
 
 a:hover {
     text-decoration: underline; 
 }
html, body {
    height: 100%;
    margin: 0;
    /* Clip only at document edge — never pair overflow-x:hidden with overflow-y:auto
       on the same scroll container (breaks Android/Samsung Internet touch scroll). */
    overflow-x: clip;
}
@supports not (overflow-x: clip) {
    html, body {
        overflow-x: hidden;
    }
}



 
 /* =====================================================
    LAYOUT
    ===================================================== */
 
   .layout {
    display: flex;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    align-items: stretch;
}

 
   .content {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible; /* horizontal scroll lives on .table-wrapper / .responsive-table */
    min-height: 0;   /* ← IMPORTANT for flex scrolling */
    min-width: 0;    /* ← allow flex child to shrink so inner overflow-x:auto can scroll */
    padding: 18px 22px 28px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y pinch-zoom;
}

    
 
 
 /* =====================================================
    SIDEBAR
    ===================================================== */
 
    .sidebar::-webkit-scrollbar {
        width: 6px;
    }
    
    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.3);
        border-radius: 4px;
    }
    
 
 .sidebar h2 {
     margin-top: 0;
     font-size: 18px;
     color: #d0e2ff;
 }
 
 .sidebar ul {
     list-style: none;
     padding: 0;
 }
 
 .sidebar li {
     margin: 10px 0;
 }

 .sidebar li.nav-group-label {
     margin: 18px 0 6px;
     padding: 0 4px;
     list-style: none;
     font-size: 11px;
     font-weight: 700;
     letter-spacing: 0.06em;
     text-transform: uppercase;
     color: rgba(208, 226, 255, 0.55);
     pointer-events: none;
 }
 
 .sidebar a {
     color: #ecf0f1;
 }
 
 
 /* =====================================================
    TOP BAR
    ===================================================== */
 
 .topbar {
     background: #1A112B;
     border-bottom: 1px solid #e0e6ed;
     padding: 12px 20px;
     display: flex;
     justify-content: space-between;
     align-items: center;
 }
 
 
 /* =====================================================
    CARDS & TABLES
    ===================================================== */
 
 .card {
     background: #1A112B;
     border: 1px solid #e0e6ed;
     border-radius: 4px;
     padding: 16px;
     margin-bottom: 20px;
 }
 
 .table {
     width: 100%;
     border-collapse: collapse;
 }
 
 .table th,
 .table td {
     padding: 10px;
     border-bottom: 1px solid #e0e6ed;
     text-align: left;
 }
 
 
 /* =====================================================
    BUTTONS
    ===================================================== */
 
 .btn {
     display: inline-block;
     padding: 8px 12px;
     border: none;
     background: #7C3AED;
     color: #ffffff;
     border-radius: 3px;
     cursor: pointer;
 }
 
 .btn.secondary {
     background: #6c757d;
 }
 
 .btn.danger {
     background: #d9534f;
 }
 
 
 /* =====================================================
    FORMS
    ===================================================== */
 
 .form-group {
     margin-bottom: 12px;
 }
 
 .form-group label {
     display: block;
     margin-bottom: 6px;
     font-weight: bold;
 }
 
 .form-group input,
 .form-group select {
     width: 100%;
     padding: 8px;
     border: 1px solid #cbd3dc;
     border-radius: 3px;
 }
 
 
 /* =====================================================
    MESSAGES
    ===================================================== */
 
 .message {
     margin-bottom: 10px;
     color: #d9534f;
 }
 
 
 /* =====================================================
    LOGIN PAGE (KAVILUDI ENTERPRISE BRANDING)
    ===================================================== */
 
 /* Apply ONLY to login page */
 /* =========================
    LOGIN PAGE – REFINED
    ========================= */
 
 /* ===========================
    LOGIN PAGE
    =========================== */
 
 /* Background for login page only */
 body.login-page {
     background-image: none;
     background: radial-gradient(900px 500px at 15% 10%, rgba(124,58,237,0.45), transparent 55%), linear-gradient(160deg,#2E1065,#0D0818);
 }
 

 
 /* Wrapper: centers premium login card */
 .login-wrapper {
     display: flex;
     align-items: center;
     justify-content: center;
     min-height: 100vh;
     padding: 24px 16px;
 }
 
 /* Login card — glass look */
 .login-card {
     width: 320px;
     padding: 30px;
 
     /* 🔥 NO FIXED HEIGHT — allows expansion safely */
    
     height: auto;
 
     background: rgba(255, 255, 255, 0.65);
     backdrop-filter: blur(12px);
     -webkit-backdrop-filter: blur(12px);
 
     border-radius: 18px;
     border: 1px solid rgba(255, 255, 255, 0.25);
 
     box-shadow: 0 18px 35px rgba(0, 0, 0, 0.18);
 
     display: flex;
     flex-direction: column;
     justify-content: flex-start;
     box-sizing: border-box;
 }
 
 /* Title */
 .login-card h2,
 .login-card h3 {
     text-align: center;
     margin-top: 0;
     margin-bottom: 10px;
     font-weight: 600;
     color: #143d26;
 }
 
 /* Inputs */
 .login-card input {
     background: rgba(255, 255, 255, 0.9);
     border: 2px solid #cfe3d4;
     border-radius: 10px;
     font-size: 16px;
     padding: 10px;
     width: 100%;
     margin-bottom: 10px;
 }
 
 .login-card input:focus {
     outline: none;
     border-color: #7C3AED;
     box-shadow: 0 0 0 2px rgba(46, 139, 87, 0.2);
 }
 
 /* Button */
 .login-card button {
     width: 100%;
     margin-top: 8px;
     padding: 12px;
 
     background: linear-gradient(135deg, #7C3AED, #8B5CF6);
     border: none;
     border-radius: 10px;
 
     color: #ffffff;
     font-size: 16px;
     font-weight: 600;
 
     cursor: pointer;
     transition: all 0.2s ease;
 }
 
 .login-card button:hover {
     transform: translateY(-1px);
     box-shadow: 0 6px 16px rgba(46, 139, 87, 0.35);
 }
 
 /* Error message (INSIDE the login card) */
 body.login-page .message {
     background: rgba(255, 240, 240, 0.95);
     color: #8b0000;
     padding: 10px 12px;
     border-radius: 10px;
     margin-bottom: 15px;
     text-align: center;
     font-size: 13px;
 
     word-wrap: break-word;
     overflow-wrap: break-word;
 }
 
 /* Optional — small hint text */
 .login-card small {
     color: #4b5563;
     text-align: center;
 }
 
 .password-wrapper{
     position: relative;
 }
 
 .password-wrapper input{
     padding-right: 45px;
 }
 
 .toggle-password{
     position: absolute;
     top: 50%;
     right: 2px;
     transform: translateY(-50%);
     cursor: pointer;
 }


 @media (max-width: 768px) {

    body.login-page {
        background-image: url('../indexbg1.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    body.login-page .login-wrapper {
        justify-content: center;
        padding-right: 0;
        padding-left: 0;
        align-items: flex-start;
    }

    body.login-page .login-card {
        width: 90%;
        max-width: 360px;
        margin-top: 210px;
    }
}

  
  
 
 
 /* =====================================================
    RESPONSIVE
    ===================================================== */
 
    @media (max-width: 768px) {

        .layout {
          height: calc(100vh - 56px);
          height: calc(100dvh - 56px);
        }
      
        .sidebar {
          height: 100vh;
          height: 100dvh;
        }
      
        .content {
          height: calc(100vh - 56px);
          height: calc(100dvh - 56px);
          padding: 14px 12px 24px;
        }
      
      }
      
/* =====================================================
    SIDEBAR – KAVILUDI ENTERPRISE STYLE
    ===================================================== */
 
    .sidebar {
        width: 260px;
        background: linear-gradient(180deg, #1A112B, #140D24);
        color: #DDD6FE;
        padding: 16px 12px;
        box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
    
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        flex-shrink: 0;
    }
    
 
 /* Sidebar title / brand */
 .sidebar h2 {
   border-bottom:1px solid #e0e6ed; 
 }
 
 /* Menu list */
 .sidebar ul {
     list-style: none;
     padding: 0;
     margin: 0;
 }
 
 /* Menu items */
 .sidebar li {
     margin-bottom: 6px;
 }
 
 /* Links */
 .sidebar a {
     display: block;
     padding: 10px 14px;
     border-radius: 12px;
     color: #DDD6FE;
     font-size: 15px;
     font-weight: 500;
     transition: all 0.2s ease;
 }
 
 /* Hover effect */
 .sidebar a:hover {
     background: rgba(124, 58, 237, 0.16);
     color: #ffffff;
     text-decoration: none;
 }
 
 /* Active menu item (if you add class="active") */
 .sidebar a.active {
     background: linear-gradient(135deg, #7C3AED, #8B5CF6);
     color: #ffffff;
     box-shadow: 0 6px 14px rgba(124, 58, 237, 0.4);
 }
 
 /* Optional section divider */
 .sidebar hr {
     border: none;
     height: 1px;
     background: rgba(255, 255, 255, 0.08);
     margin: 15px 0;
 }
 
 /* ===========================
    DASHBOARD - CLEAN STYLES
    =========================== */
 
 /* Page title spacing */
 .page-title {
     margin-bottom: 18px;
 }
 
 /* Grid layout for stat cards */
 .dashboard-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
     gap: 18px;
     margin-bottom: 25px;
 }
 
 /* Card look */
 .card {
     background: #1A112B;
     border: 1px solid #d8dee7;
     border-radius: 10px;
     padding: 14px 16px;
     box-shadow: 0 6px 14px rgba(0,0,0,0.04);
     transition: transform .12s ease, box-shadow .12s ease;
 }
 
 /* Hover effect */
 .card:hover {
     transform: translateY(-2px);
     box-shadow: 0 12px 26px rgba(0,0,0,0.08);
 }
 
 /* Card number */
 .card h3 {
     margin: 0;
     font-size: 24px;
     font-weight: 700;
     color: #FFFFFF;
 }
 
 /* Card label */
 .card p {
     margin-top: 6px;
     font-size: 14px;
     color: #A78BFA;
 }
 
 /* Colored indicator bars */
 .card.green  { border-top: 5px solid #22c55e; }
 .card.blue   { border-top: 5px solid #2563eb; }
 .card.orange { border-top: 5px solid #f97316; }
 .card.purple { border-top: 5px solid #8b5cf6; }
 .card.yellow { border-top: 5px solid #eab308; }
 .card.teal  { border-top: 5px solid #14b8a6; }  /* emerald/teal */
 .card.red   { border-top: 5px solid #ef4444; }  /* rose/red */
 .card.dark  { border-top: 5px solid #334155; }  /* slate dark */
 .card.cyan  { border-top: 5px solid #06b6d4; }  /* cyan */
 
 
 
 /* ---- TABLE POLISH ---- */
 
 .table thead th {
     background:#211538;
     font-weight:600;
 }
 
 .table tbody tr:hover {
     background:rgba(124,58,237,0.08);
 }
 
 /* ---------- TOPBAR STYLES ---------- */
 
 .topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.topbar-left,
.topbar-right{
    flex-shrink:0;
}

.topbar-center{
    flex:1;
    text-align:center;
}

 
 .fullscreen-btn {
     background:#22c55e;
     border:none;
     padding:7px 12px;
     border-radius:6px;
     color:#ffffff;
     cursor:pointer;
     font-size:13px;
 }
 
 .fullscreen-btn:hover {
     background:#6D28D9;
 }
 
 /* ===========================
    TOP BAR (Header)
    =========================== */
 
 .topbar{
     background:linear-gradient(180deg, #1A112B, #140D24);
     border-bottom:1px solid rgba(255,255,255,0.08);
     padding:12px 20px;
     display:flex;
     justify-content:space-between;
     align-items:center;
     position:sticky;
     top:0;
     z-index:100;
 }
 
 .topbar-left{
     font-size:15px;
     color:white;
 }
 
 .topbar-left strong{
     color:white;
 }
 
 .topbar-right{
     display:flex;
     gap:10px;
 }
 .topbar-center{
    font-size:16px;
    color:white;
    text-align:center;
    flex:1;
}

 
 /* Fullscreen Button */
 .fullscreen-btn{
     background:#7C3AED;
     border:none;
     padding:6px 12px;
     border-radius:12px;
     color:white;
     cursor:pointer;
     font-size:16px;
 }
 
 .fullscreen-btn:hover{
     background:#8B5CF6;
 }
 
 /* ============================
    POS FULL PAGE STYLE
    ============================ */
 
 .pos-wrapper{
     padding:15px;
     width: 100%; 
 }
 
 .pos-title{
     margin-bottom:10px;
 }
 
 /* Design tokens — Kaviludi Enterprise */
 :root{
     --green:#22C55E;
     --green-dark:#16A34A;
     --light:#DDD6FE;
     --brand:#7C3AED;
     --brand-deep:#5B21B6;
     --primary:#7C3AED;
     --violet:#8B5CF6;
     --bright:#A855F7;
     --deep-purple:#5B21B6;
     --dark-purple:#2E1065;
     --bg:#0D0818;
     --bg-secondary:#140D24;
     --surface:#1A112B;
     --surface-elevated:#211538;
     --border:rgba(255,255,255,0.08);
     --border-strong:rgba(255,255,255,0.14);
     --text:#FFFFFF;
     --text-secondary:#DDD6FE;
     --text-muted:#A78BFA;
     --success:#22C55E;
     --warning:#F59E0B;
     --danger:#EF4444;
     --info:#8B5CF6;
     --radius:18px;
     --radius-sm:12px;
     --shadow-sm:0 1px 2px rgba(0,0,0,0.25);
     --shadow-md:0 8px 28px rgba(46,16,101,0.35);
     --focus-ring:0 0 0 3px rgba(124,58,237,0.35);
     --space-1:4px;
     --space-2:8px;
     --space-3:12px;
     --space-4:16px;
     --space-5:20px;
     --space-6:24px;
     --grad-primary:linear-gradient(135deg,#7C3AED,#8B5CF6);
     --grad-deep:linear-gradient(180deg,#2E1065,#0D0818);
 }
 
 /* grid layout */
 .pos-grid{
     display:grid;
     grid-template-columns: 1.35fr 0.9fr;
     gap:20px;
 }
 
 .pos-items,.pos-summary{
     background:#1A112B;
     border-radius:18px;
     padding:16px;
     box-shadow:0 10px 25px rgba(0,0,0,.25);
 }
 
 .pos-item-card{
     border:1px solid rgba(255,255,255,0.08);
     padding:12px;
     margin-bottom:10px;
     border-radius:14px;
     background:#211538;
 }
 
 .pos-remove{
     text-align:right;
     margin-bottom:6px;
 }
 
 .pos-field label{
     font-size:13px;
     font-weight:600;
     margin-bottom:4px;
     display:block;
 }
 
 .pos-field select,
 .pos-field input,
 .pos-field textarea{
     width:100%;
     padding:9px;
     border-radius:8px;
     border:1px solid #cfd6dd;
 }
 
 .pos-summary h2{
     margin-top:0;
     font-size:22px;
     color:#A855F7;
 }
 
 /* Payment Buttons */
 .pay-buttons{
     display:flex;
     gap:10px;
 }
 
 .pay-btn{
     flex:1;
     padding:10px;
     border-radius:12px;
     border:2px solid #8B5CF6;
     background:#140D24;
     color:#DDD6FE;
     cursor:pointer;
     font-weight:600;
 }
 
 .pay-btn.active{
     background:linear-gradient(135deg,#7C3AED,#8B5CF6);
     color:white;
 }
 
 /* Submit button */
 .pos-summary .submit{
     width:100%;
     background:linear-gradient(135deg,#7C3AED,#8B5CF6);
     color:white;
     font-size:16px;
 }
 
 /* IMEI logic controls */
 .imei-field{ display:block; }
 .qty-field{ display:block; }
 .dropdown-list{
     position:absolute;
     background:#1A112B;
     border:1px solid #ccc;
     width:100%;
     max-height:180px;
     overflow-y:auto;
     z-index:9999;
 }
 
 .dropdown-list div{
     padding:8px;
     cursor:pointer;
 }
 
 .dropdown-list div:hover{
     background:#f2f2f2;
 }
 .manager-select{
     width:100%;
     position:relative;
 }
 
 #managerSearch{
     width:100%;
     padding:8px;
     margin-bottom:5px;
     border-radius:6px;
     border:1px solid #ccc;
 }
 
 #managerSelect{
     width:100%;
     padding:6px;
     border-radius:6px;
 }
 
 
 /* ==================================
    MOBILE
    ================================== */
 @media(max-width:900px){
     .pos-grid{
         grid-template-columns:1fr;
     }
 }
 /* ===== POS FULL WIDTH FIX ===== */
 body.pos-page .content{
     max-width:none;
     width:100%;
     padding:15px 25px;
 }
 
 #loader-overlay{
     position:fixed;
     inset:0;
     background:rgba(0,0,0,.45);
     display:none;
     align-items:center;
     justify-content:center;
     z-index:9999;
 }
 
 .loader-box{
     background:#1A112B;
     padding:18px 28px;
     border-radius:10px;
     font-weight:600;
     display:flex;
     gap:10px;
     align-items:center;
 }
 
 .spinner{
     width:18px;
     height:18px;
     border:3px solid #7C3AED;
     border-top-color:transparent;
     border-radius:50%;
     animation:spin 1s linear infinite;
 }
 
 @keyframes spin{to{transform:rotate(360deg)}}
 
 .users-card{
     width: 100%;
 }
 .users-header{
     display:flex;
     justify-content:space-between;
     align-items:center;
     margin-bottom:15px;
 }
 
 .user-filters{
     display:flex;
     gap:10px;
     margin-bottom:15px;
     flex-wrap:wrap;
 }
 
 .user-filters input,
 .user-filters select{
     padding:7px 10px;
     border:1px solid #cbd3dc;
     border-radius:6px;
 }
 
 /* Table hover + stripe */
 .users-table tbody tr:nth-child(even){
     background:#f9fbfc;
 }
 .users-table tbody tr:hover{
     background:#eef5ff;
 }
 
 /* Grey small text */
 .muted{
     color:#6c757d;
 }
 
 /* Role badges */
 .role-chip{
     padding:4px 10px;
     border-radius:999px;
     color:#fff;
     font-size:12px;
     font-weight:600;
 }
 .role-chip.admin{
     background:#c0392b;
 }
 .role-chip.manager{
     background:#1f618d;
 }
 .role-chip.agent{
     background:#27ae60;
 }
 
 /* Status tags */
 .status-badge{
     padding:4px 9px;
     border-radius:8px;
     font-size:12px;
     font-weight:600;
 }
 .status-badge.active{
     background:#e8f8ef;
     color:#1e7e34;
 }
 .status-badge.inactive{
     background:#fdecea;
     color:#b52b27;
 }
 .card.user-create-card{
     width: 100%;
 }
 
 .user-create-card h3{
     margin-top:0;
     color:#7C3AED;
 }
 
 .form-block{
     border:1px solid #e3e7ec;
     padding:12px;
     border-radius:10px;
     margin-bottom:12px;
     background:#f9fbfc;
 }
 
 .two-col{
     display:grid;
     grid-template-columns:1fr 1fr;
     gap:12px;
 }
 
 .form-actions{
     display:flex;
     gap:10px;
     margin-top:10px;
 }
 /* ---------- USER EDIT FORM STYLING ---------- */
 
 .user-form {
     width: 100%;
     margin: 0 auto;
 }
 
 .user-form h2 {
     margin-bottom: 10px;
 }
 
 /* 2-column form layout (desktop only) */
 .user-grid {
     display: grid;
     grid-template-columns: 1fr 1fr;
     gap: 14px 20px;
 }
 
 .user-grid .full {
     grid-column: 1 / 3;
 }
 
 .user-form .form-group label {
     font-weight: 600;
     margin-bottom: 4px;
     display: block;
 }
 
 .user-form .form-group input,
 .user-form .form-group select {
     width: 100%;
     padding: 8px 10px;
     border-radius: 6px;
     border: 1px solid #cbd3dc;
 }
 
 /* Buttons row */
 .user-form .actions {
     margin-top: 12px;
     display: flex;
     gap: 10px;
 }
 
 /* success + error */
 .message.success {
     color: #155724;
     background:#d4edda;
     border:1px solid #c3e6cb;
     padding:8px;
     border-radius:6px;
 }
 
 /* Mobile fallback */
 @media (max-width: 768px) {
     .user-grid {
         grid-template-columns: 1fr;
     }
 
     .user-grid .full {
         grid-column: 1 / 2;
     }
 }
 
 /* Sales Register Layout */
 .sales-register{
     width: 100%;
 }
 .sales-register .card-header h2 {
     margin: 0 0 10px 0;
 }
 
 .filter-bar {
     display: flex;
     flex-wrap: wrap;
     gap: 12px;
     background: #f7faf8;
     border: 1px solid #e0e6e2;
     padding: 12px;
     border-radius: 8px;
     margin-bottom: 12px;
 }
 
 .filter-item {
     display: flex;
     flex-direction: column;
     min-width: 160px;
 }
 
 .filter-bar label {
     font-size: 12px;
     color: #445;
     margin-bottom: 2px;
 }
 
 .filter-actions {
     align-self: flex-end;
 }
 
 /* Table wrapper — reusable responsive scroll region */
 .table-wrapper,
 .responsive-table {
     display: block;
     width: 100%;
     max-width: 100%;
     overflow-x: auto;
     overflow-y: visible;
     -webkit-overflow-scrolling: touch;
     overscroll-behavior-x: contain;
     /* manipulation allows vertical page scroll while still permitting horizontal pan */
     touch-action: manipulation;
 }

 .table-wrapper > table,
 .responsive-table > table {
     width: 100%;
     min-width: 640px;
     display: table;
     border-collapse: collapse;
 }
 
 /* Pretty table */
 .table.pretty th {
     background: #ecf5f0;
     color: #234;
     font-weight: bold;
 }
 
 .table.pretty tr:hover {
     background: #f5fbf7;
 }
 
 /* Badges */
 .badge {
     padding: 4px 10px;
     border-radius: 12px;
     font-size: 12px;
     font-weight: bold;
 }
 
 /* Sale Type Colors */
 .badge.type-cash {
     background: #dbf7e4;
     color: #227a3b;
 }
 
 .badge.type-credit {
     background: #fff3d4;
     color: #9d6a00;
 }
 
 /* Status Colors */
 .badge.status-approved {
     background: #d6f5ff;
     color: #0077a7;
 }
 
 .badge.status-pending {
     background: #fde8cc;
     color: #9d5a00;
 }
 
 .badge.status-rejected {
     background: #ffd6d6;
     color: #a10000;
 }
 
 
 /* Commission Page */
 .commission-card{
     width: 100%;
 }
 .commission-card .card-header h2 {
     margin-top: 0;
 }
 
 /* summary pill bar */
 .commission-summary {
     display: flex;
     gap: 30px;
     background: #f6faf7;
     border: 1px solid #e2ece6;
     padding: 10px 12px;
     border-radius: 10px;
     margin-bottom: 12px;
 }
 
 .tag {
     background: #eaf1ed;
     padding: 4px 8px;
     border-radius: 10px;
     font-size: 12px;
 }
 
 .tag-green {
     background: #dff5e5;
     color: #1d6b37;
     font-weight: bold;
 }
 
 /* table look */
 .table.pretty th {
     background: #ecf5f0;
 }
 
 .table.pretty tr:hover {
     background: #f5fbf7;
 }
 
 /* Re-use badges so UI stays consistent */
 .badge {
     padding: 4px 10px;
     border-radius: 12px;
     font-size: 12px;
     font-weight: bold;
 }
 
 /* green-ish for commission */
 .badge.status-approved {
     background: #d6f5ff;
     color: #0077a7;
 }
 
 .badge.type-cash {
     background: #dbf7e4;
     color: #227a3b;
 }
 
 /* ================================
    STORES LIST
    ================================ */
 
 .stores-card {
     background:#1A112B;
     width: 100%;
     border:1px solid #e0e6ed;
     border-radius:10px;
     padding:18px;
     margin-bottom:20px;
     box-shadow:0 4px 10px rgba(0,0,0,.05);
 }
 
 /* Header row */
 .stores-header {
     display:flex;
     justify-content:space-between;
     align-items:center;
     margin-bottom:18px;
 }
 
 .stores-header h2 {
     margin:0;
 }
 
 /* Status badges */
 .store-status {
     padding:4px 10px;
     font-size:12px;
     font-weight:600;
     border-radius:20px;
 }
 
 .store-status.active {
     background:#e6ffed;
     color:#1f7a3d;
 }
 
 .store-status.inactive {
     background:#ffecec;
     color:#a11f1f;
 }
 
 /* Assigned users pill */
 .user-count-pill {
     background:#eef2ff;
     color:#1f3d8b;
     padding:4px 10px;
     border-radius:20px;
     font-size:12px;
     font-weight:600;
 }
 
 /* Right-aligned actions */
 .table .actions {
     text-align:right;
     white-space:nowrap;
 }
 
 /* Hover highlight */
 .table tr:hover {
     background:#211538;
 }
 
 
 /* Mobile support */
 @media(max-width:768px){
     .stores-header{
         flex-direction:column;
         gap:10px;
         align-items:flex-start;
     }
 }
 
 /* ================================
    NICE FORM LAYOUT
    ================================ */
 
 .nice-form {
     display:flex;
     flex-direction:column;
     gap:16px;
 }
 
 .form-row {
     display:grid;
     grid-template-columns:1fr 1fr;
     gap:16px;
 }
 
 .checkbox {
     display:flex;
     align-items:center;
     gap:8px;
 }
 
 .form-actions {
     margin-top:8px;
     display:flex;
     gap:10px;
 }
 
 /* smaller screens → stack */
 @media(max-width:768px){
     .form-row{
         grid-template-columns:1fr;
     }
 }
 
 /* ========= Store View Styling ========= */
 
 .store-info-bar{
     display:flex;
     gap:10px;
     margin-bottom:12px;
     flex-wrap:wrap;
 }
 
 .pill{
     padding:6px 12px;
     border-radius:20px;
     background:#eef2f5;
     font-size:13px;
 }
 
 .pill-green{ background:#e7f7ec; color:#237a44; }
 .pill-red{ background:#fde8e8; color:#b91c1c; }
 
 .grid-2{
     display:grid;
     grid-template-columns:1fr 1fr;
     gap:16px;
     margin-top:16px;
 }
 
 .split-values{
     display:flex;
     justify-content:space-between;
     margin-top:6px;
 }
 
 .split-values .label{ color:#555; }
 .split-values .value{ font-size:18px; font-weight:600; }
 
 .compact td, .compact th{
     padding:8px 10px;
 }
 
 .trend-row{
     display:flex;
     justify-content:space-between;
     padding:6px 0;
     border-bottom:1px solid #eee;
 }
 
 .highlight-text{
     font-size:16px;
     line-height:1.6;
 }
 
 @media(max-width:768px){
     .grid-2{
         grid-template-columns:1fr;
     }
 }
 
 /* ========= Products========= */
 .products-card {
     background: #1A112B;
     width: 100%;
     border: 1px solid #e0e6ed;
     border-radius: 10px;
     padding: 18px;
 }
 
 .products-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 14px;
 }
 
 .products-table td {
     vertical-align: middle;
 }
 
 /* IMEI / Qty Chip */
 .role-chip.imei {
     background: #e6f5ff;
     color: #1161a8;
     padding: 4px 10px;
     border-radius: 14px;
     font-size: 12px;
 }
 
 .role-chip.qty {
     background: #ecf7ec;
     color: #1a7a32;
     padding: 4px 10px;
     border-radius: 14px;
     font-size: 12px;
 }
 .products-card {
     background: #1A112B;
     border: 1px solid #e0e6ed;
     border-radius: 10px;
     padding: 18px;
     margin-bottom: 15px;
 }
 
 .products-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 14px;
 }
 
 .product-form .form-row {
     display: grid;
     grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
     gap: 16px;
     margin-bottom: 12px;
 }
 
 .checkbox-group {
     display: flex;
     align-items: center;
 }
 
 .checkbox-group label {
     font-weight: normal;
 }
 
 .form-actions {
     margin-top: 14px;
 }
 
 .products-card {
     background: #1A112B;
     border: 1px solid #e0e6ed;
     border-radius: 10px;
     padding: 18px;
     margin-bottom: 15px;
 }
 
 .products-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 14px;
 }
 
 .product-form .form-row {
     display: grid;
     grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
     gap: 16px;
     margin-bottom: 12px;
 }
 
 .checkbox-group {
     display: flex;
     align-items: center;
 }
 
 .checkbox-group label {
     font-weight: normal;
 }
 
 .form-actions {
     margin-top: 14px;
 }
 
 
 .muted{
     color:#777;
     font-size:12px;
 }
 /* ===== STOCK — ADD PAGE ===== */
 
 .users-cards {
     background:#1A112B;
     width: 100%;
     border-radius:14px;
     padding:18px 20px;
     box-shadow:0 10px 25px rgba(0,0,0,0.08);
     margin-bottom:25px;
 }
 
 .users-header {
     display:flex;
     justify-content:space-between;
     align-items:center;
     margin-bottom:18px;
 }
 
 .users-header h2{
     margin:0;
 }
 
 .user-form {
     margin-top:10px;
 }
 
 /* Form Grid */
 .form-row{
     display:grid;
     grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
     gap:16px;
 }
 
 /* Form group + labels */
 .form-group{
     display:flex;
     flex-direction:column;
     margin-bottom:12px;
 }
 
 .form-group label{
     font-weight:600;
     margin-bottom:6px;
 }
 
 /* Inputs */
 .form-group input,
 .form-group select,
 .form-group textarea{
     padding:10px;
     border:1px solid #ddd;
     border-radius:10px;
     font-size:14px;
     width:100%;
     outline:none;
 }
 
 .form-group textarea{
     resize:vertical;
 }
 
 /* Focus */
 .form-group input:focus,
 .form-group select:focus,
 .form-group textarea:focus{
     border-color:#7C3AED;
     box-shadow:0 0 0 2px rgba(46,139,87,0.2);
 }
 
 /* IMEI counter text */
 .muted{
     color:#777;
     font-size:12px;
     margin-top:4px;
 }
 
 /* Actions */
 .form-actions{
     margin-top:12px;
 }
 
 /* Buttons matching your theme */
 .btn{
     padding:10px 16px;
     border-radius:10px;
     border:none;
     cursor:pointer;
     text-decoration:none;
     font-weight:600;
 }
 
 .btn.secondary{
     background:#e9eef0;
     color:#333;
 }
 
 .btn:hover{
     opacity:.92;
 }
 
 /* Error message styling */
 .message{
     background:#ffefef;
     color:#8b0000;
     padding:10px;
     border-radius:10px;
     margin-bottom:10px;
 }
 
 /* ===== AGED STOCK TABLE ===== */
 
 .aged-table th{
     font-weight:600;
 }
 
 /* Qty pill */
 .qty-pill{
     background:#e9eef0;
     padding:6px 12px;
     border-radius:20px;
     font-weight:600;
 }
 
 /* Age Badges */
 .age-badge{
     padding:7px 14px;
     border-radius:20px;
     font-weight:700;
     color:#fff;
 }
 
 .age-badge.ok{
     background:#7C3AED;   /* green */
 }
 
 .age-badge.warn{
     background:#e6a100;   /* amber */
 }
 
 .age-badge.danger{
     background:#b22222;   /* red */
 }
 
 /* Card wrapper reused */
 .users-card{
     background:#1A112B;
     border-radius:14px;
     padding:18px 20px;
     box-shadow:0 10px 25px rgba(0,0,0,0.08);
     margin-bottom:25px;
 }
 
 .users-header{
     display:flex;
     justify-content:space-between;
     align-items:center;
     margin-bottom:14px;
 }
 
 /* ===== STOCK DEDUCTION ===== */
 
 .users-card{
     background:#1A112B;
     border-radius:14px;
     padding:18px 20px;
     box-shadow:0 10px 25px rgba(0,0,0,0.08);
     margin-bottom:25px;
 }
 
 .users-header{
     display:flex;
     justify-content:space-between;
     align-items:center;
     margin-bottom:14px;
 }
 
 .user-form .form-row{
     display:flex;
     gap:16px;
     flex-wrap:wrap;
 }
 
 .user-form .form-group{
     flex:1;
 }
 
 .user-form input,
 .user-form select,
 .user-form textarea{
     width:100%;
 }
 
 .form-actions{
     margin-top:12px;
 }
 
 /* ===== STOCK LIST TABLE ===== */
 
 .qty-pill{
     background:#e8f2ff;
     color:#7C3AED;
     padding:5px 10px;
     border-radius:30px;
     font-weight:600;
 }
 
 .qty-pill.low{
     background:#ffe8e8;
     color:#b00000;
 }
 
 .role-chip.agent{
     background:#2ecc71;
 }
 
 .role-chip.manager{
     background:#3498db;
 }
 /* Stock transfer styling */
 
 .hint{
     color:#6c757d;
     font-size:12px;
 }
 
 .users-card .form-row{
     display:flex;
     gap:20px;
     flex-wrap:wrap;
 }
 
 .users-card textarea{
     width:100%;
     border-radius:8px;
 }
 
 .users-card select,
 .users-card input{
     border-radius:8px;
 }
 
 .imei-group{
     margin-top:10px;
 }
 
 /* ===== CREDIT APPROVALS LAYOUT ===== */
 
 .users-card{
     width: 100%;
     background:#1A112B;
     border:1px solid #e0e6ed;
     border-radius:10px;
     padding:18px;
     box-shadow:0 5px 14px rgba(0,0,0,.05);
     margin-bottom:22px;
 }
 
 .users-header{
     display:flex;
     align-items:center;
     justify-content:space-between;
     margin-bottom:14px;
 }
 
 .users-header h2{
     margin:0;
 }
 
 /* ===== TABLE STYLING ===== */
 
 .users-table{
     width:100%;
     border-collapse:collapse;
 }
 
 .users-table th{
     background:#f7f9fc;
     padding:12px;
     text-align:left;
     border-bottom:1px solid #e3e6ef;
     font-weight:600;
 }
 
 .users-table td{
     padding:10px 12px;
     border-bottom:1px solid #eff2f7;
 }
 
 /* zebra rows like other pages */
 .users-table tbody tr:nth-child(even){
     background:#fafbfd;
 }
 
 /* ===== STATUS BADGE ===== */
 
 .status-badge{
     border-radius:12px;
     padding:4px 10px;
     font-size:12px;
     font-weight:600;
 }
 
 .status-badge.pending{
     background:#fff3cd;
     color:#8a6d1a;
     border:1px solid #e7d9a8;
 }
 
 /* ===== BUTTONS ===== */
 
 .btn{
     padding:7px 12px;
     border-radius:8px;
 }
 
 .btn.approve-btn{
     background:#7C3AED;
     color:#fff;
 }
 
 .btn.approve-btn:hover{
     opacity:.9;
 }
 
 .btn.danger{
     background:#d9534f;
     color:#fff;
 }
 
 /* ===== CUSTOMER INFO ROW ===== */
 
 .customer-row{
     background:#f8fafb;
     font-size:13px;
     color:#444;
 }
 
 .customer-row td{
     padding-top:6px;
     padding-bottom:6px;
 }
 
 /* =========================================
    MOBILE FIX FOR POS LAYOUT (FINAL)
    ========================================= */
 
  
   /* ===========================
    HEADER + MOBILE MENU + PWA
    =========================== */
 
 .menu-btn {
     display: none;
     font-size: 22px;
     background: none;
     border: none;
     color: #fff;
     cursor: pointer;
   }
   
   .install-btn {
     background: none;
     border: none;
     font-size: 20px;
     cursor: pointer;
     margin-right: 8px;
   }
   
   /* Mobile header layout */
   @media (max-width: 768px) {
   
     .topbar {
       display: flex;
       align-items: center;
       justify-content: space-between;
     }
   
     .topbar-left h2 {
       font-size: 16px;
       white-space: nowrap;
     }
   
     .topbar-center {
       display: none;
     }
   
     .menu-btn {
       display: inline-block;
     }
   
     .fullscreen-btn {
       display: none;
     }
   
   
   }
   /* ================================
   MOBILE SIDEBAR – FIXED SYSTEM
   ================================ */

@media (max-width: 768px) {

    .sidebar {
      position: fixed;
      top: 0;
      left: 0;
      width: 260px;
      height: 100%;
      background: linear-gradient(180deg, #2E1065, #140D24);
      z-index: 10000;
  
      transform: translateX(-100%);
      transition: transform 0.3s ease;
  
      pointer-events: none;
    }
  
    .sidebar.open {
      transform: translateX(0);
      pointer-events: auto;
    }
  
    .sidebar-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.4);
      z-index: 9999;
      display: none;
    }
  
    .sidebar-overlay.active {
      display: block;
    }
  
  }
  
  @media (max-width: 768px) {

    .layout,
    .content,
    .pos-wrapper,
    .users-card,
    .stores-card,
    .products-card,
    .commission-card {
      max-width: 100%;
    }

    /*
     * Do NOT set overflow-x:hidden on .content — combined with overflow-y:auto
     * it freezes touch scrolling on many Android browsers when a child scrolls
     * horizontally. Clip only on layout shell; scroll tables via .table-wrapper.
     */
    .layout {
      overflow-x: hidden;
    }

    .table-wrapper,
    .responsive-table {
      display: block;
      width: 100%;
      max-width: 100%;
      overflow-x: auto;
      overflow-y: visible;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-x: contain;
      touch-action: manipulation;
    }

    /* Keep real table layout — display:block broke column alignment & scroll */
    .table-wrapper > table,
    .responsive-table > table,
    table.table {
      width: 100%;
      display: table;
      max-width: none;
    }

    .content {
      overflow-x: visible;
      touch-action: pan-y pinch-zoom;
    }
  
    * {
      box-sizing: border-box;
    }
  }

  .ios-install-hint{
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: #2E1065;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 99999;
}

  @media (max-width: 768px) {

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 per row */
  }

  .dashboard-grid .card {
    aspect-ratio: 1 / 1;      /* makes square */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 12px;
  }

  .dashboard-grid .card h3 {
    font-size: 28px;
    margin-bottom: 6px;
  }

  .dashboard-grid .card p {
    font-size: 18px;
    margin: 0;
  }

}

.reverse-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 20000;
    justify-content: center;
    align-items: center;
}

.reverse-modal-card {
    background: #1A112B;
    padding: 20px;
    width: 320px;
    max-width: 90%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: popIn 0.2s ease-out;
}

.reverse-modal-card input {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

@keyframes popIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.reverse-btn{
    margin-top: 15px;   /* pushes it down from Submit button */
}

/* ========== STORE PERFORMANCE (Admin dashboard only) ========== */
.store-performance-section {
    margin: 8px 0 24px;
}

.store-performance-section__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.store-performance-section__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.store-performance-section__subtitle {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.35;
}

.store-performance-section__all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
    white-space: nowrap;
    padding: 6px 2px;
    border-radius: 6px;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.store-performance-section__all:hover,
.store-performance-section__all:focus-visible {
    color: #1e40af;
    outline: none;
}

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

.store-performance-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: #1A112B;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.store-performance-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.18);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
}

.store-performance-card--top {
    border-color: rgba(217, 119, 6, 0.28);
}

.store-performance-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 0;
}

.store-performance-card__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #15803d;
}

.store-performance-card__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.store-performance-card__status--inactive {
    color: #94a3b8;
}

.store-performance-card__badge {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 3px 8px;
    white-space: nowrap;
}

.store-performance-card__name {
    margin: 10px 14px 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
    word-break: break-word;
}

.store-performance-card__location {
    margin: 4px 14px 0;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.3;
}

.store-performance-card__revenue {
    margin: 14px 14px 0;
    padding: 10px 12px;
    background: #211538;
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 10px;
}

.store-performance-card__revenue-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #64748b;
}

.store-performance-card__revenue-value {
    display: block;
    margin-top: 4px;
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.store-performance-card__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 12px 14px 0;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    overflow: hidden;
    background: #1A112B;
}

.store-performance-card__metric {
    padding: 10px 8px;
    text-align: center;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.store-performance-card__metric:nth-child(3n) {
    border-right: none;
}

.store-performance-card__metric:nth-last-child(-n+3) {
    border-bottom: none;
}

.store-performance-card__metric:last-child {
    border-right: none;
}

.store-performance-card__metric-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.store-performance-card__metric-value {
    display: block;
    margin-top: 4px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.store-performance-card__metric--aged .store-performance-card__metric-value {
    color: #b45309;
}

.store-performance-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding: 12px 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    text-decoration: none;
    color: #1d4ed8;
    font-size: 0.8125rem;
    font-weight: 600;
    background: #211538;
    transition: background 0.18s ease, color 0.18s ease;
    min-height: 44px;
}

.store-performance-card__footer:hover,
.store-performance-card__footer:focus-visible {
    background: #eff6ff;
    color: #1e40af;
    outline: none;
}

.store-performance-card__footer-arrow {
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.18s ease;
}

.store-performance-card__footer:hover .store-performance-card__footer-arrow,
.store-performance-card__footer:focus-visible .store-performance-card__footer-arrow {
    transform: translateX(3px);
}

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

@media (max-width: 700px) {
    .store-performance-grid {
        grid-template-columns: 1fr;
    }

    .store-performance-card__revenue-value {
        font-size: 1.25rem;
    }

    .store-performance-section__header {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .store-performance-card,
    .store-performance-card__footer,
    .store-performance-card__footer-arrow {
        transition: none;
    }

    .store-performance-card:hover {
        transform: none;
    }
}

/* ==========================================================================
   KAVILUDI ENTERPRISE UI POLISH — refinement only (no workflow changes)
   ========================================================================== */

.page-title,
.topbar-left h2,
.sidebar h2,
.phase2-header h2,
.card-header h2 {
    font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif;
}

.page-title {
    margin: 0 0 18px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text, #1e293b);
    letter-spacing: -0.015em;
}

/* ----- Cards ----- */
.card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 10px);
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.05));
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md, 0 4px 14px rgba(15, 23, 42, 0.06));
    border-color: rgba(15, 23, 42, 0.12);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
    align-items: stretch;
}

.dashboard-grid .card {
    height: 100%;
    margin-bottom: 0;
}

.dashboard-grid .card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.dashboard-grid .card p {
    margin-top: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    min-height: 44px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #7C3AED, #8B5CF6);
    color: #ffffff;
    border-radius: var(--radius-sm, 12px);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    opacity: 1;
    background: linear-gradient(135deg, #8B5CF6, #A855F7);
    text-decoration: none;
    color: #fff;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn:disabled,
.btn.is-loading,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.secondary,
.btn-muted {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.btn.secondary:hover,
.btn-muted:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn.danger {
    background: #dc2626;
    color: #fff;
}

.btn.danger:hover {
    background: #b91c1c;
}

.btn.success,
.btn-success {
    background: var(--green, #7C3AED);
    color: #fff;
}

.btn.success:hover,
.btn-success:hover {
    background: var(--green-dark, #5B21B6);
}

.btn.outline {
    background: transparent;
    color: var(--brand, #2E1065);
    border-color: rgba(15, 61, 46, 0.28);
}

.btn.outline:hover {
    background: rgba(15, 61, 46, 0.06);
    color: var(--brand, #2E1065);
}

.btn-sm {
    padding: 6px 11px;
    min-height: 34px;
    font-size: 0.8125rem;
    border-radius: 7px;
}

/* ----- Tables ----- */
.table-wrapper,
.responsive-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: manipulation;
    border-radius: var(--radius-sm, 8px);
}

.badge-warning { background:#fef3c7; color:#92400e; }
.badge-success { background:#d1fae5; color:#065f46; }
.badge-danger { background:#fee2e2; color:#991b1b; }
.badge-muted { background:#f1f5f9; color:#475569; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    text-align: left;
    vertical-align: middle;
}

.table thead th {
    background: #211538;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr {
    transition: background 0.12s ease;
}

.table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.65);
}

.table tbody tr:hover {
    background: #f1f5f9;
}

.table.pretty th {
    background: #ecf5f0;
    color: #1e3a2f;
}

.table.pretty tbody tr:hover {
    background: #f5fbf7;
}

/* ----- Forms ----- */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea,
.filter-item input,
.filter-item select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm, 8px);
    font-family: inherit;
    font-size: 0.95rem;
    color: #0f172a;
    background: #1A112B;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: var(--green, #7C3AED);
    box-shadow: var(--focus-ring);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    align-items: center;
}

.message,
.phase2-alert {
    border-radius: 8px;
}

/* ----- Sidebar polish ----- */
.sidebar {
    width: 230px;
    background: linear-gradient(180deg, var(--brand, #2E1065), var(--brand-deep, #140D24));
    color: #eaf5ee;
    padding: 20px 14px;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.sidebar h2 {
    margin: 0 0 16px;
    padding: 0 8px 14px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #d7ebe0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.35;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin: 0 0 4px;
}

.sidebar a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #eaf5ee;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.sidebar a:hover {
    background: rgba(159, 227, 191, 0.12);
    color: #ffffff;
    text-decoration: none;
}

.sidebar a:focus-visible {
    outline: 2px solid rgba(159, 227, 191, 0.7);
    outline-offset: 1px;
}

.sidebar a.active {
    background: linear-gradient(135deg, #7C3AED, #8B5CF6);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(46, 139, 87, 0.28);
    font-weight: 600;
}

.sidebar hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 12px 6px;
}

/* ----- Topbar polish ----- */
.topbar {
    background: linear-gradient(180deg, var(--brand, #2E1065), var(--brand-deep, #140D24));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 56px;
    box-sizing: border-box;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.topbar-left h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

.topbar-center {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
    font-variant-numeric: tabular-nums;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.menu-btn,
.install-btn,
.fullscreen-btn {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.menu-btn:hover,
.install-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fullscreen-btn {
    background: var(--green, #7C3AED);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
}

.fullscreen-btn:hover {
    background: var(--green-dark, #5B21B6);
}

.fullscreen-btn:focus-visible,
.menu-btn:focus-visible,
.install-btn:focus-visible {
    outline: 2px solid rgba(159, 227, 191, 0.8);
    outline-offset: 2px;
}

.notif-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    color: #fff;
}

.notif-link:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* ----- Filter bars / section headers ----- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #211538;
    border: 1px solid var(--border, #e2e8f0);
    padding: 14px;
    border-radius: var(--radius, 10px);
    margin-bottom: 14px;
}

.filter-item label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
}

.card-header {
    margin-bottom: 4px;
}

.card-header h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

/* ----- Empty / loading comfort ----- */
.text-center.muted,
.muted {
    color: var(--text-muted, #64748b);
}

/* ----- POS panels slight polish ----- */
.pos-items,
.pos-summary {
    border: 1px solid var(--border, #e2e8f0);
    box-shadow: var(--shadow-sm);
}

/* ----- Badges ----- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* ----- Mobile refinements ----- */
@media (max-width: 768px) {
    .topbar {
        padding: 8px 12px;
        min-height: 52px;
    }

    .topbar-left h2 {
        font-size: 0.95rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dashboard-grid .card {
        aspect-ratio: auto;
        min-height: 108px;
        padding: 14px 12px;
    }

    .dashboard-grid .card h3 {
        font-size: 1.35rem;
        margin-bottom: 4px;
    }

    .dashboard-grid .card p {
        font-size: 0.7rem;
        line-height: 1.25;
    }

    .btn,
    .btn-sm,
    .menu-btn,
    .install-btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 40px;
    }

    .sidebar a {
        padding: 12px 14px;
        font-size: 0.95rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .table th,
    .table td {
        padding: 10px;
    }
}

@media (max-width: 360px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 12px 10px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .card,
    .btn,
    .sidebar a,
    .table tbody tr {
        transition: none;
    }

    .card:hover {
        transform: none;
    }
}



