/* ========================================
   NEXUS ADMIN DASHBOARD - STYLE SYSTEM
   ======================================== */

/* CSS Variables */
:root {
  --primary: #1B2A4A;
  --primary-light: #243B64;
  --primary-dark: #111D35;
  --accent: #FF6B35;
  --accent-hover: #E85A24;
  --accent-light: rgba(255, 107, 53, 0.12);
  --bg: #F5F3EF;
  --card: #FFFFFF;
  --text: #2D3748;
  --text-secondary: #718096;
  --text-light: #A0AEC0;
  --border: #E8E5E0;
  --success: #48BB78;
  --success-light: rgba(72, 187, 120, 0.12);
  --warning: #ECC94B;
  --warning-light: rgba(236, 201, 75, 0.12);
  --danger: #FC5C65;
  --danger-light: rgba(252, 92, 101, 0.12);
  --info: #45AAF2;
  --info-light: rgba(69, 170, 242, 0.12);
  --sidebar-w: 260px;
  --header-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
body.dark-mode {
  --bg: #0F172A;
  --card: #1E293B;
  --text: #E2E8F0;
  --text-secondary: #94A3B8;
  --text-light: #64748B;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.3);
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  transition: var(--transition);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ========================================
   LAYOUT
   ======================================== */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.sidebar-logo .logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.sidebar-close {
  display: none;
  color: #fff;
  font-size: 20px;
  padding: 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar-user:hover { background: rgba(255,255,255,0.08); }

.sidebar-user img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-user-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.sidebar-user-info span {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* HEADER */
.header {
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 900;
  transition: var(--transition);
}

.menu-toggle {
  display: none;
  font-size: 20px;
  color: var(--text);
  padding: 8px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.menu-toggle:hover { background: var(--accent-light); color: var(--accent); }

.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
}

.header-search input {
  width: 100%;
  padding: 9px 14px 9px 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.header-search input::placeholder { color: var(--text-light); }

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition);
  position: relative;
}

.header-btn:hover { background: var(--accent-light); color: var(--accent); }

.header-btn .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--card);
}

.dark-toggle { font-size: 16px; }

.header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
  margin-left: 4px;
}

.header-profile:hover { background: var(--bg); }

.header-profile img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.header-profile span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.header-profile i {
  font-size: 12px;
  color: var(--text-light);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 1000;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--text);
  transition: var(--transition);
}

.dropdown-item:hover { background: var(--bg); }

.dropdown-item i { width: 18px; color: var(--text-light); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger i { color: var(--danger); }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Notification Dropdown */
.notif-dropdown {
  min-width: 340px;
  max-height: 400px;
  overflow-y: auto;
}

.notif-header {
  padding: 12px 12px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.notif-header a {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.notif-item:hover { background: var(--bg); }

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.notif-icon.success { background: var(--success-light); color: var(--success); }
.notif-icon.warning { background: var(--warning-light); color: var(--warning); }
.notif-icon.danger { background: var(--danger-light); color: var(--danger); }
.notif-icon.info { background: var(--info-light); color: var(--info); }

.notif-content p { font-size: 13px; color: var(--text); line-height: 1.4; }
.notif-content span { font-size: 12px; color: var(--text-light); }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: var(--transition);
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--text-secondary); transition: var(--transition); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .separator { font-size: 10px; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========================================
   COMPONENTS
   ======================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,107,53,0.3); }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-warning { background: var(--warning); color: var(--text); }
.btn-warning:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-icon.sm { width: 32px; height: 32px; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Stat Cards */
.stat-card {
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stat-info h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-info .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}

.stat-info .change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}

.stat-info .change.up { color: var(--success); }
.stat-info .change.down { color: var(--danger); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.accent { background: var(--accent-light); color: var(--accent); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }

/* Grid */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Table */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th, table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

table td { color: var(--text); }

table tbody tr { transition: var(--transition); }
table tbody tr:hover { background: var(--bg); }

table th.sortable { cursor: pointer; user-select: none; }
table th.sortable:hover { color: var(--accent); }
table th .sort-icon { margin-left: 4px; font-size: 10px; }

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); }

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder { color: var(--text-light); }

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-light); }
.form-control.is-valid { border-color: var(--success); }
.form-control.is-valid:focus { box-shadow: 0 0 0 3px var(--success-light); }

