/* ============================================================
   My System Admin Dashboard - style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --sidebar-width: 200px;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e8eaf0;
  --body-bg: #f0f2f8;
  --nav-active-bg: #3b5bdb;
  --nav-active-text: #ffffff;
  --nav-text: #4a5568;
  --nav-icon: #6b7280;
  --nav-hover-bg: #f3f4f6;
  --text-dark: #1a202c;
  --text-muted: #718096;
  --topbar-height: 64px;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background-color: var(--body-bg);
  color: var(--text-dark);
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

/* Brand Logo */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 22px 18px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.sidebar-brand i {
  font-size: 22px;
  color: #1a202c;
}

.sidebar-brand .brand-name {
  font-size: 17px;
  font-weight: 700;
  color: #1a202c;
  letter-spacing: -0.2px;
}

/* Nav Menu */
.sidebar-nav {
  padding: 12px 12px;
  flex: 1;
}

.sidebar-nav .nav-item {
  margin-bottom: 2px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--nav-text);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.sidebar-nav .nav-link i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  color: var(--nav-icon);
  flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
  background-color: var(--nav-hover-bg);
  color: #1a202c;
}

.sidebar-nav .nav-link:hover i {
  color: #374151;
}

.sidebar-nav .nav-link.active {
  background-color: var(--nav-active-bg);
  color: var(--nav-active-text);
}

.sidebar-nav .nav-link.active i {
  color: var(--nav-active-text);
}

/* Sidebar Footer - User Profile */
.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-footer .user-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-footer .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-footer .user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a202c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer .user-role {
  font-size: 11.5px;
  color: var(--text-muted);
}

.sidebar-footer .btn-more {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
}

.sidebar-footer .btn-more:hover {
  color: #374151;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  height: var(--topbar-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 20px;
  position: relative;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
  line-height: 1;
}

.topbar-btn:hover {
  background-color: #f3f4f6;
}

.topbar-btn .badge-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  padding: 32px 30px 40px 30px;
  flex: 1;
}

/* Welcome Header */
.welcome-heading {
  font-size: 26px;
  font-weight: 700;
  color: #1a202c;
  line-height: 1.2;
  margin-bottom: 6px;
}

.welcome-subtext {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 26px;
}

/* ============================================================
   CATEGORY CARDS GRID
   ============================================================ */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Card */
.category-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: block;
  aspect-ratio: 16 / 10;
  min-height: 230px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}

/* Card Background Image */
.category-card .card-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

/* Dark overlay gradient */
.category-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.22) 40%,
    rgba(0,0,0,0.62) 100%
  );
  z-index: 1;
}

/* Card body content */
.category-card .card-body-inner {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  text-align: center;
}

/* Icon circle */
.category-card .card-icon-circle {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.category-card .card-icon-circle i {
  font-size: 28px;
}

.category-card .card-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.2;
}

.category-card .card-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
  max-width: 240px;
}

/* Per-card icon colors */
.icon-restaurant { color: #e07b39; }
.icon-kitchen    { color: #2d8a5e; }
.icon-electronics{ color: #3b82f6; }
.icon-others     { color: #7c3aed; }

/* ============================================================
   MOBILE SIDEBAR TOGGLE
   ============================================================ */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: #374151;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  margin-right: auto;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
  }

  .topbar {
    justify-content: space-between;
    padding: 0 18px;
  }
}

@media (max-width: 767px) {
  .page-content {
    padding: 22px 16px 32px 16px;
  }

  .categories-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .category-card {
    aspect-ratio: 16 / 9;
    min-height: 190px;
  }

  .welcome-heading {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .category-card .card-icon-circle {
    width: 54px;
    height: 54px;
  }

  .category-card .card-icon-circle i {
    font-size: 22px;
  }

  .category-card .card-title {
    font-size: 17px;
  }
}

/* ============================================================
   STAT CARDS  (Dashboard quick metrics)
   ============================================================ */
.stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-value { font-size: 20px; font-weight: 700; color: #1a202c; line-height: 1.1; }
.stat-label { font-size: 12px; color: #718096; margin-top: 2px; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: #1a202c; margin: 0; }

/* ============================================================
   PANEL
   ============================================================ */
.panel {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  overflow: hidden;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e8eaf0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.panel-header h2 { font-size: 15px; font-weight: 600; color: #1a202c; margin: 0; }
.panel-body { padding: 20px; }

/* ============================================================
   DATA TABLE
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  background: #f8fafc;
  color: #4a5568;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 11px 14px;
  border-bottom: 1px solid #e8eaf0;
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f3f8;
  color: #374151;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f8fafc; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-control,
.filter-bar .form-select {
  font-size: 13.5px;
  border-radius: 8px;
  border-color: #d1d5db;
  padding: 8px 12px;
}
.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  border-color: #3b5bdb;
  box-shadow: 0 0 0 3px rgba(59,91,219,.1);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary-custom {
  background-color: #3b5bdb;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  cursor: pointer;
  transition: background-color .2s;
  white-space: nowrap;
}
.btn-primary-custom:hover { background-color: #2f4fc4; color: #fff; }
.btn-sm-icon {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-sm-icon:hover { opacity: .8; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-content { border-radius: 14px; border: none; }
.modal-header  { border-bottom: 1px solid #e8eaf0; padding: 18px 22px; }
.modal-footer  { border-top: 1px solid #e8eaf0; padding: 14px 22px; }
.modal-title   { font-size: 16px; font-weight: 600; color: #1a202c; }
.modal .form-label { font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 5px; }
.modal .form-control,
.modal .form-select {
  border-radius: 8px;
  border-color: #d1d5db;
  font-size: 13.5px;
  padding: 9px 12px;
}
.modal .form-control:focus,
.modal .form-select:focus {
  border-color: #3b5bdb;
  box-shadow: 0 0 0 3px rgba(59,91,219,.1);
}

/* ============================================================
   CATEGORY BANNER
   ============================================================ */
.cat-banner {
  border-radius: 14px;
  padding: 28px 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  color: #fff;
}
.cat-banner-icon {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.cat-banner h2 { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.cat-banner p  { font-size: 13px; opacity: .85; margin: 0; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 50px 20px; color: #9ca3af; }
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }
