/* ===================================
   POSTLIC ADMIN PANEL — Design System
   panel.postlic.com
   =================================== */

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

:root {
  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-dark: #4F46E5;
  --secondary: #06B6D4;
  --accent: #8B5CF6;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  --bg-body: #06060F;
  --bg-sidebar: #0A0A1A;
  --bg-main: #0C0C1D;
  --bg-card: rgba(18, 18, 42, 0.6);
  --bg-card-solid: #12122A;
  --bg-input: rgba(18, 18, 42, 0.8);
  --bg-hover: rgba(99, 102, 241, 0.08);
  --bg-active: rgba(99, 102, 241, 0.12);

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --text-muted: #475569;

  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --border-accent: rgba(99,102,241,0.3);

  --gradient: linear-gradient(135deg, #6366F1, #06B6D4);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(99,102,241,0.15);

  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* === LOGIN PAGE === */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; top: -30%; left: -20%; width: 60%; height: 80%;
  background: radial-gradient(circle, rgba(99,102,241,0.08), transparent 60%);
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute; bottom: -30%; right: -20%; width: 50%; height: 70%;
  background: radial-gradient(circle, rgba(6,182,212,0.06), transparent 60%);
  pointer-events: none;
}

.login-box {
  width: 100%; max-width: 420px;
  padding: 48px 40px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative; z-index: 1;
  box-shadow: var(--shadow-md);
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.5rem; font-weight: 800;
  margin-bottom: 8px; letter-spacing: -0.03em;
}
.login-logo .icon {
  width: 40px; height: 40px;
  background: var(--gradient); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff;
}
.login-logo .gradient { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-subtitle { font-size: 0.9rem; color: var(--text-tertiary); margin-bottom: 36px; }

.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.825rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
}
.form-input {
  width: 100%; padding: 12px 16px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
  font-family: inherit; font-size: 0.9rem;
  transition: border var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-input::placeholder { color: var(--text-muted); }

.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 0.825rem; color: var(--text-secondary); cursor: pointer; }
.form-check input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary);
  border-radius: 4px; cursor: pointer;
}
.form-link { font-size: 0.825rem; color: var(--primary-light); font-weight: 500; }
.form-link:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(99,102,241,0.2); }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-accent); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }

/* === LAYOUT === */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width); height: 100vh;
  position: fixed; left: 0; top: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100; transition: width var(--transition);
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 24px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 34px; height: 34px; min-width: 34px;
  background: var(--gradient); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff;
}
.sidebar-logo-text { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; }
.sidebar-logo-text .g { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-muted);
  padding: 0 12px; margin-bottom: 8px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary); transition: all var(--transition);
  cursor: pointer; white-space: nowrap;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-link.active { background: var(--bg-active); color: var(--primary-light); font-weight: 600; }
.sidebar-link .icon { font-size: 1.1rem; min-width: 22px; text-align: center; }
.sidebar-link .badge {
  margin-left: auto; padding: 2px 8px;
  font-size: 0.7rem; font-weight: 700;
  background: rgba(99,102,241,0.15); color: var(--primary-light);
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--transition);
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient); display: flex;
  align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: #fff;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-size: 0.825rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.7rem; color: var(--text-tertiary); }

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

.main-header {
  height: var(--header-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: rgba(6,6,15,0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.main-header-left { display: flex; align-items: center; gap: 16px; }
.main-header-title { font-size: 1.15rem; font-weight: 700; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-tertiary); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary-light); }

.main-header-right { display: flex; align-items: center; gap: 12px; }
.header-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  width: 240px;
}
.header-search input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.825rem; width: 100%;
  font-family: inherit;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search .icon { color: var(--text-tertiary); font-size: 0.9rem; }

.header-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  position: relative; font-size: 1rem;
}
.header-btn:hover { border-color: var(--border-accent); color: var(--text-primary); }
.header-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid var(--bg-body);
}

/* === PAGE CONTENT === */
.page-content { padding: 28px 32px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-top: 4px; }

/* === STAT CARDS === */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  padding: 24px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.stat-label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 1.75rem; font-weight: 800; margin-bottom: 6px; }
.stat-value.gradient { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-change { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* === CARDS === */
.card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 0.95rem; font-weight: 600; }
.card-body { padding: 24px; }
.card-body.no-pad { padding: 0; }

/* === TABLE === */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 20px; text-align: left;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-tertiary);
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 20px; font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 0.725rem; font-weight: 600;
}
.badge-success { background: rgba(34,197,94,0.1); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.1); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.1); color: var(--info); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-success .badge-dot { background: var(--success); }
.badge-warning .badge-dot { background: var(--warning); }
.badge-danger .badge-dot { background: var(--danger); }

/* === GRID LAYOUTS === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* === ACTIVITY LIST === */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 34px; height: 34px; min-width: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.9rem;
}
.activity-icon.add { background: rgba(34,197,94,0.1); }
.activity-icon.edit { background: rgba(59,130,246,0.1); }
.activity-icon.delete { background: rgba(239,68,68,0.1); }
.activity-icon.login { background: rgba(99,102,241,0.1); }
.activity-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; font-family: 'JetBrains Mono', monospace; }

/* === CHART PLACEHOLDER === */
.chart-area {
  height: 220px; display: flex; align-items: flex-end;
  gap: 6px; padding: 16px 0;
}
.chart-bar {
  flex: 1; border-radius: 4px 4px 0 0;
  background: var(--gradient); opacity: 0.6;
  transition: opacity var(--transition);
  min-height: 10px;
}
.chart-bar:hover { opacity: 1; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-tertiary);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p { font-size: 0.875rem; margin-bottom: 20px; }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  width: 100%; max-width: 520px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transform: scale(0.95);
  transition: transform var(--transition);
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer;
  font-size: 1.1rem; transition: all var(--transition);
}
.modal-close:hover { border-color: var(--danger); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border);
}

/* === TOAST === */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 14px 20px; border-radius: var(--radius);
  background: var(--bg-card-solid); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px;
  font-size: 0.85rem; min-width: 300px;
  animation: slideIn 0.3s ease;
}
.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === RESPONSIVE === */
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}
@media (max-width: 768px) {
  .page-content { padding: 20px 16px; }
  .main-header { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
