/* =====================================================
   GLOBAL STYLES
   ===================================================== */

   body {
    font-family: 'Playfair Display', serif;
     background: #f4f6f8;
     margin: 0;
     color: #2f3542;
 }
 
 a {
     color: #1f5fa1;
     text-decoration: none;
 }
 
 a:hover {
     text-decoration: underline; 
 }
html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
}



 
 /* =====================================================
    LAYOUT
    ===================================================== */
 
   .layout {
    display: flex;
    height: calc(100vh - 60px);
    align-items: stretch;   /* ← ADD THIS */
}

 
   .content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;   /* ← IMPORTANT for flex scrolling */
}

    
 
 
 /* =====================================================
    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 a {
     color: #ecf0f1;
 }
 
 
 /* =====================================================
    TOP BAR
    ===================================================== */
 
 .topbar {
     background: #ffffff;
     border-bottom: 1px solid #e0e6ed;
     padding: 12px 20px;
     display: flex;
     justify-content: space-between;
     align-items: center;
 }
 
 
 /* =====================================================
    CARDS & TABLES
    ===================================================== */
 
 .card {
     background: #ffffff;
     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: #1f5fa1;
     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 (GIZMO GALAXY BRANDING)
    ===================================================== */
 
 /* Apply ONLY to login page */
 /* =========================
    LOGIN PAGE – REFINED
    ========================= */
 
 /* ===========================
    LOGIN PAGE
    =========================== */
 
 /* Background for login page only */
 body.login-page {
     background-image: url('../indexbg.jpeg');
     background-size: cover;
     background-position: center;
     background-repeat: no-repeat;
 }
 

 
 /* Wrapper: places login card to the right */
 .login-wrapper {
     display: flex;
     align-items: center;
     justify-content: flex-end;
     min-height: 100vh;
     padding-right: 60px;
 }
 
 /* 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: #2e8b57;
     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, #2e8b57, #3cb371);
     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);
        }
      
        .sidebar {
          height: 100vh;
        }
      
        .content {
          height: calc(100vh - 56px);
        }
      
      }
      
/* =====================================================
    SIDEBAR – GIZMO GALAXY STYLE
    ===================================================== */
 
    .sidebar {
        width: 230px;
        background: linear-gradient(180deg, #0f3d2e, #0b2f23);
        color: #eaf5ee;
        padding: 24px 18px;
        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: 10px;
     color: #eaf5ee;
     font-size: 18px;
     font-weight: 500;
     transition: all 0.2s ease;
 }
 
 /* Hover effect */
 .sidebar a:hover {
     background: rgba(159, 227, 191, 0.12);
     color: #ffffff;
     text-decoration: none;
 }
 
 /* Active menu item (if you add class="active") */
 .sidebar a.active {
     background: linear-gradient(135deg, #2e8b57, #3cb371);
     color: #ffffff;
     box-shadow: 0 6px 14px rgba(46, 139, 87, 0.4);
 }
 
 /* Optional section divider */
 .sidebar hr {
     border: none;
     height: 1px;
     background: rgba(255, 255, 255, 0.08);
     margin: 15px 0;
 }
 
 body { outline: 4px solid lime !important; }
  
 /* ===========================
    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: #ffffff;
     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: #1f2937;
 }
 
 /* Card label */
 .card p {
     margin-top: 6px;
     font-size: 14px;
     color: #6b7280;
 }
 
 /* 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 */
 .card.indigo { border-top: 5px solid #6366f1; } /* indigo */

.register-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.register-summary-grid .card {
    text-align: center;
    padding: 16px 12px;
}

.register-summary-grid .card h3 {
    font-size: 1.35rem;
    margin: 0 0 6px;
}

.register-summary-grid .card p {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stock-explorer .clickable-row:hover {
    background: #f3f7ff;
}

.stock-explorer .breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

.stock-explorer .breadcrumb a:hover {
    text-decoration: underline;
}

.imei-timeline {
    padding: 8px 4px 8px 8px;
}

.imei-timeline-step {
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
}

.imei-timeline-dot {
    position: absolute;
    left: 0;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2563eb;
}

.imei-timeline-body {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}

.imei-timeline-detail {
    color: #475569;
    margin-top: 4px;
    font-size: 13px;
}

.imei-timeline-date {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 4px;
}

.imei-timeline-arrow {
    text-align: center;
    color: #94a3b8;
    font-size: 18px;
    margin: 4px 0 4px 0;
}
 
 
 
 /* ---- TABLE POLISH ---- */
 
 .table thead th {
     background:#f8fafc;
     font-weight:600;
 }
 
 .table tbody tr:hover {
     background:#f3f4f6;
 }
 
 /* ---------- 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:#16a34a;
 }
 
 /* ===========================
    TOP BAR (Header)
    =========================== */
 
 .topbar{
     background:linear-gradient(180deg, #0f3d2e, #0b2f23);
     border-bottom:1px solid #e0e6ed;
     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:green;        /* legacy fullscreen control */
     border:none;
     padding:6px 12px;
     border-radius:6px;
     color:white;
     cursor:pointer;
     font-size:16px;
 }
 
 .fullscreen-btn:hover{
     background:#16a34a;
 }
 
 /* ============================
    POS FULL PAGE STYLE
    ============================ */
 
 .pos-wrapper{
     padding:15px;
     width: 100%; 
 }
 
 .pos-title{
     margin-bottom:10px;
 }
 
 /* green theme */
 :root{
     --green:#2e8b57;
     --light:#f5fff8;
 }
 
 /* grid layout */
 .pos-grid{
     display:grid;
     grid-template-columns: 1.35fr 0.9fr;
     gap:20px;
 }
 
 .pos-items,.pos-summary{
     background:white;
     border-radius:12px;
     padding:16px;
     box-shadow:0 10px 25px rgba(0,0,0,.08);
 }
 
 .pos-item-card{
     border:1px solid #e4e9ef;
     padding:12px;
     margin-bottom:10px;
     border-radius:10px;
     background:#f8fbf9;
 }
 
 .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:#2e8b57;
 }
 
 /* Payment Buttons */
 .pay-buttons{
     display:flex;
     gap:10px;
 }
 
 .pay-btn{
     flex:1;
     padding:10px;
     border-radius:10px;
     border:2px solid #2e8b57;
     background:white;
     cursor:pointer;
     font-weight:600;
 }
 
 .pay-btn.active{
     background:#2e8b57;
     color:white;
 }
 
 /* Submit button */
 .pos-summary .submit{
     width:100%;
     background:linear-gradient(135deg,#2e8b57,#3cb371);
     color:white;
     font-size:16px;
 }
 
 /* IMEI logic controls */
 .imei-field{ display:block; }
 .qty-field{ display:block; }
 .dropdown-list{
     position:absolute;
     background:white;
     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:#fff;
     padding:18px 28px;
     border-radius:10px;
     font-weight:600;
     display:flex;
     gap:10px;
     align-items:center;
 }
 
 .spinner{
     width:18px;
     height:18px;
     border:3px solid #2e8b57;
     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:#1f5fa1;
 }
 
 .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 */
 .table-wrapper {
     overflow-x: auto;
 }
 
 /* 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:#ffffff;
     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:#f8fafc;
 }
 
 
 /* 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: #ffffff;
     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: #fff;
     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: #fff;
     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:#fff;
     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:#2e8b57;
     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:#2e8b57;   /* green */
 }
 
 .age-badge.warn{
     background:#e6a100;   /* amber */
 }
 
 .age-badge.danger{
     background:#b22222;   /* red */
 }
 
 /* Card wrapper reused */
 .users-card{
     background:#fff;
     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:#fff;
     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:#1f5fa1;
     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:#ffffff;
     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:#2e8b57;
     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, #0f3d2e, #0b2f23);
      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%;
      overflow-x: hidden;
    }
  
    table {
      width: 100%;
      display: block;
      overflow-x: auto;
    }
  
    * {
      box-sizing: border-box;
    }
  }

  .ios-install-hint{
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f3d2e;
  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: #fff;
    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 */
}

/* =====================================================
   LUCHAO SOLUTIONS · ENTERPRISE DESIGN SYSTEM
   Shared overrides intentionally preserve legacy markup.
   ===================================================== */
:root {
    color-scheme: dark;
    --ls-primary: #007BFF;
    --ls-primary-2: #1E90FF;
    --ls-cyan: #00C8FF;
    --ls-navy: #06142E;
    --ls-navy-2: #0B1F4D;
    --ls-card: #0E1C3D;
    --ls-card-2: #122650;
    --ls-border: rgba(255, 255, 255, .08);
    --ls-text: #FFFFFF;
    --ls-text-2: #C9D6F0;
    --ls-muted: #93A8D9;
    --ls-success: #22C55E;
    --ls-warning: #F59E0B;
    --ls-danger: #EF4444;
    --ls-info: #38BDF8;
    --ls-radius: 18px;
    --ls-radius-sm: 12px;
    --ls-shadow: 0 18px 48px rgba(0, 5, 24, .28);
    --ls-focus: 0 0 0 3px rgba(0, 200, 255, .22);
    --ls-topbar: 72px;
    --ls-sidebar: 272px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ls-navy); scroll-behavior: smooth; }
body,
body.app-shell {
    min-width: 0;
    outline: none !important;
    background:
        radial-gradient(circle at 82% -10%, rgba(0, 123, 255, .16), transparent 30rem),
        radial-gradient(circle at 10% 90%, rgba(0, 200, 255, .06), transparent 26rem),
        var(--ls-navy);
    color: var(--ls-text-2);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }
a { color: var(--ls-info); }
a:hover { color: #7DDFFF; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: none; box-shadow: var(--ls-focus); }
[hidden] { display: none !important; }
.skip-link {
    position: fixed; left: 16px; top: -60px; z-index: 99999;
    padding: 10px 14px; border-radius: 10px; background: var(--ls-primary); color: white;
}
.skip-link:focus { top: 12px; }

/* Application shell */
.topbar {
    height: var(--ls-topbar);
    padding: 0 clamp(14px, 2vw, 28px);
    gap: 20px;
    background: rgba(6, 20, 46, .82);
    border-bottom: 1px solid var(--ls-border);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: 0 8px 32px rgba(0, 5, 24, .18);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-brand {
    display: flex; align-items: center; gap: 10px; color: var(--ls-text);
}
.topbar-brand img, .sidebar-brand img {
    border-radius: 11px;
    box-shadow: 0 8px 20px rgba(0, 123, 255, .25);
}
.topbar-brand span, .sidebar-brand div { display: flex; flex-direction: column; line-height: 1.05; }
.topbar-brand strong, .sidebar-brand strong { font-size: 16px; letter-spacing: -.01em; }
.topbar-brand small, .sidebar-brand span { color: var(--ls-muted); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; margin-top: 4px; }
.topbar-search {
    width: min(440px, 38vw); height: 42px; display: flex; align-items: center; gap: 10px;
    padding: 0 12px; border: 1px solid var(--ls-border); border-radius: 13px;
    background: rgba(255,255,255,.045); color: var(--ls-muted);
}
.topbar-search:focus-within { border-color: rgba(0,200,255,.5); box-shadow: var(--ls-focus); }
.topbar-search input {
    min-width: 0; flex: 1; padding: 0; border: 0; background: transparent; color: var(--ls-text);
}
.topbar-search input:focus { box-shadow: none; outline: none; }
.topbar-search kbd { padding: 2px 6px; border: 1px solid var(--ls-border); border-radius: 6px; color: var(--ls-muted); font-size: 11px; }
.topbar-date { color: var(--ls-muted); font-size: 12px; white-space: nowrap; }
.icon-btn {
    width: 40px; height: 40px; display: inline-grid; place-items: center; flex: 0 0 40px;
    border: 1px solid var(--ls-border); border-radius: 12px; background: rgba(255,255,255,.045);
    color: var(--ls-text-2); cursor: pointer; transition: .18s ease;
}
.icon-btn:hover, .icon-btn.active { transform: translateY(-1px); color: white; border-color: rgba(0,200,255,.28); background: rgba(0,123,255,.16); }
.menu-btn { display: none; }
.profile-chip { display: flex; align-items: center; gap: 9px; padding-left: 4px; }
.profile-avatar {
    width: 38px; height: 38px; display: inline-grid; place-items: center; flex: 0 0 38px;
    border-radius: 12px; color: white; font-weight: 750;
    background: linear-gradient(135deg, var(--ls-primary), var(--ls-cyan));
    box-shadow: 0 8px 20px rgba(0,123,255,.22);
}
.profile-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 72px; }
.profile-copy strong { color: var(--ls-text); font-size: 13px; }
.profile-copy small { color: var(--ls-muted); font-size: 11px; }

.layout { min-height: calc(100dvh - var(--ls-topbar)); height: calc(100dvh - var(--ls-topbar)); }
.content, .pos-wrapper {
    width: calc(100% - var(--ls-sidebar)); max-width: none; min-width: 0;
    padding: clamp(18px, 2.5vw, 36px);
    overflow-x: hidden; overflow-y: auto;
}
.pos-wrapper { flex: 1; }
.page-title, .pos-title, .content > h1, .content > h2 {
    color: var(--ls-text); font-size: clamp(24px, 3vw, 34px); line-height: 1.15;
    letter-spacing: -.035em; margin: 0 0 24px;
}

/* Sidebar */
.sidebar {
    width: var(--ls-sidebar); height: 100%; padding: 18px 14px 16px;
    display: flex; flex-direction: column; flex: 0 0 var(--ls-sidebar);
    background: linear-gradient(180deg, rgba(11,31,77,.96), rgba(6,20,46,.98));
    border-right: 1px solid var(--ls-border); box-shadow: 20px 0 50px rgba(0,5,24,.12);
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 16px; border-bottom: 1px solid var(--ls-border); }
.sidebar-brand strong { color: var(--ls-text); font-size: 18px; }
.sidebar-user {
    display: flex; align-items: center; gap: 10px; padding: 14px 10px; margin: 12px 0 4px;
    border: 1px solid var(--ls-border); border-radius: 14px; background: rgba(255,255,255,.035);
}
.sidebar-user .profile-avatar { width: 36px; height: 36px; flex-basis: 36px; }
.sidebar-user div { min-width: 0; display: flex; flex-direction: column; }
.sidebar-user strong { color: white; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user span:not(.profile-avatar) { color: var(--ls-muted); font-size: 11px; }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 2px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.nav-label {
    display: block; margin: 18px 10px 7px; color: #6881B7; font-size: 10px;
    font-weight: 750; letter-spacing: .13em; text-transform: uppercase;
}
.sidebar ul { margin: 0; padding: 0; }
.sidebar li { margin: 2px 0; }
.sidebar a {
    min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 9px 11px;
    border: 1px solid transparent; border-radius: 12px; color: var(--ls-text-2); font-size: 13px;
    font-weight: 560; transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar a i { width: 19px; color: var(--ls-muted); text-align: center; font-size: 14px; transition: color .18s ease; }
.sidebar a span { flex: 1; }
.sidebar a em { padding: 2px 6px; border-radius: 6px; background: rgba(0,200,255,.12); color: var(--ls-cyan); font-size: 8px; font-style: normal; letter-spacing: .08em; }
.sidebar a:hover { background: rgba(255,255,255,.055); color: white; transform: translateX(2px); }
.sidebar a.active {
    background: linear-gradient(115deg, rgba(0,123,255,.92), rgba(30,144,255,.62));
    border-color: rgba(125,223,255,.22); color: white; box-shadow: 0 8px 22px rgba(0,123,255,.22);
}
.sidebar a.active i, .sidebar a:hover i { color: white; }
.sidebar-logout { margin-top: 10px; color: #FFB4B4 !important; background: rgba(239,68,68,.06); }
.sidebar-overlay { backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }

/* Core components */
.card, .users-card, .users-cards, .stores-card, .products-card, .commission-card,
.pos-items, .pos-summary, .form-block, .filter-bar, .imei-timeline-body {
    background: linear-gradient(145deg, rgba(18,38,80,.9), rgba(14,28,61,.96));
    border: 1px solid var(--ls-border); border-radius: var(--ls-radius); color: var(--ls-text-2);
    box-shadow: var(--ls-shadow);
}
.card, .users-card, .users-cards, .stores-card, .products-card, .commission-card { padding: clamp(16px, 2vw, 24px); }
.card:hover { transform: translateY(-2px); border-color: rgba(0,200,255,.16); box-shadow: 0 22px 58px rgba(0,5,24,.36); }
.card h2, .card h3, .users-card h2, .users-card h3, .products-card h2, .stores-card h2,
.pos-items h3, .pos-summary h3 { color: var(--ls-text); }
.card p, .muted, .hint, .text-muted { color: var(--ls-muted) !important; }
.dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.dashboard-grid .card { min-height: 138px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; border-top-width: 1px; }
.dashboard-grid .card::after {
    content: ""; position: absolute; width: 110px; height: 110px; right: -42px; top: -45px;
    border-radius: 50%; background: radial-gradient(circle, rgba(0,200,255,.18), transparent 68%);
}
.dashboard-grid .card h3 { color: white; font-size: clamp(22px, 2.5vw, 30px); letter-spacing: -.035em; }
.dashboard-grid .card p { margin: 7px 0 0; color: var(--ls-muted); font-size: 12px; font-weight: 650; letter-spacing: .025em; text-transform: uppercase; }
.dashboard-grid .green { --accent: var(--ls-success); }
.dashboard-grid .orange, .dashboard-grid .yellow { --accent: var(--ls-warning); }
.dashboard-grid .red { --accent: var(--ls-danger); }
.dashboard-grid .blue, .dashboard-grid .purple, .dashboard-grid .teal,
.dashboard-grid .cyan, .dashboard-grid .indigo, .dashboard-grid .dark { --accent: var(--ls-info); }
.dashboard-grid .card::before { content: ""; position: absolute; left: 0; top: 25%; bottom: 25%; width: 3px; border-radius: 0 4px 4px 0; background: var(--accent); box-shadow: 0 0 14px var(--accent); }

.btn {
    min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; border: 1px solid rgba(125,223,255,.16); border-radius: 12px;
    background: linear-gradient(135deg, var(--ls-primary), var(--ls-primary-2)); color: white;
    font-size: 13px; font-weight: 700; box-shadow: 0 8px 20px rgba(0,123,255,.18);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn:hover { opacity: 1; color: white; transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 12px 25px rgba(0,123,255,.28); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.secondary { background: rgba(255,255,255,.06); border-color: var(--ls-border); color: var(--ls-text-2); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #D93343, var(--ls-danger)); border-color: rgba(255,255,255,.1); }

.form-group label, .pos-field label, .filter-bar label { color: var(--ls-text-2); font-size: 12px; font-weight: 650; }
.form-group input, .form-group select, .form-group textarea,
.pos-field input, .pos-field select, .pos-field textarea,
.user-filters input, .user-filters select, #managerSearch, #managerSelect,
.form-control, input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    min-height: 46px; max-width: 100%; padding: 10px 13px; border: 1px solid var(--ls-border);
    border-radius: 12px; background: rgba(3,13,34,.56); color: var(--ls-text); outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { min-height: 88px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #637AAE; }
input:focus, select:focus, textarea:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: rgba(0,200,255,.55); background: rgba(5,18,44,.8); box-shadow: var(--ls-focus);
}
select option { background: var(--ls-card); color: white; }
.form-block, .filter-bar { padding: 14px; }
.form-row, .two-col, .user-grid { gap: 16px; }

.table-wrapper { border: 1px solid var(--ls-border); border-radius: 15px; overflow: auto; background: rgba(3,13,34,.25); }
.table, .users-table, table { width: 100%; color: var(--ls-text-2); border-collapse: separate; border-spacing: 0; }
.table thead th, .users-table th, .table.pretty th, table thead th {
    position: sticky; top: 0; z-index: 2; padding: 13px 14px; background: #102650;
    border: 0; border-bottom: 1px solid var(--ls-border); color: #BFD0F2; font-size: 11px;
    font-weight: 750; letter-spacing: .055em; text-transform: uppercase;
}
.table td, .users-table td, table td { padding: 13px 14px; border: 0; border-bottom: 1px solid rgba(255,255,255,.055); color: var(--ls-text-2); }
.table tbody tr:nth-child(even), .users-table tbody tr:nth-child(even) { background: rgba(255,255,255,.018); }
.table tbody tr:hover, .users-table tbody tr:hover, .table tr:hover { background: rgba(0,123,255,.07); }
.badge, .status-badge, .role-chip, .qty-pill, .pill, .tag, .store-status, .user-count-pill {
    display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px;
    border: 1px solid var(--ls-border); background: rgba(56,189,248,.1); color: #91DBFF; font-size: 11px; font-weight: 700;
}
.status-badge.active, .status-approved, .type-cash, .pill-green { background: rgba(34,197,94,.12) !important; color: #7CEBA3 !important; }
.status-badge.pending, .status-pending, .type-credit { background: rgba(245,158,11,.13) !important; color: #FFD27A !important; }
.status-badge.inactive, .status-rejected, .pill-red, .qty-pill.low { background: rgba(239,68,68,.12) !important; color: #FFA0A0 !important; }
.message {
    display: flex; align-items: center; gap: 9px; padding: 11px 13px; margin-bottom: 14px;
    border: 1px solid rgba(239,68,68,.2); border-radius: 12px; background: rgba(239,68,68,.1); color: #FFB4B4;
}
.message.success { border-color: rgba(34,197,94,.22); background: rgba(34,197,94,.1); color: #8DF0AF; }

/* Point of sale */
.pos-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--ls-border); border-radius: var(--ls-radius); background: rgba(14,28,61,.68); }
.pos-grid { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 18px; align-items: start; }
.pos-items, .pos-summary { padding: clamp(16px, 2vw, 22px); }
.pos-summary { position: sticky; top: 16px; }
.pos-item-card { position: relative; padding: 16px; background: rgba(3,13,34,.38); border: 1px solid var(--ls-border); border-radius: 15px; }
.pos-item-card + .pos-item-card { margin-top: 12px; }
.pos-remove { position: absolute; top: 10px; right: 10px; z-index: 2; }
.pos-remove .btn { width: 34px; min-height: 34px; padding: 0; border-radius: 10px; }
.pos-field { margin-bottom: 13px; }
.pay-buttons { padding: 4px; border: 1px solid var(--ls-border); border-radius: 13px; background: rgba(3,13,34,.5); }
.pay-btn { min-height: 39px; border: 0; border-radius: 9px; background: transparent; color: var(--ls-muted); }
.pay-btn.active { background: linear-gradient(135deg, var(--ls-primary), var(--ls-primary-2)); color: white; box-shadow: 0 7px 16px rgba(0,123,255,.2); }
.pos-summary h2, #totalDisplay { margin: 16px 0; padding: 16px; border: 1px solid rgba(0,200,255,.15); border-radius: 14px; background: rgba(0,123,255,.1); color: white; font-size: clamp(22px, 3vw, 30px); }
.pos-summary .submit { min-height: 52px; font-size: 15px; }
.dropdown-list, .imei-suggestions { background: var(--ls-card) !important; border-color: var(--ls-border) !important; color: var(--ls-text-2); border-radius: 12px; box-shadow: var(--ls-shadow); }
.loader-box, .reverse-modal-card { background: var(--ls-card); border: 1px solid var(--ls-border); color: white; border-radius: var(--ls-radius); }
.reverse-modal-overlay { backdrop-filter: blur(8px); }

/* Login */
body.login-page { min-height: 100dvh; background: var(--ls-navy); color: var(--ls-text-2); }
.login-wrapper { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); padding: 0; }
.login-hero {
    position: relative; min-width: 0; padding: clamp(28px, 5vw, 72px);
    display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
    background:
        radial-gradient(circle at 75% 20%, rgba(0,200,255,.2), transparent 22rem),
        linear-gradient(145deg, rgba(0,123,255,.23), rgba(6,20,46,.35)),
        var(--ls-navy-2);
    border-right: 1px solid var(--ls-border);
}
.login-hero::after { content: ""; position: absolute; width: 440px; height: 440px; right: -220px; bottom: -220px; border: 1px solid rgba(0,200,255,.15); border-radius: 50%; box-shadow: 0 0 0 70px rgba(0,123,255,.025), 0 0 0 140px rgba(0,123,255,.018); }
.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-brand img { border-radius: 15px; box-shadow: 0 14px 35px rgba(0,123,255,.3); }
.login-brand span { display: flex; flex-direction: column; line-height: 1; }
.login-brand strong { color: white; font-size: 21px; }
.login-brand small { margin-top: 6px; color: var(--ls-muted); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }
.login-hero-copy { position: relative; z-index: 1; max-width: 660px; }
.eyebrow { color: #75DFFF; font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow i { margin-right: 5px; }
.login-hero h1 { margin: 20px 0; color: white; font-size: clamp(42px, 5.5vw, 76px); line-height: 1.03; letter-spacing: -.055em; }
.login-hero h1 span { background: linear-gradient(90deg, #5CAEFF, var(--ls-cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero-copy > p { max-width: 570px; color: var(--ls-text-2); font-size: clamp(16px, 1.6vw, 20px); }
.login-features { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.login-features span { padding: 8px 11px; border: 1px solid var(--ls-border); border-radius: 999px; background: rgba(255,255,255,.045); color: var(--ls-text-2); font-size: 11px; }
.login-features i { color: var(--ls-cyan); margin-right: 5px; }
.login-copyright { position: relative; z-index: 1; color: #6179AC; font-size: 11px; }
.login-panel { display: grid; place-items: center; padding: clamp(20px, 5vw, 72px); background: linear-gradient(145deg, #071631, #06142E); }
body.login-page .login-card {
    width: min(100%, 440px); height: auto; padding: clamp(24px, 4vw, 38px);
    border: 1px solid var(--ls-border); border-radius: 24px;
    background: linear-gradient(145deg, rgba(18,38,80,.75), rgba(14,28,61,.88));
    backdrop-filter: blur(24px); color: var(--ls-text-2); box-shadow: var(--ls-shadow);
}
.login-card-heading { margin-bottom: 26px; }
.login-card-heading h2 { margin: 7px 0 6px; color: white; font-size: clamp(24px, 3vw, 31px); line-height: 1.15; letter-spacing: -.035em; text-align: left; }
.login-card-heading > p:last-child { margin: 0; color: var(--ls-muted); font-size: 13px; }
.mobile-login-logo { display: none; }
body.login-page .login-card input { min-height: 50px; margin: 0; padding-left: 43px; border: 1px solid var(--ls-border); background: rgba(3,13,34,.55); color: white; }
.input-with-icon { position: relative; }
.input-with-icon > i { position: absolute; left: 15px; bottom: 17px; z-index: 1; color: var(--ls-muted); }
.password-wrapper input { padding-right: 48px !important; }
body.login-page .toggle-password {
    position: absolute; width: 38px; height: 38px; right: 6px; bottom: 6px; top: auto;
    display: grid; place-items: center; transform: none; margin: 0; padding: 0;
    border: 0; background: transparent; box-shadow: none; color: var(--ls-muted);
}
body.login-page .login-submit { width: 100%; min-height: 52px; justify-content: space-between; margin-top: 8px; padding-inline: 18px; }
.login-security { margin: 20px 0 0; color: #6279A8; text-align: center; font-size: 10px; }
.login-security i { margin-right: 5px; }
body.login-page .message { background: rgba(239,68,68,.1); color: #FFB4B4; border-color: rgba(239,68,68,.2); font-size: 12px; text-align: left; }
body.login-page .message.success { color: #8DF0AF; }

/* Toasts and PWA */
.toast-region { position: fixed; right: 18px; top: calc(var(--ls-topbar) + 16px); z-index: 30000; width: min(380px, calc(100vw - 32px)); display: grid; gap: 9px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--ls-border); border-radius: 14px; background: rgba(14,28,61,.96); color: white; box-shadow: var(--ls-shadow); backdrop-filter: blur(18px); animation: toastIn .25s ease both; }
.toast > i { color: var(--ls-info); }.toast-success > i { color: var(--ls-success); }.toast-error > i { color: var(--ls-danger); }
.toast span { flex: 1; font-size: 13px; }.toast button { border: 0; background: transparent; color: var(--ls-muted); cursor: pointer; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.ios-install-hint { bottom: calc(82px + env(safe-area-inset-bottom)); background: rgba(14,28,61,.97); border: 1px solid var(--ls-border); border-radius: 14px; box-shadow: var(--ls-shadow); }
.mobile-bottom-nav { display: none; }

@media (max-width: 1100px) {
    .topbar-date, .profile-copy { display: none; }
    .topbar-search { width: min(380px, 42vw); }
    :root { --ls-sidebar: 238px; }
}

@media (max-width: 768px) {
    :root { --ls-topbar: 62px; --ls-sidebar: 286px; }
    body.app-shell { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .topbar { height: var(--ls-topbar); padding: 0 12px; }
    .menu-btn { display: inline-grid; }
    .topbar-brand img { width: 32px; height: 32px; }
    .topbar-brand small, .fullscreen-btn, .notification-btn, .profile-chip, .topbar-search kbd { display: none; }
    .topbar-search {
        order: 3; width: auto; flex: 1; height: 38px; padding-inline: 10px;
    }
    .topbar-search input { font-size: 16px; }
    .topbar-right { gap: 6px; }
    .layout { min-height: calc(100dvh - var(--ls-topbar)); height: auto; }
    .sidebar {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 10000; height: 100dvh;
        transform: translateX(-104%); pointer-events: none; transition: transform .24s cubic-bezier(.2,.8,.2,1);
        padding-top: calc(16px + env(safe-area-inset-top));
    }
    .sidebar.open { transform: translateX(0); pointer-events: auto; }
    .sidebar-overlay { display: block; opacity: 0; visibility: hidden; background: rgba(0,5,24,.68); transition: .2s ease; }
    .sidebar-overlay.active { opacity: 1; visibility: visible; }
    .content, .pos-wrapper { width: 100%; padding: 18px 14px 24px; height: auto; overflow: visible; }
    .page-title, .pos-title, .content > h1, .content > h2 { margin-bottom: 18px; font-size: 26px; }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .dashboard-grid .card { min-height: 124px; aspect-ratio: auto; padding: 14px; align-items: flex-start; text-align: left; }
    .dashboard-grid .card h3 { font-size: clamp(20px, 6vw, 27px); overflow-wrap: anywhere; }
    .dashboard-grid .card p { font-size: 10px; }
    .pos-top { grid-template-columns: 1fr; padding: 14px; }
    .pos-grid { grid-template-columns: 1fr; gap: 14px; }
    .pos-summary { position: static; order: 2; }
    .pos-summary .submit { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 20; }
    .pos-item-card { padding: 14px; }
    .two-col, .user-grid, .form-row { grid-template-columns: 1fr; }
    .users-header, .stores-header, .products-header { align-items: stretch; gap: 12px; }

    .mobile-bottom-nav {
        position: fixed; display: grid; grid-template-columns: repeat(5, 1fr);
        left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 9000;
        min-height: 61px; padding: 6px; border: 1px solid var(--ls-border); border-radius: 18px;
        background: rgba(9,25,57,.94); box-shadow: 0 18px 48px rgba(0,5,24,.55);
        backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    }
    .mobile-bottom-nav a, .mobile-bottom-nav button {
        min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        border: 0; border-radius: 12px; background: transparent; color: var(--ls-muted); font-size: 9px; font-weight: 650;
    }
    .mobile-bottom-nav i { font-size: 16px; }
    .mobile-bottom-nav a.active { background: rgba(0,123,255,.14); color: #75DFFF; }
    .toast-region { top: 74px; right: 12px; width: calc(100vw - 24px); }

    /* Convert data tables to labeled cards without horizontal scrolling. */
    table.mobile-cards, table.mobile-cards tbody, table.mobile-cards tr, table.mobile-cards td { display: block; width: 100%; }
    table.mobile-cards { background: transparent; overflow: visible; }
    table.mobile-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    table.mobile-cards tr { margin-bottom: 12px; padding: 8px 13px; border: 1px solid var(--ls-border); border-radius: 15px; background: linear-gradient(145deg, rgba(18,38,80,.86), rgba(14,28,61,.94)); box-shadow: 0 12px 30px rgba(0,5,24,.18); }
    table.mobile-cards td { min-height: 38px; padding: 9px 0; display: grid; grid-template-columns: minmax(90px, .75fr) minmax(0, 1.25fr); gap: 10px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.055); text-align: right; overflow-wrap: anywhere; }
    table.mobile-cards td:last-child { border-bottom: 0; }
    table.mobile-cards td::before { content: attr(data-label); color: var(--ls-muted); font-size: 10px; font-weight: 750; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
    table.mobile-cards td[colspan] { display: block; text-align: center; }

    .login-wrapper { display: block; min-height: 100dvh; }
    .login-hero { display: none; }
    .login-panel { min-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
    body.login-page .login-card { padding: 24px 20px; border-radius: 22px; }
    .mobile-login-logo { display: inline-block; margin-bottom: 18px; }
    .mobile-login-logo img { border-radius: 14px; box-shadow: 0 12px 28px rgba(0,123,255,.28); }
}

@media (max-width: 390px) {
    .topbar-brand span { display: none; }
    .dashboard-grid { gap: 9px; }
    .dashboard-grid .card { min-height: 116px; padding: 12px; }
    .content, .pos-wrapper { padding-inline: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}