/* KYUESA SACCO Modern Theme */
:root {
  --green-900: #0d2b0f;
  --green-800: #1a4a1d;
  --green-700: #1e6b23;
  --green-600: #2d8c35;
  --green-500: #3aad44;
  --green-400: #5cc465;
  --green-300: #8ed894;
  --green-100: #e8f7e9;
  --green-50: #f4fbf5;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --dark: #0a0f0a;
  --surface: #111811;
  --card: #161e16;
  --border: #1f2e1f;
  --text: #e8f0e8;
  --text-muted: #7a9a7a;
  --text-dim: #4a6a4a;
  --danger: #e05555;
  --warning: #e09955;
  --info: #5599e0;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* HEADER */
.site-header {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(17,24,17,0.8) 100%);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 110 !important;
}

.site-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

header a {
  color: var(--green-400);
  transition: color 0.2s;
  font-weight: 500;
  font-size: 0.875rem;
}

header a:hover { color: var(--gold-light); }

/* CONTAINER */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(17,24,17,0.95) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar.mobile-hidden {
  transform: translateX(-100%);
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    max-width: 80vw;
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar.mobile-hidden {
    transform: translateX(-100%);
  }
}

.sidebar-logo {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.sidebar-logo-text span { color: var(--gold); }

.sidebar-logo-sub {
  font-size: 0.625rem;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 0.25rem;
  font-weight: 600;
}

.sidebar-user {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(58,173,68,0.2);
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.user-role {
  font-size: 0.75rem;
  color: var(--green-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.nav-section {
  padding: 0.75rem 1.5rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(58,173,68,0.08);
}

.nav-item.active {
  color: var(--green-400);
  background: rgba(58,173,68,0.12);
  border-left-color: var(--green-500);
}

.nav-item svg {
  stroke-width: 2.5;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.sidebar-bottom {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
  text-decoration: none;
}

.logout-btn:hover { 
  color: var(--danger);
}

.logout-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

/* MAIN CONTENT */
.main-content {
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

@media (max-width: 900px) {
  .main-content {
    margin-left: 0;
    padding: 4rem 1rem 1rem;
  }
}

/* HAMBURGER MENU */
.hamburger-menu {
  display: none;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  left: 1rem;
  z-index: 105;
  transition: all 0.2s;
}

.hamburger-menu:hover {
  border-color: var(--green-600);
  background: rgba(45,140,53,0.1);
}

.hamburger-menu span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.3s;
}

@media (max-width: 900px) {
  .hamburger-menu {
    display: flex;
  }
}

/* MOBILE OVERLAY */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .sidebar-overlay {
    display: block;
  }
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1.5rem;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notif-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.125rem;
  transition: all 0.2s;
}

.notif-btn:hover {
  border-color: var(--green-600);
  background: rgba(45,140,53,0.1);
}

.notif-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--card) 0%, rgba(22,30,22,0.6) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-600);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  opacity: 0.06;
  transition: all 0.3s;
}

.stat-card:hover::before { transform: scale(1.2); }

.stat-card.green::before { background: var(--green-500); }
.stat-card.blue::before { background: var(--info); }
.stat-card.gold::before { background: var(--gold); }
.stat-card.red::before { background: var(--danger); }

.stat-card.green .stat-icon { color: var(--green-400); }
.stat-card.blue .stat-icon { color: #5ca4c4; }
.stat-card.gold .stat-icon { color: var(--gold-light); }
.stat-card.red .stat-icon { color: var(--danger); }

.stat-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 45px;
  height: 45px;
  color: currentColor;
}

.stat-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2;
  stroke: currentColor;
}

.stat-val {
  font-family: 'Syne', sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.5px;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* CARDS */
.card {
  background: linear-gradient(135deg, var(--card) 0%, rgba(22,30,22,0.6) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.25px;
}

.card-actions { display: flex; gap: 0.75rem; }

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(58,173,68,0.1);
  background: rgba(58,173,68,0.02);
}

.form-group select option { background: var(--card); color: var(--text); }

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* TABLES */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.dashboard-card {
  background: linear-gradient(135deg, var(--card) 0%, rgba(22,30,22,0.6) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-md);
}

.dashboard-card table,
.dashboard-card th,
.dashboard-card td,
.dashboard-card thead,
.dashboard-card tbody,
.dashboard-card tr {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.table-wrap table {
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th {
  text-align: left;
  padding: 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(58,173,68,0.05);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(58,173,68,0.02); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }

.btn-green {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: #fff;
  box-shadow: 0 2px 8px rgba(58,173,68,0.2);
}

.btn-green:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(58,173,68,0.3);
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
}

.btn-green:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--green-600);
  color: var(--text);
  background: rgba(45,140,53,0.1);
}

.btn-danger {
  background: rgba(224,85,85,0.1);
  color: var(--danger);
  border: 1px solid rgba(224,85,85,0.2);
}

.btn-danger:hover { background: rgba(224,85,85,0.15); border-color: rgba(224,85,85,0.3); }

.btn-gold {
  background: rgba(201,168,76,0.1);
  color: var(--gold-light);
  border: 1px solid rgba(201,168,76,0.2);
}

.btn-gold:hover { background: rgba(201,168,76,0.15); border-color: rgba(201,168,76,0.3); }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-green { background: rgba(58,173,68,0.15); color: var(--green-400); }
.badge-gold { background: rgba(201,168,76,0.15); color: var(--gold-light); }
.badge-red { background: rgba(224,85,85,0.15); color: var(--danger); }
.badge-blue { background: rgba(85,153,224,0.15); color: var(--info); }
.badge-muted { background: rgba(122,154,122,0.15); color: var(--text-muted); }

/* SEARCH */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
}

.search-bar input::placeholder { color: var(--text-dim); }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.empty-text { font-size: 0.875rem; }

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s ease;
}

.toast.success { border-left: 3px solid var(--green-500); }
.toast.error { border-left: 3px solid var(--danger); }

@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* NOTIFICATION DROPDOWN */
#notification-dropdown {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 12px rgba(0,0,0,0.3);
  z-index: 1000;
  overflow-y: auto;
  padding-top: 1rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

#notification-dropdown.open {
  display: flex;
  flex-direction: column;
  transform: translateX(0);
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-shrink: 0;
}

.notif-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.notif-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.notif-close-btn:hover {
  color: var(--text);
}

#notification-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.notification-item {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification-item:hover {
  background: rgba(58,173,68,0.05);
}

.notification-item.unread {
  background: rgba(58,173,68,0.03);
  border-left: 3px solid var(--green-500);
  padding-left: calc(1.5rem - 3px);
}

.notif-item-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.notif-item-message {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.notif-item-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.notif-actions {
  display: flex;
  gap: 0.75rem;
  padding: 0 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notif-mark-read-btn {
  flex: 1;
  padding: 0.625rem;
  background: rgba(58,173,68,0.1);
  border: 1px solid rgba(58,173,68,0.2);
  color: var(--green-400);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.notif-mark-read-btn:hover {
  background: rgba(58,173,68,0.15);
  border-color: var(--green-500);
}

.notif-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* NOTIFICATION DROPDOWN OVERLAY (mobile) */
#notification-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#notification-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  #notification-dropdown {
    display: none;
    max-width: 100%;
    width: 100%;
  }

  #notification-overlay {
    display: block;
  }
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  /* Make sidebar behave as an overlay on small screens: half width, full height */
  .sidebar { 
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 50vw;
    max-width: 50vw;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 110;
    transform: translateX(0);
    transition: transform 0.3s ease;
  }
  .sidebar.mobile-hidden { transform: translateX(-100%); }
  .main-content { margin-left: 0; padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 1.5rem; }
  .topbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) {
  .hamburger-menu {
    display: flex;
  }
  .sidebar-overlay {
    display: block;
  }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-card { width: 100%; }
  .dashboard-card > div,
  .dashboard-card table,
  .dashboard-card thead,
  .dashboard-card tbody,
  .dashboard-card tr,
  .dashboard-card th,
  .dashboard-card td {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .dashboard-card table { min-width: 0; }
  .dashboard-card th,
  .dashboard-card td {
    white-space: normal;
    word-break: break-word;
  }
  .dashboard-card { overflow-x: hidden; }
  .dashboard-card .table-wrap,
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.5rem; }
  table { font-size: 0.8rem; min-width: 0; width: 100%; }
  td, th { padding: 0.5rem; white-space: normal; }
}

.bottom-navigation {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  z-index: 125;
  padding: 0.35rem 0;
  gap: 0.25rem;
  justify-content: space-between;
  align-items: center;
}

.bottom-nav-item {
  flex: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.35rem;
  font-size: 0.75rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.bottom-nav-item {
  color: var(--text-muted);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--green-600);
}

.bottom-nav-item.active {
  font-weight: 600;
}

.bottom-nav-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

@media (max-width: 768px) {
  .hamburger-menu {
    display: none !important;
  }
  .sidebar-overlay {
    display: none !important;
  }
  .sidebar {
    display: none !important;
  }
  .bottom-navigation {
    display: flex;
  }
  .main-content {
    padding-bottom: 6rem;
  }
  body {
    padding-bottom: 0;
  }
}

/* Prevent background scrolling when sidebar overlay is active */
body.no-scroll {
  overflow: hidden;
}

