 :root {
      --primary: #D40000;
      --secondary: #ffaa0b;
      --bg: #ffffff;
      --card: #f7f7f7;
      --muted: #8b93a7;
      --text: #222;
      --success: #2ecc71;
      --warning: #f1c40f;
      --danger: #e74c3c;
      --radius: 16px;
      --ring: 0 0 0 2px rgba(212, 0, 0, .25);
      --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
      --glass: rgba(0, 0, 0, 0.03);
      --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
      --sidebar-w: 280px;
      --sidebar-w-collapsed: 86px;
      --transition-fast: 160ms cubic-bezier(.2, .65, .3, 1);
      --transition-slow: 360ms cubic-bezier(.2, .65, .3, 1);
    }

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

    html,
    body {
      height: 100%
    }

    body {
      margin: 0;
      font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      color: var(--text);
      background: var(--bg);
      overflow: hidden;
    }

    /* Layout */
    .app {
      display: grid;
      grid-template-columns: var(--sidebar-w) 1fr;
      grid-template-rows: 72px 1fr;
      height: 100vh;
      transition: grid-template-columns var(--transition-slow);
    }

    .app.collapsed {
      grid-template-columns: var(--sidebar-w-collapsed) 1fr
    }

    /* Sidebar */
   
   

    /* Header */
    .header {
      background: rgb(243, 239, 239);
      border-bottom: 1px solid rgba(0, 0, 0, 0.06);
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 16px;
      position: sticky;
      top: 0;
      z-index: 3;
      backdrop-filter: blur(6px);
    }

    .header .toggle {
      width: 42px;
      height: 42px;
      border: none;
      border-radius: 12px;
      background: var(--gradient);
      color: white;
      cursor: pointer;
      display: grid;
      place-items: center;
      box-shadow: 0 8px 20px rgba(212, 0, 0, .18);
      transition: transform var(--transition-fast);
    }

    .header .toggle:hover {
      transform: translateY(-1px)
    }

    .header .title-wrap {
      display: grid;
      gap: 2px
    }

    .header .title {
      font-weight: 800;
      letter-spacing: .4px
    }

    .header .muted {
      color: var(--muted);
      font-size: 12px
    }

    .header .search {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 10px;
      background: rgba(0, 0, 0, 0.04);
      border: 1px solid rgba(0, 0, 0, 0.08);
      border-radius: 14px;
      padding: 6px 10px;
    }

    .header .search input {
      background: transparent;
      border: none;
      outline: none;
      color: var(--text);
      min-width: 200px
    }

    .header .pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(0, 0, 0, 0.04);
      border: 1px solid rgba(0, 0, 0, 0.08);
      font-size: 12px
    }

    .header .avatar {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--gradient)
    }

    /* Main */
    .main {
      padding: 20px;
      overflow-y: auto;
    }

    .grid {
      display: grid;
      grid-template-columns: repeat(12, 1fr);
      gap: 18px;
    }

    .card {
      background: var(--card);
      border-radius: var(--radius);
      padding: 18px;
    }

    .kpi {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .kpi .value {
      font-size: 24px;
      font-weight: 800;
    }

    .kpi .trend.up {
      color: var(--success);
    }

    .kpi .trend.down {
      color: var(--danger);
    }

    /* Page Header */
    .page-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
    }
    
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 12px 20px;
      border-radius: 12px;
      border: none;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
     
    }
    
    .btn-primary {
      background: #007bff;
      color: white;
      box-shadow: 0 4px 12px rgba(212, 0, 0, 0.25);
    }
    
    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(212, 0, 0, 0.3);
    }
    
    .btn-secondary {
      background: #f1f1f1;
      color: var(--text);
    }
    
    .btn-secondary:hover {
      background: #f35f04;
    }
    
    .btn-sm {
      padding: 8px 14px;
      font-size: 14px;
    }
    
    .btn-success {
      background: var(--success);
      color: white;
    }
    
    .btn-warning {
      background: var(--warning);
      color: white;
    }
    
    .btn-danger {
      background: var(--danger);
      color: white;
    }

    /* Table Styles */
    .table-container {
      background: white;
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    
    .table-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px 24px;
      border-bottom: 1px solid #eee;
    }
    
    .table-actions {
      display: flex;
      gap: 12px;
      align-items: center;
    }
    
    .table-search {
      display: flex;
      align-items: center;
      gap: 10px;
      background: rgba(0, 0, 0, 0.04);
      border: 1px solid rgba(0, 0, 0, 0.08);
      border-radius: 14px;
      padding: 8px 14px;
    }
    
    .table-search input {
      background: transparent;
      border: none;
      outline: none;
      color: var(--text);
      min-width: 200px;
    }
    
    table {
      width: 100%;
      border-collapse: collapse;
    }
    
    thead {
      background:#4a90e2;
    }
    
    th, td {
      padding: 16px 20px;
      text-align: left;
      border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
    
    tbody tr {
      transition: background var(--transition-fast);
    }
    
    tbody tr:hover {
      background: rgba(0, 0, 0, 0.02);
    }
    
    .status {
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
    }
    
    .status.active {
      background: rgba(46, 204, 113, 0.12);
      color: var(--success);
    }
    
    .status.inactive {
      background: rgba(231, 76, 60, 0.12);
      color: var(--danger);
    }
    
    .status.pending {
      background: rgba(241, 196, 15, 0.12);
      color: var(--warning);
    }
    
    .customer-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--gradient);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 600;
      font-size: 14px;
    }
    
    .action-buttons {
      display: flex;
      gap: 8px;
    }
    
    .action-btn {
      width: 32px;
      height: 32px;
      border: none;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .action-btn.view {
      background: rgba(52, 152, 219, 0.1);
      color: #3498db;
    }
    
    .action-btn.edit {
      background: rgba(241, 196, 15, 0.1);
      color: var(--warning);
    }
    
    .action-btn.delete {
      background: rgba(231, 76, 60, 0.1);
      color: var(--danger);
    }
    
    .action-btn:hover {
      transform: translateY(-1px);
    }
    
    .pagination {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px 24px;
      border-top: 1px solid #eee;
    }
    
    .pagination-info {
      color: var(--muted);
      font-size: 14px;
    }
    
    .pagination-controls {
      display: flex;
      gap: 8px;
    }
    
    .page-btn {
      width: 36px;
      height: 36px;
      border: 1px solid #ddd;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .page-btn.active {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }
    
    .page-btn:hover:not(.active) {
      border-color: var(--primary);
    }
    
    /* Stats Cards */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 18px;
      margin-bottom: 24px;
    }
    
    .stat-card {
      background: white;
      border-radius: var(--radius);
      padding: 20px;
      box-shadow: var(--shadow);
      display: flex;
      align-items: center;
      gap: 16px;
    }
    
    .stat-icon {
      width: 50px;
      height: 50px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
    }
    
    .stat-icon.primary {
      background: rgba(212, 0, 0, 0.1);
      color: var(--primary);
    }
    
    .stat-icon.success {
      background: rgba(46, 204, 113, 0.1);
      color: var(--success);
    }
    
    .stat-icon.warning {
      background: rgba(241, 196, 15, 0.1);
      color: var(--warning);
    }
    
    .stat-icon.info {
      background: rgba(52, 152, 219, 0.1);
      color: #3498db;
    }
    
    .stat-content h3 {
      font-size: 24px;
      font-weight: 800;
      margin-bottom: 4px;
    }
    
    .stat-content p {
      color: var(--muted);
      font-size: 14px;
    }

    /* Mobile Sidebar */
    .close-mobile {
      display: none;
      position: absolute;
      top: 16px;
      right: 16px;
      width: 36px;
      height: 36px;
      border: none;
      border-radius: 8px;
      background: var(--gradient);
      color: white;
      cursor: pointer;
      z-index: 10;
    }

    /* Responsive */
    @media (max-width: 860px) {
      .app {
        grid-template-columns: 1fr;
        grid-template-rows: 56px 1fr;
        height: 100vh;
      }
      
      .main {
        padding: 10px 4px 4px 4px;
      }
      .header {
        flex-wrap: wrap;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 8px 6px 6px 6px;
        min-height: unset;
      }
      .header .toggle {
        order: 1;
        align-self: flex-start;
        margin-bottom: 4px;
      }
      .header .title-wrap {
        order: 2;
        width: 100%;
        min-width: 0;
        margin-bottom: 2px;
      }
      .header .title {
        font-size: 1.15rem;
        word-break: break-word;
      }
      .header .muted {
        font-size: 0.97rem;
        word-break: break-word;
      }
      .header .pill {
        order: 3;
        margin-bottom: 4px;
        width: 100%;
        justify-content: flex-start;
      }
      .header .search {
        order: 4;
        width: 100%;
        margin: 0 0 4px 0;
        flex: unset;
      }
      .header .search input {
        width: 100%;
        min-width: 0;
      }
      .header .toggle#collapseToggle,
      .header .avatar,
      .header > div[style*="width:1px"],
      .header i.fa-bell {
        order: 5;
        margin-bottom: 4px;
        margin-right: 0;
      }
      .header .avatar {
        align-self: flex-end;
        margin-left: auto;
      }
      .header > * {
        min-width: 0;
      }
      .grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
      }
      .card {
        grid-column: span 1 !important;
        padding: 12px;
      }
      section.card[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        display: block !important;
      }
      .table-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
      }
      
      .table-actions {
        justify-content: space-between;
      }
      
      .table-search input {
        min-width: 120px;
      }
      
      .pagination {
        flex-direction: column;
        gap: 16px;
      }
      
      .stats-grid {
        grid-template-columns: 1fr 1fr;
      }
    }
    
    @media (max-width: 480px) {
      .stats-grid {
        grid-template-columns: 1fr;
      }
      
      .action-buttons {
        flex-direction: column;
      }
    }

    /* Focus styles */
    .link:focus-visible,
    .submenu a:focus-visible,
    .header .toggle:focus-visible {
      outline: none;
      box-shadow: 0 0 0 2px rgba(0, 0, 0, .12), 0 0 0 4px rgba(212, 0, 0, .18);
    }

    .btn-danger {
  background-color: #e74c3c;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-primary {
  background-color: #3498db;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-sm { font-size: 14px; }








.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 25px;
  border-radius: 10px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content h2 {
  margin-bottom: 15px;
  border-bottom: 2px solid #ddd;
  padding-bottom: 8px;
}

.modal-content input {
  width: 100%;
  margin: 6px 0;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.close {
  float: right;
  font-size: 24px;
  cursor: pointer;
  color: #555;
}

.close:hover {
  color: red;
}