.invalid-feedback {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.valid-feedback {
  font-size: 12px;
  color: var(--success);
  margin-top: 4px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-check label {
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-row-3 { grid-template-columns: repeat(3, 1fr); }

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .btn {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-primary { background: var(--accent-light); color: var(--accent); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: #B7791F; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-secondary { background: var(--bg); color: var(--text-secondary); }

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }

.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  border: 2px solid var(--card);
  margin-left: -10px;
}

.avatar-group .avatar:first-child { margin-left: 0; }

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.alert i { font-size: 18px; margin-top: 1px; }
.alert-success { background: var(--success-light); color: #276749; }
.alert-warning { background: var(--warning-light); color: #975A16; }
.alert-danger { background: var(--danger-light); color: #9B2C2C; }
.alert-info { background: var(--info-light); color: #2B6CB0; }

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn:hover { color: var(--accent); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.page-btn:hover { background: var(--bg); color: var(--text); }
.page-btn.active { background: var(--accent); color: #fff; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
}

.modal-overlay.show .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 18px; font-weight: 700; }

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
}

.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
  min-width: 300px;
  animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon { font-size: 18px; }
.toast.success .toast-icon { color: var(--success); }
.toast.danger .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }

.toast-message { flex: 1; font-size: 14px; }
.toast-close { color: var(--text-light); font-size: 14px; padding: 4px; }
.toast-close:hover { color: var(--text); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Tags Input */
.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 44px;
  align-items: center;
  transition: var(--transition);
  cursor: text;
}

.tags-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.tags-input .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.tags-input .tag button {
  color: var(--accent);
  font-size: 12px;
  opacity: 0.6;
}

.tags-input .tag button:hover { opacity: 1; }

.tags-input input {
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  flex: 1;
  min-width: 80px;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-area i { font-size: 40px; color: var(--text-light); margin-bottom: 12px; }
.upload-area p { font-size: 14px; color: var(--text-secondary); }
.upload-area span { font-size: 12px; color: var(--text-light); }

/* Progress Bar */
.progress {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-bar.accent { background: var(--accent); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.info { background: var(--info); }

/* Wizard / Steps */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  position: relative;
}

.wizard-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.wizard-step::before {
  content: '';
  position: absolute;
  top: 18px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.wizard-step:first-child::before { display: none; }

.wizard-step.completed::before { background: var(--accent); }

.wizard-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--bg);
  color: var(--text-light);
  border: 2px solid var(--border);
  z-index: 1;
  transition: var(--transition);
}

.wizard-step.active .wizard-step-num {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.wizard-step.completed .wizard-step-num {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.wizard-step-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
  font-weight: 500;
}

.wizard-step.active .wizard-step-label { color: var(--accent); font-weight: 600; }
.wizard-step.completed .wizard-step-label { color: var(--success); }

/* Permission Matrix */
.perm-table th:first-child,
.perm-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 1;
}

.perm-table th:first-child { background: var(--bg); }

.perm-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.media-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  group: true;
}

.media-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.media-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.media-item-info {
  padding: 10px;
}

.media-item-info p {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-item-info span {
  font-size: 11px;
  color: var(--text-light);
}

.media-item-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
}

.media-item:hover .media-item-actions { opacity: 1; }

.media-item-actions button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  backdrop-filter: blur(4px);
}

.media-item-actions button:hover { background: var(--accent); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.lightbox.show { opacity: 1; visibility: visible; }

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 24px;
  padding: 8px;
}

/* Activity Timeline */
.timeline { position: relative; padding-left: 24px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--card);
}

.timeline-item .time {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.timeline-item p { font-size: 14px; color: var(--text); }

/* ========================================
   LOGIN / REGISTER PAGES
   ======================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1B2A4A 0%, #0F172A 50%, #1a1a2e 100%);
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.auth-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-bg-shapes .shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
}

.auth-bg-shapes .shape-1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -200px;
  right: -100px;
  animation: float 8s ease-in-out infinite;
}

.auth-bg-shapes .shape-2 {
  width: 400px;
  height: 400px;
  background: #45AAF2;
  bottom: -100px;
  left: -100px;
  animation: float 10s ease-in-out infinite reverse;
}

.auth-bg-shapes .shape-3 {
  width: 200px;
  height: 200px;
  background: var(--success);
  top: 50%;
  left: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.auth-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-card h1 {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.auth-card p {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 32px;
}

.auth-card .form-group { margin-bottom: 18px; }

.auth-card .form-label {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
}

.auth-card .form-control {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
}

.auth-card .form-control::placeholder { color: rgba(255,255,255,0.3); }

.auth-card .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.2);
  background: rgba(255,255,255,0.1);
}

.auth-card .form-check label { color: rgba(255,255,255,0.6); font-size: 13px; }

.auth-card .btn-primary {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  border-radius: 10px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
}

.auth-footer a { color: var(--accent); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.social-login {
  display: flex;
  gap: 12px;
}

.social-btn {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-btn:hover { background: rgba(255,255,255,0.15); transform: translateY(-2px); }

/* Password toggle */
.password-toggle {
  position: relative;
}

.password-toggle .toggle-pwd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
  padding: 4px;
}

.password-toggle .form-control { padding-right: 44px; }

/* ========================================
   RESPONSIVE
   ======================================== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-overlay.show { opacity: 1; visibility: visible; }

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-close { display: block; }

  .main-content { margin-left: 0; }

  .menu-toggle { display: flex; }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .page-content { padding: 16px; }

  .grid-4 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .header-search { display: none; }

  .header-profile span { display: none; }

  .auth-card { padding: 28px 24px; }

  .wizard-steps { flex-wrap: wrap; gap: 12px; }

  .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .page-header h1 { font-size: 22px; }
}

@media (max-width: 480px) {
  .stat-info .value { font-size: 22px; }

  .notif-dropdown { min-width: 280px; right: -60px; }

  .social-login { flex-direction: column; }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.animate-in {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}