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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2a2d3a;
  --text: #f0f0f0;
  --text-muted: #888;
  --text-hint: #555;
  --accent: #185FA5;
  --accent-hover: #378ADD;
  --success: #1D9E75;
  --danger: #A32D2D;
  --danger-bg: #1f0f0f;
  --danger-text: #F09595;
  --danger-border: #A32D2D;
  --sidebar-w: 240px;
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }

/* AUTH */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo-icon { width: 52px; height: 52px; background: var(--accent); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.75rem; color: white; }
.auth-logo h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.auth-logo p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.server-badge { display: flex; align-items: center; justify-content: center; gap: 7px; background: var(--surface); border: 0.5px solid var(--border); border-radius: 20px; padding: 5px 14px; font-size: 12px; color: var(--text-muted); margin: 0 auto 1.5rem; width: fit-content; }
.badge-dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; }
.auth-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: 16px; padding: 2rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 12px; color: var(--text-hint); }

/* FORMS */
.form-field { margin-bottom: 1.1rem; }
.form-field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-field input,
.form-field select,
.form-field textarea { width: 100%; background: var(--bg); border: 0.5px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 14px; color: var(--text); outline: none; transition: border-color .2s; font-family: inherit; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--accent); }
.form-field input::placeholder { color: var(--text-hint); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.toggle-pass { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; display: flex; align-items: center; }

/* BUTTONS */
.btn-primary { width: 100%; background: var(--accent); color: white; border: none; border-radius: 10px; padding: 11px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .2s; margin-top: 0.5rem; font-family: inherit; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 0.5px solid var(--border); border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; font-family: inherit; transition: background .2s; }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger-bg); color: var(--danger-text); border: 0.5px solid var(--danger); border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }

/* ALERTS */
.alert { border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 1rem; }
.alert-error { background: var(--danger-bg); border: 0.5px solid var(--danger-border); color: var(--danger-text); }
.alert-success { background: #0a1f14; border: 0.5px solid #0F6E56; color: #5DCAA5; }

/* LAYOUT APP */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 0.5px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; }
.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 2rem; }
.sidebar-logo { padding: 1.5rem 1.25rem 1rem; border-bottom: 0.5px solid var(--border); }
.sidebar-logo h2 { font-size: 15px; font-weight: 600; }
.sidebar-logo p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 1rem 0.75rem; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text-muted); font-size: 13px; text-decoration: none; transition: all .15s; margin-bottom: 2px; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent); color: white; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-hint); padding: 1rem 12px 0.4rem; }
.sidebar-user { padding: 1rem 1.25rem; border-top: 0.5px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: white; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-muted); }
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: 20px; font-weight: 600; }
.page-header p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* CARDS */
.card { background: var(--surface); border: 0.5px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.stat-card { background: var(--surface2); border-radius: 10px; padding: 1rem 1.25rem; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 600; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); border-bottom: 0.5px solid var(--border); font-weight: 500; }
td { padding: 12px 14px; border-bottom: 0.5px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* BADGE */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-admin { background: #0c1a2e; color: #85B7EB; border: 0.5px solid #185FA5; }
.badge-manager { background: #1a1a0a; color: #EF9F27; border: 0.5px solid #854F0B; }
.badge-active { background: #0a1a10; color: #5DCAA5; border: 0.5px solid #0F6E56; }
