/* =========================================
   0. OFFLINE FONTS (Inter)
   ========================================= */
/* inter-400 - latin */
@font-face {
   font-family: 'Inter';
   font-style: normal;
   font-weight: 400;
   src: url('../fonts/inter-v20-latin-regular.woff2') format('woff2');
 }
 /* inter-500 - latin */
 @font-face {
   font-family: 'Inter';
   font-style: normal;
   font-weight: 500;
   src: url('../fonts/inter-v20-latin-500.woff2') format('woff2');
 }
 /* inter-600 - latin */
 @font-face {
   font-family: 'Inter';
   font-style: normal;
   font-weight: 600;
   src: url('../fonts/inter-v20-latin-600.woff2') format('woff2');
 }
 /* inter-700 - latin */
 @font-face {
   font-family: 'Inter';
   font-style: normal;
   font-weight: 700;
   src: url('../fonts/inter-v20-latin-700.woff2') format('woff2');
 }

 /* ADD THIS TO THE TOP OF YOUR CSS FILE */
 html, body {
   width: 100%;
   height: 100%;
   margin: 0;
   padding: 0;
   overflow-x: hidden;  /* STOPS side scrolling */
   overflow-y: auto;    /* ENABLES scrolling down */
}

/* =========================================
   1. CORE & LAYOUT
   ========================================= */
   * { box-sizing: border-box; margin: 0; padding: 0; }
   body { font-family: 'Inter', sans-serif; background-color: #f4f7fe; color: #2b3674; display: flex; height: 100vh; overflow-x: hidden; transition: 0.3s; }
   
   /* Sidebar */
   .sidebar { width: 280px; background-color: #ffffff; height: 100%; padding: 30px 20px; display: flex; flex-direction: column; border-right: 1px solid #e0e0e0; flex-shrink: 0; transition: 0.3s; }
   .logo-area { text-align: center; margin-bottom: 50px; }
   .logo-area img { width: 80px; margin-bottom: 10px; }
   .logo-area h1 { font-size: 18px; font-weight: 700; color: #476eef; }
   .nav-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
   .nav-item { display: flex; align-items: center; gap: 15px; padding: 12px 15px; border-radius: 12px; color: #a3aed0; cursor: pointer; transition: 0.2s; font-size: 15px; font-weight: 500; }
   .nav-item:hover { background-color: #f4f7fe; color: #476eef; transform: translateX(5px); }
   .nav-item.active { background-color: #476eef; color: white; box-shadow: 0 5px 15px rgba(71, 110, 239, 0.3); }
   .nav-footer { margin-top: auto; }
   
   /* Main Content */
   .main-content {
      margin-left: 250px;           /* Pushes content right of the sidebar */
      width: calc(100% - 250px);    /* Calculates remaining width exactly */
      padding: 30px;
      min-height: 100vh;            /* Ensures it covers at least the full screen */
      height: auto;                 /* Allows it to grow taller than the screen so you can scroll */
      box-sizing: border-box;
      overflow: visible;            /* Ensures content isn't clipped */
  }
   header { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; }
   header h2 { font-size: 30px; font-weight: 700; color: #2b3674; margin-bottom: 5px; }
   header p { color: #707eae; font-size: 14px; }
   .user-badge { background: white; padding: 8px 15px; border-radius: 30px; display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); font-weight: 600; color: #2b3674; }
   .user-badge i { color: #476eef; }
   
   /* =========================================
      2. CONTROLS & INPUTS
      ========================================= */
   .controls-container { background: white; padding: 15px 20px; border-radius: 20px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); flex-wrap: wrap; gap: 15px; }
   .search-wrapper { display: flex; align-items: center; gap: 10px; background-color: #f4f7fe; padding: 12px 20px; border-radius: 30px; width: 350px; border: 1px solid transparent; transition: 0.3s; }
   .search-wrapper:focus-within { border-color: #476eef; background-color: #fff; }
   .search-wrapper input { border: none; background: transparent; outline: none; width: 100%; font-size: 14px; color: #2b3674; }
   .search-wrapper i, .search-box i { color: #a3aed0; }
   
   .action-buttons { display: flex; gap: 15px; }
   
   /* Buttons */
   .btn-filter, .date-btn { padding: 10px 20px; border-radius: 12px; border: 1px solid #e0e0e0; background: white; color: #2b3674; font-weight: 600; cursor: pointer; transition: 0.2s; }
   .btn-filter:hover, .date-btn:hover { border-color: #476eef; color: #476eef; }
   .date-btn.active { background: #476eef; color: white; border-color: #476eef; }
   
   .btn-add { background: linear-gradient(135deg, #476eef 0%, #3b5bdb 100%); color: white; border: none; padding: 12px 25px; border-radius: 12px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 10px rgba(71, 110, 239, 0.3); transition: 0.3s; display: flex; align-items: center; gap: 8px; }
   .btn-add:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(71, 110, 239, 0.4); }
   
   .btn-save { padding: 12px 25px; background-color: #476eef; color: white; border: none; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px rgba(71, 110, 239, 0.3); }
   .btn-outline { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border: 2px solid #f4f7fe; background: transparent; color: #2b3674; border-radius: 12px; font-weight: 600; cursor: pointer; transition: 0.2s; text-decoration: none; font-size: 14px; }
   .btn-danger { padding: 12px 20px; background-color: #fff0ee; color: #ee5d50; border: none; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; }
   .btn-warning { 
      padding: 12px 25px; 
      background-color: #f59e0b; /* Orange to match the icon */
      color: white; 
      border: none; 
      border-radius: 12px; 
      font-size: 14px; 
      font-weight: 600; 
      cursor: pointer; 
      transition: 0.2s; 
      box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
      flex: 1; /* Ensures it matches the width of the Cancel button */
  }
  
  .btn-warning:hover { 
      background-color: #d97706; 
      transform: translateY(-2px); 
      box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4);
  }
   /* =========================================
      3. TABLES & DATA
      ========================================= */
   .table-container { background: white; border-radius: 20px; padding: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); overflow: hidden; }
   table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
   th { text-align: left; padding: 15px; color: #a3aed0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #f0f0f0; }
   tr.data-row { transition: 0.2s; }
   tr.data-row:hover { transform: scale(1.005); background-color: #f8f9ff; }
   td { padding: 15px; font-size: 14px; font-weight: 600; color: #2b3674; background: white; border-top: 1px solid #f4f7fe; border-bottom: 1px solid #f4f7fe; }
   td:first-child { border-left: 1px solid #f4f7fe; border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
   td:last-child { border-right: 1px solid #f4f7fe; border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
   
   /* =========================================
      4. BADGES
      ========================================= */
   .status-badge, .stock-badge, .role-badge, .stat-badge, .log-badge, .type-badge { padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; display: inline-block; }
   
   /* Colors */
   .in-stock, .completed, .active-supp, .badge-green, .badge-sold, .log-login, .badge-delivered, .role-active { background: rgba(5, 205, 153, 0.1); color: #05cd99; }
   .low-stock, .pending, .log-update, .icon-orange, .badge-pending { background: rgba(255, 181, 71, 0.1); color: #ffb547; }
   .out-stock, .cancelled, .inactive-supp, .badge-red, .log-delete, .icon-red, .badge-cancelled, .role-inactive { background: rgba(238, 93, 80, 0.1); color: #ee5d50; }
   .in-progress, .corporate, .log-create, .icon-blue, .role-admin, .status-pill.progress { background: rgba(71, 110, 239, 0.1); color: #476eef; }
   .badge-returned { background: rgba(238, 93, 80, 0.2); color: #ee5d50; text-decoration: none !important; }
   .personal { background-color: #f4f7fe; color: #a3aed0; }
   .role-manager { background: #f2e8ff; color: #7209B7; }
   .role-sales { background: #fff8e6; color: #ffb547; }
   .prod-badge { background: #fff8e6; color: #f59e0b; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; }
   
   /* =========================================
      5. ACTION BUTTONS (Icons)
      ========================================= */
   .action-group { display: flex; gap: 10px; align-items: center; }
   .action-btn, .receipt-btn, .return-btn { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; border: none; }
   
   .edit-btn { color: #476eef; background: rgba(71, 110, 239, 0.1); } .edit-btn:hover { background: #476eef; color: white; }
   .print-btn, .receipt-btn, .hist-btn { color: #7209B7; background: rgba(114, 9, 183, 0.1); } .print-btn:hover, .receipt-btn:hover, .hist-btn:hover { background: #7209B7; color: white; }
   .archive-btn, .return-btn { color: #f59e0b; background: rgba(245, 158, 11, 0.1); } .archive-btn:hover, .return-btn:hover { background: #f59e0b; color: white; }
   .restore-btn, .mark-btn, .history-btn { color: #05cd99; background: rgba(5, 205, 153, 0.1); } .restore-btn:hover, .mark-btn:hover, .history-btn:hover { background: #05cd99; color: white; }
   .delete-btn { color: #ee5d50; background: rgba(238, 93, 80, 0.1); } .delete-btn:hover { background: #ee5d50; color: white; }
   
   /* =========================================
      6. MODALS & FORMS
      ========================================= */
   .modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(11, 20, 55, 0.6); backdrop-filter: blur(5px); overflow: auto; animation: fadeIn 0.3s; }
   .modal-content { background-color: #ffffff; margin: 5vh auto; padding: 40px; border-radius: 25px; width: 90%; max-width: 550px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); position: relative; animation: slideUp 0.4s; }
   .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
   .modal-header h2, .modal-header h3 { font-size: 22px; font-weight: 700; color: #2b3674; margin:0; }
   .close-btn { font-size: 24px; color: #a3aed0; cursor: pointer; transition: 0.2s; }
   .close-btn:hover { color: #ee5d50; transform: rotate(90deg); }
   
   .form-group { margin-bottom: 20px; }
   .form-group label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #6e7998; }
   /* Standard input styles */
   .form-group input, .form-group select, .form-group textarea, .status-select { width: 100%; padding: 14px; border: 2px solid #f4f7fe; border-radius: 12px; font-size: 14px; color: #2b3674; background-color: #f9faff; transition: 0.2s; font-family: 'Inter', sans-serif; }
   .status-select{ width: 8%; }
   .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #476eef; background-color: #fff; outline: none; }
   .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
   .form-group.full-width { width: 100%; }
   
   .modal-footer { display: flex; gap: 15px; margin-top: 10px; }
   .btn-cancel { flex: 1; padding: 12px; background: #f4f7fe; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; color: #a3aed0; }
   .btn-confirm { flex: 2; padding: 12px; background: #476eef; color: white; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; }
   
   /* Delete/Alert Content */
   .delete-content { text-align: center; max-width: 380px; padding: 40px 30px; }
   .icon-box, .delete-icon { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 40px; margin: 0 auto 20px auto; animation: popIn 0.3s; }
   .delete-title { font-size: 20px; font-weight: 700; color: #2b3674; margin-bottom: 10px; }
   .delete-text { font-size: 14px; color: #a3aed0; margin-bottom: 30px; line-height: 1.5; }
   
   .btn-archive-confirm { background-color: #f59e0b; color: white; border: none; padding: 12px 25px; border-radius: 12px; font-weight: 600; cursor: pointer; flex: 1; }
   .btn-restore-confirm { background-color: #05cd99; color: white; border: none; padding: 12px 25px; border-radius: 12px; font-weight: 600; cursor: pointer; flex: 1; }
   
   /* =========================================
      7. POPUPS (Success/Error/Toast)
      ========================================= */
   .success-popup, .error-popup { display: none; position: fixed; z-index: 3000; left: 50%; top: 50%; transform: translate(-50%, -50%); background: white; padding: 30px 50px; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); text-align: center; animation: popIn 0.4s; flex-direction: column; align-items: center; gap: 15px; min-width: 300px; }
   .error-popup { border: 2px solid #ee5d50; }
   .success-icon, .error-icon { font-size: 50px; margin-bottom: 10px; }
   .success-icon { color: #05cd99; } .error-icon { color: #ee5d50; }
   .success-title, .error-title { font-size: 18px; font-weight: 700; color: #2b3674; }
   .success-text, .error-text { font-size: 14px; color: #a3aed0; }
   .toast { visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center; border-radius: 8px; padding: 12px; position: fixed; z-index: 3000; left: 50%; bottom: 30px; transform: translateX(-50%); font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); opacity: 0; transition: opacity 0.3s, bottom 0.3s; }
   .toast.show { visibility: visible; opacity: 1; bottom: 50px; }
   
   /* =========================================
      8. PAGE SPECIFIC (Dashboard, Settings, Reports)
      ========================================= */
   /* Dashboard */
   .dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
   .card, .kpi-card { background: white; border-radius: 20px; padding: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); transition: 0.3s; }
   .card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.06); }
   .stat-card { display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
   .stat-icon-bg { position: absolute; right: -10px; top: -10px; font-size: 80px; opacity: 0.05; color: #476eef; transform: rotate(15deg); }
   .stat-title { font-size: 14px; color: #a3aed0; font-weight: 500; margin-bottom: 10px; }
   .stat-value { font-size: 28px; font-weight: 700; color: #2b3674; margin-bottom: 10px; }
   .chart-section { grid-column: span 3; min-height: 350px; }
   .category-section { grid-column: span 1; }
   .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
   .recent-builds, .stock-alerts { grid-column: span 2; }
   .list-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #f4f7fe; }
   .view-link { font-size: 13px; color: #476eef; text-decoration: none; font-weight: 600; }
   .view-link:hover { text-decoration: underline; }
   .item-info h4 { font-size: 15px; font-weight: 600; color: #2b3674; margin-bottom: 3px; }
   .item-info p { font-size: 13px; color: #a3aed0; }
   .status-pill { padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
   .status-pill.progress { background-color: rgba(71, 110, 239, 0.1); color: #476eef; }
   .status-pill.completed { background-color: rgba(5, 205, 153, 0.1); color: #05cd99; }
   .status-pill.pending { background-color: rgba(255, 181, 71, 0.1); color: #ffb547; }
   .status-pill.cancelled { background-color: rgba(238, 93, 80, 0.1); color: #ee5d50; }
   .view-link { font-size: 13px; color: #476eef; text-decoration: none; font-weight: 600; }
   .view-link:hover { text-decoration: underline; }
   
   /* Settings */
   .settings-container { display: flex; gap: 30px; height: calc(100% - 100px); }
   .settings-nav { width: 250px; flex-shrink: 0; }
   .set-link { display: flex; align-items: center; gap: 12px; padding: 15px 20px; margin-bottom: 10px; background: white; border-radius: 12px; color: #a3aed0; font-weight: 600; cursor: pointer; transition: 0.2s; border: 1px solid transparent; }
   .set-link:hover, .set-link.active-tab { color: white; background: #476eef; }
   .set-link.active-tab { box-shadow: 0 4px 12px rgba(71, 110, 239, 0.3); }
   .settings-content { flex-grow: 1; background: white; border-radius: 20px; padding: 40px; overflow-y: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
   .tab-content { display: none; animation: fadeIn 0.3s; }
   .tab-content.active-content { display: block; }
   .section-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; border-bottom: 1px solid #f4f7fe; padding-bottom: 10px; display: flex; align-items: center; gap: 10px; }
   .user-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
   .user-table th { text-align: left; padding: 12px; color: #a3aed0; font-size: 12px; border-bottom: 1px solid #f4f7fe; }
   .user-table td { padding: 15px 12px; border-bottom: 1px solid #f4f7fe; font-size: 14px; color: #2b3674; font-weight: 600; }
   
   /* Reports */
   .kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-bottom: 30px; }
   .kpi-card { background: white; padding: 25px; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); display: flex; align-items: center; justify-content: space-between; }
   .kpi-info h3 { font-size: 14px; color: #a3aed0; font-weight: 500; margin-bottom: 8px; }
   .kpi-info h2 { font-size: 28px; font-weight: 700; color: #2b3674; }
   .kpi-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; }
   .icon-green {
      background-color: #d1e7dd;
      color: #1ab66d; /* Dark green text for contrast */
  }
   .chart-wrapper { background: white; padding: 25px; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); margin-bottom: 25px; }
   .chart-container { height: 320px !important; width: 100%; }
   .filters-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
   
   .date-toolbar { display: flex; align-items: center; gap: 5px; background: #f4f7fe; padding: 5px; border-radius: 12px; border: 1px solid #e0e0e0; }
   .custom-date-box { display: flex; align-items: center; background: white; border: 1px solid #e0e0e0; padding: 5px 15px; border-radius: 12px; height: 42px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); transition: 0.2s; }
   .custom-date-box:hover { border-color: #476eef; box-shadow: 0 4px 10px rgba(71, 110, 239, 0.1); }
   .clean-date-input { border: none; background: transparent; font-family: 'Inter', sans-serif; color: #2b3674; font-size: 13px; font-weight: 600; outline: none; cursor: pointer; width: 90px; }
   .date-separator { color: #a3aed0; margin: 0 10px; font-size: 12px; }
   
   /* Search Box */
   .search-box { display:flex; align-items:center; background:#f4f7fe; padding:0 15px; border-radius:12px; border:1px solid #e0e0e0; height:42px; transition: 0.2s; }
   .search-box:focus-within { border-color: #476eef; background: #fff; }
   .search-input { border:none; background:transparent; margin-left:10px; outline:none; font-weight:600; color:#2b3674; font-family:'Inter'; width: 150px; }
   
   .status-select { padding: 10px; border-radius: 12px; border: 1px solid #e0e0e0; background: #fff; color: #2b3674; font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer; outline: none; }
   .flatpickr-calendar { font-family: 'Inter', sans-serif; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.1); border: none; padding: 10px; }
   .flatpickr-months .flatpickr-month { color: #2b3674; fill: #2b3674; height: 50px; }
   .flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 700; }
   .flatpickr-weekdays .flatpickr-weekday { color: #a3aed0; font-weight: 600; font-size: 12px; }
   .flatpickr-day { color: #2b3674; font-weight: 500; border-radius: 10px; }
   .flatpickr-day.today { border-color: #476eef; color: #476eef; }
   .flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day:hover { background: #476eef; border-color: #476eef; color: white; }
   .btn-group { display: flex; gap: 10px; }
   .btn-print { padding: 0 20px; height: 42px; border-radius: 12px; border: 1px solid #e0e0e0; background: white; color: #2b3674; font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
   .btn-print:hover { border-color: #476eef; color: #476eef; }
   
   /* Custom Builds */
   .parts-table { width: 100%; border-collapse: collapse; margin-bottom: 15px; }
   .parts-table th { text-align: left; padding: 10px; background: #f4f7fe; color: #a3aed0; font-size: 12px; border-radius: 8px; }
   .parts-table td { padding: 10px 5px; border-bottom: 1px solid #f0f0f0; }
   .parts-table select, .parts-table input { width: 100%; padding: 8px; border: 1px solid #e0e0e0; border-radius: 8px; }
   .btn-sm-remove { color: #ee5d50; cursor: pointer; text-align: center; }
   
   /* =========================================
      9. ANIMATIONS & PRINT
      ========================================= */
   @keyframes popIn { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
   @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
   @keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
   
   @media print {
       .sidebar, .btn-add, .btn-print, header p, .user-badge, .date-toolbar, .receipt-btn, .return-btn, .status-select, .controls-container, .chart-wrapper { display: none !important; }
       .main-content { padding: 0; }
       body { background-color: white; height: auto; overflow: visible; }
       .table-container { box-shadow: none; border: 1px solid #ddd; }
   }
   
   /* =========================================
      10. DARK MODE
      ========================================= */
   body.dark-mode { background-color: #0b1437; color: #ffffff; }
   body.dark-mode .sidebar { background-color: #111c44; border-right: 1px solid #1f2b5e; }
   body.dark-mode .user-badge, body.dark-mode .controls-container, body.dark-mode .table-container, body.dark-mode .modal-content, body.dark-mode .settings-content, body.dark-mode .card, body.dark-mode .chart-wrapper { background-color: #111c44; color: white; box-shadow: none; border: 1px solid #1f2b5e; }
   body.dark-mode .logo-area h1, body.dark-mode header h2, body.dark-mode .section-title, body.dark-mode .modal-header h2, body.dark-mode .stat-value, body.dark-mode .kpi-info h2, body.dark-mode .card-header h3, body.dark-mode .success-title, body.dark-mode .delete-title { color: white; }
   body.dark-mode .nav-item { color: #8f9bba; }
   body.dark-mode .nav-item:hover, body.dark-mode .set-link.active-tab { background-color: #1b2559; color: white; }
   body.dark-mode .set-link { background: #111c44; color: #8f9bba; border: 1px solid #1f2b5e; }
   body.dark-mode input, body.dark-mode select, body.dark-mode textarea, body.dark-mode .search-box, body.dark-mode .custom-date-box { background-color: #0b1437; border-color: #2b3674; color: white; }
   body.dark-mode td { background-color: #111c44; color: white; border-color: #1f2b5e; }
   body.dark-mode th { background-color: #1b2559; color: #a3aed0; }
   body.dark-mode tr.data-row:hover { background-color: #1b2559; }
   body.dark-mode .btn-filter, body.dark-mode .btn-cancel, body.dark-mode .btn-outline { background-color: #1b2559; color: #8f9bba; border-color: #2b3674; }
   body.dark-mode .success-popup, body.dark-mode .error-popup { background-color: #111c44; border: 1px solid #1f2b5e; }
   body.dark-mode .delete-icon, body.dark-mode .icon-red { background-color: #2b1212; }
   body.dark-mode .icon-orange { background-color: #3a2e0b; }
   body.dark-mode .list-item, body.dark-mode .user-table th, body.dark-mode .user-table td { border-bottom-color: #1f2b5e; }
   body.dark-mode .date-btn.active { background: #1b2559; color: white; border-color: #2b3674; }
   body.dark-mode .flatpickr-calendar { background: #111c44; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
   body.dark-mode .flatpickr-months .flatpickr-month, body.dark-mode .flatpickr-day { color: white; fill: white; }
   body.dark-mode .flatpickr-day:hover { background: #1b2559; }
   body.dark-mode .search-wrapper { background-color: #0b1437; }
   body.dark-mode .search-wrapper input, body.dark-mode .clean-date-input, body.dark-mode .search-input { color: white; }
   body.dark-mode .item-info h4 { color: white; }
   body.dark-mode header p, body.dark-mode .kpi-info h3, body.dark-mode .date-separator { color: #8f9bba; }
   body.dark-mode .clean-date-input::-webkit-calendar-picker-indicator { filter: invert(1); }
   
/* =========================================
      11. MOBILE & TABLET OPTIMIZATION
      ========================================= */
      @media (max-width: 1024px) {
         /* 1. Hide Sidebar by Default */
         .sidebar { 
             position: fixed; 
             left: -280px;        /* Move completely off-screen */
             top: 0;
             height: 100vh;
             z-index: 2000;       /* Ensure it's on top of everything */
             transition: 0.3s; 
             box-shadow: none;
         }
  
         /* 2. Show Sidebar when Active (You'll need a toggle button) */
         .sidebar.active { 
             left: 0; 
             box-shadow: 5px 0 50px rgba(0,0,0,0.2); 
         }
  
         /* 3. Main Content takes Full Width */
         .main-content { 
             margin-left: 0;      /* Remove the 250px margin */
             width: 100%;         /* Use full screen width */
             padding: 15px; 
         }
  
         /* 4. Adjust Grid Layouts for Phone */
         .stats-container { grid-template-columns: 1fr; } /* Stack cards */
         .content-grid { grid-template-columns: 1fr; }
         .kpi-grid { grid-template-columns: 1fr; }
         
         /* 5. Allow tables to scroll sideways if too big */
         .table-container { overflow-x: auto; }
         
         /* 6. Settings Navigation Scrollable */
         .settings-container { flex-direction: column; }
         .settings-nav { width: 100%; overflow-x: auto; padding-bottom: 10px; }
     }
   
   /* =========================================
      11. AUTHENTICATION PAGES (Login, Forgot, Reset)
      ========================================= */
   /* Specific layout for Login/Auth pages to avoid conflict with Dashboard */
   .login-section { width: 50%; background-color: #ffffff; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; position: relative; }
   .login-wrapper { width: 100%; max-width: 400px; }
   .brand-header { margin-bottom: 40px; text-align: center; }
   .brand-header img { width: 60px; margin-bottom: 10px; }
   .project-title { font-size: 24px; font-weight: 700; color: #476eef; margin-bottom: 20px; }
   .brand-header h1 { font-size: 28px; font-weight: 700; color: #2b3674; margin-bottom: 5px; }
   .brand-header p { color: #a3aed0; font-size: 14px; }
   
   /* Auth Input Styling Override */
   .login-wrapper .form-group input { width: 100%; padding: 14px 14px 14px 45px; border: 2px solid #f4f7fe; border-radius: 16px; font-size: 14px; color: #2b3674; transition: 0.3s; background-color: #fff; }
   .login-wrapper .form-group input:focus { border-color: #476eef; outline: none; }
   .input-wrapper { position: relative; }
   .input-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #a3aed0; font-size: 16px; }
   .toggle-password, .toggle-icon { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #a3aed0; cursor: pointer; }
   .toggle-password:hover { color: #476eef; }
   
   /* Auth Buttons */
   .btn-login { width: 100%; padding: 15px; background-color: #476eef; color: white; border: none; border-radius: 16px; font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.3s; margin-top: 10px; box-shadow: 0 4px 12px rgba(71, 110, 239, 0.3); }
   .btn-login:hover { background-color: #3b5bdb; transform: translateY(-2px); }
   .btn-login:disabled { background-color: #a3aed0; cursor: not-allowed; transform: none; }
   
   .error-message { background-color: #fff0ee; color: #ee5d50; padding: 12px; border-radius: 12px; font-size: 13px; margin-bottom: 20px; display: none; text-align: center; border: 1px solid #ffe5e5; }
   .footer { margin-top: 30px; text-align: center; font-size: 12px; color: #a3aed0; }
   
   /* Visual Section (Right Side) */
   .visual-section { width: 50%; background-image: url('../img/pcbuild1.jpg'); background-size: cover; background-position: center; display: flex; justify-content: center; align-items: center; position: relative; overflow: hidden; }
   .visual-section::before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(11, 20, 55, 0.65); z-index: 1; }
   .showcase-text { text-align: center; color: white; z-index: 10; padding: 40px; }
   .showcase-text h2 { font-size: 36px; font-weight: 700; margin-bottom: 10px; }
   .showcase-text p { font-size: 16px; opacity: 0.8; line-height: 1.6; }
   .circle { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.1); }
   .c1 { width: 300px; height: 300px; top: -50px; right: -50px; }
   .c2 { width: 500px; height: 500px; bottom: -100px; left: -100px; }
   
   @media (max-width: 900px) {
      .visual-section { display: none; }
       login-section { width: 100%; }
   }
   
   /* Forgot & Reset Password Specifics (Targeting body > .card) */
   body > .card { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); width: 100%; max-width: 400px; text-align: center; }
   body > .card h2 { color: #2b3674; margin-bottom: 20px; }
   body > .card p { color: #a3aed0; font-size: 14px; margin-bottom: 20px; }
   body > .card input { width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 10px; margin-bottom: 15px; box-sizing: border-box; }
   body > .card .input-group input { padding-right: 40px; margin-bottom: 0; }
   body > .card .input-group { margin-bottom: 15px; }
   body > .card button { width: 100%; padding: 12px; background: #476eef; color: white; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; }
   body > .card button:hover { background: #3b5bdb; }
   .back { display: block; margin-top: 15px; color: #a3aed0; text-decoration: none; font-size: 13px; }
   .back:hover { color: #476eef; }

   /* --- LAYOUT STYLES --- */
   .stats-container {
      display: grid;
      grid-template-columns: repeat(5, 1fr); /* 5 Columns */
      gap: 20px;
      margin-bottom: 20px;
   }

   .content-grid {
      display: grid;
      grid-template-columns: 2fr 1fr; 
      grid-template-rows: auto auto;
      gap: 20px;
   }

   .stat-card {
      padding: 20px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-height: 140px; 
      }

   /* --- BADGE COLORS (Added Orange) --- */
   .badge-green { background: rgba(5, 205, 153, 0.1); color: #05cd99; padding: 5px 10px; border-radius: 5px; font-weight: 600; font-size: 12px; display: inline-block; }
   .badge-red { background: rgba(238, 93, 80, 0.1); color: #ee5d50; padding: 5px 10px; border-radius: 5px; font-weight: 600; font-size: 12px; display: inline-block; }
        
   /* NEW: Orange Badge for Pending */
   .badge-orange { 
      background: rgba(255, 181, 71, 0.15); 
      color: #ffb547; 
      padding: 5px 10px; 
      border-radius: 5px; 
      font-weight: 600; 
      font-size: 12px; 
      display: inline-block; 
   }

   /* --- GRID AREAS --- */
   .chart-section { grid-column: 1 / 2; grid-row: 1 / 2; } 
   .category-section { grid-column: 2 / 3; grid-row: 1 / 2; } 
   .recent-builds { grid-column: 1 / 2; grid-row: 2 / 3; } 
   .stock-alerts { grid-column: 2 / 3; grid-row: 2 / 3; } 

   @media (max-width: 1400px) { .stats-container { grid-template-columns: repeat(3, 1fr); } }
   @media (max-width: 900px) {
      .stats-container { grid-template-columns: 1fr 1fr; }
      .content-grid { grid-template-columns: 1fr; }
      .chart-section, .category-section, .recent-builds, .stock-alerts { grid-column: auto; grid-row: auto; }
   }

        /* --- SPEED DIAL --- */
   .fab-container { position: fixed; bottom: 30px; right: 30px; z-index: 1000; display: flex; flex-direction: column-reverse; align-items: center; gap: 15px; }
   .fab-main { width: 60px; height: 60px; background: #476eef; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 4px 15px rgba(71, 110, 239, 0.4); cursor: pointer; transition: transform 0.3s; }
   .fab-container:hover .fab-main { transform: rotate(45deg); background: #3b5bdb; }
   .fab-action { display: flex; align-items: center; gap: 10px; justify-content: flex-end; opacity: 0; transform: translateY(20px) scale(0.8); transition: 0.3s; pointer-events: none; position: absolute; bottom: 70px; }
   .fab-container:hover .fab-action { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; position: relative; bottom: auto; }
   .fab-container:hover .fab-action:nth-child(2) { transition-delay: 0.05s; }
   .fab-container:hover .fab-action:nth-child(3) { transition-delay: 0.1s; }
   .fab-container:hover .fab-action:nth-child(4) { transition-delay: 0.15s; }
   .fab-btn { width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; text-decoration: none; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
   .fab-label { background: rgba(0,0,0,0.8); color: white; padding: 5px 10px; border-radius: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
   .btn-green { background: #05cd99; } .btn-blue { background: #476eef; } .btn-orange { background: #ffb547; }

   /* Restock Modal Styles */
   .restock-list { max-height: 300px; overflow-y: auto; margin-top: 10px; border: 1px solid #eee; border-radius: 8px; }
   .restock-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid #f4f7fe; }
   .restock-item:last-child { border-bottom: none; }
   .restock-info h4 { margin: 0; font-size: 14px; color: #2b3674; }
   .restock-action { display: flex; gap: 5px; align-items: center; }
   .qty-input { width: 60px; padding: 5px; border: 1px solid #ccc; border-radius: 4px; text-align: center; font-weight: 700; }
   .btn-quick-order { background: #476eef; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }
   .btn-quick-order:hover { background: #3b5bdb; }
   
    /* Icon Colors */
   .icon-blue { background: rgba(71, 110, 239, 0.1); color: #476eef; }

   /* Confirmation Text */
   .conf-summary { background: #f8f9fc; padding: 15px; border-radius: 8px; margin: 15px 0; text-align: left; font-size: 14px; }
   .conf-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
   .conf-total { border-top: 1px dashed #ccc; margin-top: 5px; padding-top: 5px; font-weight: 800; color: #476eef; font-size: 16px; }

   /* =========================================
   PREMIUM CUSTOMER PORTAL STYLES
   ========================================= */

/* Sidebar Logo Fix */
.sidebar .brand-icon {
   width: 45px; height: 45px; display: flex; align-items: center; 
   justify-content: center; background: #f4f7fe; border-radius: 12px; padding: 5px;
}
.sidebar .brand-icon img { width: 100%; height: 100%; object-fit: contain; }

/* Global Premium Header (Fixes the unstyled text!) */
.main-content .header {
   display: flex; justify-content: space-between; align-items: center;
   margin-bottom: 30px; background: white; padding: 15px 30px;
   border-radius: 16px; box-shadow: 0 5px 20px rgba(0,0,0,0.02);
   border: 1px solid #f4f7fe;
}
.main-content .header-title {
   font-size: 24px; font-weight: 800; color: #111c44; letter-spacing: -0.5px; margin: 0;
}
.main-content .user-profile { display: flex; align-items: center; gap: 15px; }
.main-content .user-info { text-align: right; }
.main-content .user-name { font-weight: 700; color: #2b3674; font-size: 15px; text-transform: capitalize; }
.main-content .user-role {
   font-size: 12px; color: #476eef; font-weight: 700; background: #e0e7ff;
   padding: 3px 8px; border-radius: 6px; display: inline-block; margin-top: 3px;
}

/* ==========================================
   MODERN TOAST NOTIFICATIONS
   ========================================== */
   #toast-container {
      position: fixed;
      bottom: 30px;
      right: 30px;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      gap: 10px;
  }
  
  .modern-toast {
      min-width: 300px;
      padding: 16px 24px;
      border-radius: 12px;
      background: #fff;
      color: #2b3674;
      font-weight: 600;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 15px;
      box-shadow: 0 10px 40px rgba(0,0,0,0.1);
      transform: translateX(120%); /* Start hidden off-screen */
      transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
      opacity: 0;
  }
  
  .modern-toast.show {
      transform: translateX(0); /* Slide in */
      opacity: 1;
  }
  
  /* Toast Variants */
  .toast-success { border-left: 6px solid #05cd99; }
  .toast-success i { color: #05cd99; font-size: 20px; }
  
  .toast-error { border-left: 6px solid #ee5d50; }
  .toast-error i { color: #ee5d50; font-size: 20px; }
  
  .toast-warning { border-left: 6px solid #f57f17; }
  .toast-warning i { color: #f57f17; font-size: 20px; }
