/* ============================================
   SOLE EN STEP - Main Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --primary:     #1a1a2e;
  --primary-light: #16213e;
  --accent:      #e94560;
  --accent-hover:#c73652;
  --success:     #2ecc71;
  --warning:     #f39c12;
  --info:        #3498db;
  --danger:      #e74c3c;
  --secondary:   #6c757d;
  --bg:          #f0f2f5;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1a202c;
  --text-muted:  #718096;
  --sidebar-w:   240px;
  --font:        'Plus Jakarta Sans', sans-serif;
  --font-head:   'Space Grotesk', sans-serif;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 30px rgba(0,0,0,.12);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ── SCROLLBAR ───────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }

/* ── SIDEBAR ─────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand .brand-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: block;
}

.sidebar-brand .brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}

.nav-item.active {
  color: #fff;
  background: rgba(233,69,96,.15);
  border-left-color: var(--accent);
}

.nav-item .nav-icon {
  width: 18px;
  text-align: center;
  opacity: .8;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 13px;
}

.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(255,255,255,.4); }

.btn-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 12px;
  background: rgba(233,69,96,.15);
  border: 1px solid rgba(233,69,96,.3);
  border-radius: 6px;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}

.btn-logout:hover {
  background: var(--accent);
  color: #fff;
}

/* ── MAIN CONTENT ────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.content {
  flex: 1;
  padding: 24px;
}

/* ── CARDS ───────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

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

.card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
}

.card-body { padding: 20px; }

/* ── STAT CARDS ──────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.stat-icon.red    { background: rgba(233,69,96,.1);  color: var(--accent); }
.stat-icon.green  { background: rgba(46,204,113,.1); color: var(--success); }
.stat-icon.blue   { background: rgba(52,152,219,.1); color: var(--info); }
.stat-icon.orange { background: rgba(243,156,18,.1); color: var(--warning); }

.stat-value {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}

.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.9); }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline  {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── FORMS ───────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-label span { color: var(--accent); }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,69,96,.12);
}

.form-control[readonly] { background: var(--bg); }

.form-row {
  display: grid;
  gap: 16px;
}

.form-row.col-2 { grid-template-columns: 1fr 1fr; }
.form-row.col-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── TABLES ──────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(0,0,0,.02); }
tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ──────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-info      { background: rgba(52,152,219,.12);  color: var(--info); }
.badge-warning   { background: rgba(243,156,18,.12);  color: var(--warning); }
.badge-success   { background: rgba(46,204,113,.12);  color: var(--success); }
.badge-secondary { background: rgba(108,117,125,.12); color: var(--secondary); }
.badge-danger    { background: rgba(231,76,60,.12);   color: var(--danger); }

/* ── ALERTS ──────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: rgba(46,204,113,.1);  border: 1px solid rgba(46,204,113,.3);  color: #1a7a42; }
.alert-danger  { background: rgba(231,76,60,.1);   border: 1px solid rgba(231,76,60,.3);   color: #9b1c1c; }
.alert-warning { background: rgba(243,156,18,.1);  border: 1px solid rgba(243,156,18,.3);  color: #7d4f00; }
.alert-info    { background: rgba(52,152,219,.1);  border: 1px solid rgba(52,152,219,.3);  color: #1a5276; }

/* ── MODAL ───────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-weight: 600; font-size: 15px; }
.modal-close {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ── LOGIN PAGE ──────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .brand {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}

.login-logo .sub {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── NOTA PRINT ──────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-row.col-2, .form-row.col-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── UTILITIES ───────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }
