/* HEADER */
.app-header {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 64px;
  background-color: var(--bg-card);
  border-bottom: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; z-index: 1000;
}
.header-left { display: flex; align-items: center; gap: 32px; height: 100%; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 32px; height: 32px; background-color: var(--primary);
  color: #fff; border-radius: var(--radius-input);
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 18px;
}
.brand-name { font-size: 20px; font-weight: 700; color: var(--text-main); }
.header-center { display: flex; gap: 4px; height: 100%; list-style:none; margin:0; padding:0; }
.nav-link {
  height: 100%; display: inline-flex; align-items: center;
  padding: 0 16px; color: var(--text-muted);
  font-weight: 500; font-size: 14px; transition: all 0.2s;
  border-bottom: 3px solid transparent; 
}
.nav-link:hover { color: var(--primary); }
.nav-link.active {
  background-color: #EEF2FF; color: var(--primary);
  font-weight: 600; border-bottom: 3px solid var(--primary);
}
.header-right { display: flex; align-items: center; gap: 16px; height: 100%; }
.header-right .bell-icon {
  position: relative; cursor: pointer; color: var(--text-muted); background:none; border:none;
  display: flex; align-items: center; justify-content: center;
}
.header-right .bell-icon .dot {
  position: absolute; top: 0; right: 2px; width: 8px; height: 8px;
  background-color: var(--danger); border-radius: 50%; border: 2px solid var(--bg-card);
}
.header-divider { width: 1px; height: 24px; background: var(--border); }
.avatar-section { 
  display: flex; align-items: center; gap: 8px; cursor: pointer; 
  position: relative;
}
.avatar-name { font-size: 14px; font-weight: 500; }
.avatar-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background-color: #EEF2FF; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
}
.dropdown-menu {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  background: var(--bg-card); border-radius: var(--radius-input);
  box-shadow: var(--shadow-hover); width: 180px;
  display: none; flex-direction: column; padding: 8px 0; border: 1px solid var(--border);
}
.dropdown-menu.active { display: flex; }
.dropdown-item {
  padding: 8px 16px; font-size: 14px; color: var(--text-main);
  text-decoration:none; cursor: pointer; transition: background 0.2s;
  background:none; border:none; text-align:left; font-family:inherit; width:100%;
}
.dropdown-item:hover { background: #F9FAFB; color: var(--primary); }

/* MOBILE SIDEBAR */
.hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--text-main); }
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1001;
  display: none; opacity: 0; transition: opacity 0.3s;
}
.sidebar-overlay.active { display: block; opacity: 1; }
.sidebar {
  position: fixed; top: 0; left: -280px; width: 280px; height: 100vh;
  background: var(--bg-card); z-index: 1002; transition: left 0.3s ease;
  box-shadow: var(--shadow-hover); display: flex; flex-direction: column;
}
.sidebar.active { left: 0; }
.sidebar-header {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid var(--border);
}
.btn-close { background: none; border: none; cursor: pointer; color: var(--text-main); }
.sidebar-nav { padding: 16px 0; display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav .nav-link { 
  height: 48px; padding: 0 16px; border: none; border-left: 3px solid transparent; width: 100%;
}
.sidebar-nav .nav-link.active {
  border-bottom: none; border-left: 3px solid var(--primary); background: #EEF2FF;
}

/* CARDS */
.card {
  background: var(--bg-card); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: 24px; transition: box-shadow 0.2s;
}
.stat-card {
  position: relative; overflow: hidden;
}
.stat-card:hover {
  border-bottom: 3px solid var(--primary);
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 8px 16px; border-radius: var(--radius-input);
  font-weight: 500; font-size: 14px; cursor: pointer;
  border: 1px solid transparent; transition: all 0.2s ease;
  font-family: inherit; text-decoration:none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #EEF2FF; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-outline { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-danger-outline:hover { background: #FEF2F2; }

/* RIPPLE EFFECT */
.ripple {
  position: relative; overflow: hidden; transform: scale(1);
}
.ripple:active { transform: scale(0.98); }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text-main); }
.form-control {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius-input); font-family: inherit; font-size: 14px; color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s; background: var(--bg-card);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
.form-control.error { border-color: var(--danger); }
.error-msg { color: var(--danger); font-size: 12px; margin-top: 4px; display: block; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); background-position: right 12px center; background-repeat: no-repeat; background-size: 16px; padding-right: 32px; }

/* TABLES */
.table-responsive { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th { padding: 12px 16px; background: #F9FAFB; font-size: 12px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); white-space:nowrap; }
.table td { padding: 16px; font-size: 14px; border-bottom: 1px solid var(--border); color: var(--text-main); white-space:nowrap; }
.table tbody tr:hover { background: #F9FAFB; }

/* BADGES */
.badge { padding: 4px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; }
.badge-active { background: #D1FAE5; color: #065F46; }
.badge-inactive { background: #F3F4F6; color: #4B5563; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }

/* MODALS */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1050;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card); border-radius: var(--radius-card); width: 100%; max-width: 400px;
  padding: 24px; box-shadow: var(--shadow-hover); transform: scale(0.95); transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.modal-body { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; }

/* TOASTS */
.toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 1100;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-card); padding: 12px 16px; border-radius: var(--radius-input);
  box-shadow: var(--shadow-hover); display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 500; color: var(--text-main); min-width: 280px;
  transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  opacity: 0; border-left: 4px solid var(--primary);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { border-left-color: var(--accent); }
.toast-success .material-symbols-outlined { color: var(--accent); }
.toast-error { border-left-color: var(--danger); }
.toast-error .material-symbols-outlined { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .material-symbols-outlined { color: var(--warning); }

/* SPINNER */
.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite;
  display: inline-block;
}
.btn-outline .spinner { border-color: rgba(79, 70, 229, 0.3); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 48px; color: var(--border); margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* UTILS */
.text-indigo { color: var(--primary); }
.text-slate { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.mb-6 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