@media (max-width: 768px) {
  /* Typography */
  .page-title { font-size: 1.375rem; margin-bottom: 0.5rem; }
  .page-subtitle { font-size: 0.8rem; }
  .topbar { gap: 1rem; margin-bottom: 1.5rem; flex-direction: column; align-items: stretch; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  
  /* Main content */
  .main-content { padding: 4rem 1rem 1rem; margin-left: 0; }
  
  /* Stats grid */
  .stats-grid { grid-template-columns: 1fr !important; gap: 1rem; }
  .stat-card { padding: 1.25rem; }
  .stat-val { font-size: 1.5rem; }
  .stat-lbl { font-size: 0.7rem; }
  .stat-icon { width: 40px; height: 40px; }
  
  /* Dashboard grid - make single column */
  .dashboard-grid { grid-template-columns: 1fr !important; gap: 1.5rem; }
  .dashboard-card { width: 100%; }
  .dashboard-card > div,
  .dashboard-card table,
  .dashboard-card thead,
  .dashboard-card tbody,
  .dashboard-card tr,
  .dashboard-card th,
  .dashboard-card td {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .dashboard-card table { min-width: 0; }
  .dashboard-card th,
  .dashboard-card td {
    white-space: normal;
    word-break: break-word;
  }
  .dashboard-card { overflow-x: hidden; }
  .dashboard-card .table-wrap,
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.5rem; }
  table { font-size: 0.8rem; min-width: 0; width: 100%; }
  td, th { padding: 0.5rem; white-space: normal; }
  th { font-size: 0.7rem; }
  
  /* Div-based grids */
  div[style*="display: grid"][style*="grid-template-columns: 1fr 1fr"] { 
    display: grid !important;
    grid-template-columns: 1fr !important; 
  }
  
  /* Forms */
  .form-group { margin-bottom: 1rem; }
  input, select, textarea { font-size: 16px; }
  
  /* Container padding */
  .container { padding: 0 1rem; }
}

@media (max-width: 640px) {
  /* Typography */
  .page-title { font-size: 1.25rem; }
  .site-title { font-size: 1rem; }
  
  /* Main content */
  .main-content { padding: 4rem 0.75rem 1rem; }
  
  /* Sidebar */
  .sidebar { max-width: 85vw; }
  .sidebar-user { padding: 0.75rem 1rem; }
  .sidebar-nav { padding: 0.25rem 0; }
  .nav-item { padding: 0.5rem 1rem; font-size: 0.8rem; }
  .nav-section { padding: 0.5rem 1rem 0.25rem; font-size: 0.65rem; }
  .sidebar-bottom { padding: 0.75rem 1rem; }
  .logout-btn { font-size: 0.8rem; }
  
  /* Stats grid */
  .stat-card { padding: 1rem; }
  .stat-val { font-size: 1.375rem; }
  .stat-icon { width: 36px; height: 36px; }
  
  /* Topbar */
  .topbar { flex-direction: column; gap: 0.75rem; }
  .topbar-actions { width: 100%; justify-content: flex-start; gap: 0.75rem; }
  .notif-btn { width: 36px; height: 36px; }
  
  /* Buttons */
  .btn-primary, button[type="submit"] { 
    width: 100%; 
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  
  /* Tables */
  table { font-size: 0.75rem; }
  td, th { padding: 0.375rem; }
  
  /* Container */
  .container { padding: 0 0.75rem; }
  
  /* Hamburger menu */
  .hamburger-menu { width: 36px; height: 36px; top: 0.75rem; left: 0.75rem; }
  .hamburger-menu span { width: 18px; height: 1.5px; }
}

@media (max-width: 480px) {
  /* Typography */
  html { font-size: 14px; }
  .page-title { font-size: 1.125rem; }
  .site-title { font-size: 0.875rem; }
  
  /* Main content */
  .main-content { padding: 4rem 0.5rem 1rem; }
  
  /* Stats grid */
  .stats-grid { gap: 0.75rem; }
  .stat-card { padding: 0.875rem; gap: 0; }
  .stat-val { font-size: 1.25rem; margin-bottom: 0.125rem; }
  .stat-lbl { font-size: 0.65rem; }
  .stat-icon { width: 32px; height: 32px; margin-bottom: 0.5rem; }
  
  /* Forms */
  input, select, textarea { 
    font-size: 16px;
    padding: 10px 12px;
  }
  
  /* Sidebar */
  .sidebar { max-width: 90vw; }
  .sidebar-user { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .user-avatar { width: 36px; height: 36px; font-size: 0.75rem; }
  .user-name { font-size: 0.8rem; }
  .user-role { font-size: 0.65rem; }

  /* Mobile table cards */
  .table-wrap {
    overflow-x: visible;
    margin: 0;
  }
  .table-wrap table,
  .dashboard-card table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  .table-wrap thead,
  .dashboard-card thead {
    display: none;
  }
  .table-wrap tr,
  .dashboard-card tr {
    display: block;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
  }
  .table-wrap td,
  .dashboard-card td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0.65rem 0;
    border: none;
    white-space: normal;
    word-break: break-word;
  }
  .table-wrap td::before,
  .dashboard-card td::before {
    content: attr(data-label);
    display: block;
    width: 100%;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.35rem;
  }
  .table-wrap td > *,
  .dashboard-card td > * {
    width: 100%;
  }
  .table-wrap td:last-child,
  .dashboard-card td:last-child {
    padding-bottom: 0.25rem;
  }
  .nav-item { padding: 0.4rem 0.75rem; font-size: 0.75rem; }
  
  /* Buttons */
  .btn-primary, button[type="submit"] { padding: 8px 12px; font-size: 0.85rem; }
  
  /* Container */
  .container { padding: 0 0.5rem; max-width: 100%; }
}
