:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-hover: #1e293b;
  --bg: #f1f5f9;
  --white: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-light: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 10px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: 260px; min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed; left: 0; top: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar-logo {
  padding: 1.5rem;
  border-bottom: 1px solid #1e293b;
  font-size: 1.2rem; font-weight: 700; color: white;
  display: flex; align-items: center; gap: 0.7rem;
}
.sidebar-logo span { font-size: 1.5rem; }
.sidebar-menu { flex: 1; padding: 1rem 0; }
.sidebar-menu a {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.85rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none; font-size: 0.9rem; font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
  background: var(--sidebar-hover);
  color: white;
  border-left-color: var(--primary);
}
.sidebar-menu a .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid #1e293b; }
.sidebar-footer a { color: var(--sidebar-text); text-decoration: none; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.sidebar-footer a:hover { color: white; }

/* MAIN */
.main { margin-left: 260px; flex: 1; }

/* TOPBAR */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1.15rem; font-weight: 700; }
.topbar-user { display: flex; align-items: center; gap: 0.8rem; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 0.95rem; }

/* CONTENT */
.content { padding: 2rem; }

/* CARDS */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--white); border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
}
.stat-card-icon { width: 50px; height: 50px; border-radius: 12px; background: rgba(37,99,235,0.1); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.stat-card-info strong { display: block; font-size: 1.6rem; font-weight: 800; color: var(--text); }
.stat-card-info span { font-size: 0.85rem; color: var(--text-light); }

/* FORM CARD */
.card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.card-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 1rem; font-weight: 700; }
.card-body { padding: 1.5rem; }

/* FORMS */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.75rem 1rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; font-family: var(--font);
  transition: border 0.2s; background: var(--white);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--primary); }
.form-group textarea { height: 100px; resize: vertical; }
.form-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 0.3rem; }

/* BUTTONS */
.btn { padding: 0.7rem 1.5rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--bg); padding: 0.8rem 1rem; text-align: left; font-size: 0.8rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
tbody td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
tbody tr:hover { background: #fafbfc; }

/* BADGE */
.badge { display: inline-block; padding: 0.25rem 0.7rem; border-radius: 50px; font-size: 0.75rem; font-weight: 700; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* ALERT */
.alert { padding: 1rem 1.2rem; border-radius: 8px; font-size: 0.9rem; font-weight: 500; margin-bottom: 1rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* COLOR PICKER */
.color-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.color-option { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: transform 0.2s; }
.color-option:hover, .color-option.selected { transform: scale(1.2); border-color: var(--text); }

/* LOGIN PAGE */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a, #1e3a5f); }
.login-box { background: white; border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: 0.3rem; }
.login-logo p { color: var(--text-light); font-size: 0.9rem; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
}
