/* ============================================================
   AMS — Employee Access Mapping System
   Design: Modern SaaS — clean white, vivid blue, real depth
   Fonts: Outfit (UI) + JetBrains Mono (data)
   ============================================================ */

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

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

:root {
  --font:          'Outfit', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
  --bg-page:       #eef2f9;
  --bg-sidebar:    #1e2d5a;
  --bg-card:       #ffffff;
  --bg-input:      #ffffff;
  --bg-hover:      #f5f7ff;
  --bg-selected:   #eef2ff;
  --blue:          #2563eb;
  --blue-dark:     #1d4ed8;
  --blue-light:    #eff6ff;
  --blue-mid:      #dbeafe;
  --blue-glow:     0 0 0 3px rgba(37,99,235,0.15);
  --sidebar-w:     224px;
  --sidebar-text:  rgba(255,255,255,0.6);
  --sidebar-hover: rgba(255,255,255,0.07);
  --green:         #059669;
  --green-bg:      #ecfdf5;
  --green-border:  #6ee7b7;
  --amber:         #d97706;
  --amber-bg:      #fffbeb;
  --amber-border:  #fcd34d;
  --red:           #dc2626;
  --red-bg:        #fef2f2;
  --red-border:    #fca5a5;
  --purple:        #7c3aed;
  --purple-bg:     #f5f3ff;
  --purple-border: #c4b5fd;
  --text:          #0f172a;
  --text-2:        #334155;
  --text-3:        #64748b;
  --text-4:        #94a3b8;
  --border:        #e2e8f0;
  --border-mid:    #cbd5e1;
  --shadow-xs:     0 1px 2px rgba(15,23,42,0.06);
  --shadow-sm:     0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.05);
  --shadow-md:     0 4px 8px rgba(15,23,42,0.08), 0 2px 4px rgba(15,23,42,0.05);
  --shadow-lg:     0 10px 20px rgba(15,23,42,0.08), 0 4px 8px rgba(15,23,42,0.05);
  --shadow-card:   0 1px 3px rgba(15,23,42,0.07), 0 4px 16px rgba(15,23,42,0.05);
  --shadow-blue:   0 4px 14px rgba(37,99,235,0.3);
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 18px; --r-2xl: 24px;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-selected);
  color: var(--blue-dark);
  padding: 2px 7px;
  border-radius: var(--r-sm);
  border: 1px solid var(--blue-mid);
}

.layout { display: flex; min-height: 100vh; }

/* ──────────────── SIDEBAR ──────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(15,23,42,0.18);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
}

.sidebar-logo-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.4px;
}

.sidebar-logo-sub {
  font-size: 10.5px;
  color: var(--sidebar-text);
  margin-top: 3px;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  margin: 2px 10px;
  border-radius: var(--r);
  transition: background 0.14s, color 0.14s;
}

.nav-item:hover { background: var(--sidebar-hover); color: rgba(255,255,255,0.88); text-decoration: none; }

.nav-item.active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-blue);
}

.nav-icon { width: 16px; text-align: center; font-size: 13px; opacity: 0.75; flex-shrink: 0; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
}

.nav-count-warn   { background: rgba(217,119,6,0.3);  color: #fde68a; }
.nav-count-danger { background: rgba(220,38,38,0.3);  color: #fca5a5; }

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

.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: 11px; color: var(--sidebar-text); margin-top: 2px; margin-bottom: 12px; }
.btn-logout { display: block; font-size: 12px; color: var(--sidebar-text); padding: 4px 0; transition: color 0.14s; }
.btn-logout:hover { color: #fff; text-decoration: none; }

/* ──────────────── TOPBAR ──────────────── */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 62px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-xs);
}

.topbar-title { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; }
.topbar-actions { display: flex; gap: 10px; }
.page-content { padding: 28px; }

/* ──────────────── CARDS ──────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.22s ease both;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

/* ──────────────── METRICS ──────────────── */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s;
  animation: fadeUp 0.22s ease both;
}

.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Top color bar */
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb 0%, #818cf8 100%);
}

.metric-card:nth-child(2)::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.metric-card:nth-child(3)::before { background: linear-gradient(90deg, #dc2626, #f87171); }
.metric-card:nth-child(4)::before { background: linear-gradient(90deg, #059669, #34d399); }

.metric-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.metric-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.metric-sub { font-size: 12px; color: var(--text-4); margin-top: 6px; }
.metric-value.text-danger  { color: var(--red); }
.metric-value.text-warning { color: var(--amber); }
.metric-value.text-success { color: var(--green); }

.grid-4 .metric-card:nth-child(1) { animation-delay: 0.04s; }
.grid-4 .metric-card:nth-child(2) { animation-delay: 0.08s; }
.grid-4 .metric-card:nth-child(3) { animation-delay: 0.12s; }
.grid-4 .metric-card:nth-child(4) { animation-delay: 0.16s; }

/* ──────────────── TABLES ──────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-2);
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover td { background: #f8faff; }

.info-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.info-table td { padding: 5px 0; vertical-align: top; }
.info-table td:first-child {
  width: 110px;
  color: var(--text-3);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

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

.badge-active     { background: var(--green-bg);  color: var(--green);  border-color: var(--green-border); }
.badge-pending    { background: var(--amber-bg);  color: var(--amber);  border-color: var(--amber-border); }
.badge-terminated { background: var(--red-bg);    color: var(--red);    border-color: var(--red-border); }
.badge-disabled   { background: #f8fafc;          color: var(--text-3); border-color: var(--border-mid); }
.badge-removed    { background: #f8fafc;          color: var(--text-3); border-color: var(--border-mid); }
.badge-leave      { background: var(--purple-bg); color: var(--purple); border-color: var(--purple-border); }
.badge-suspended  { background: var(--red-bg);    color: var(--red);    border-color: var(--red-border); }
.badge-na         { background: #f1f5f9;          color: var(--text-4); border-color: var(--border); }
.badge-warning    { background: var(--amber-bg);  color: var(--amber);  border-color: var(--amber-border); }
.badge-info       { background: var(--blue-light);color: var(--blue);   border-color: var(--blue-mid); }

/* ──────────────── BUTTONS ──────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-2);
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 2px 8px rgba(220,38,38,0.2);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
  box-shadow: 0 4px 14px rgba(220,38,38,0.3);
}

.btn-block { display: flex; width: 100%; justify-content: center; }

/* ──────────────── FORMS ──────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.form-row   { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }

.form-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
  margin-top: 4px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.required { color: var(--red); }

input[type=text], input[type=email], input[type=date],
input[type=number], input[type=password], select, textarea {
  padding: 9px 13px;
  font-size: 13.5px;
  font-family: var(--font);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  background: var(--bg-input);
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-xs);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--blue-glow);
}

textarea { resize: vertical; }

.filter-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-row input, .filter-row select { width: auto; }

/* ──────────────── ALERTS ──────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
}

.alert-success  { background: var(--green-bg);  color: #065f46; border-color: var(--green-border); }
.alert-danger   { background: var(--red-bg);    color: #991b1b; border-color: var(--red-border); }
.alert-warning  { background: var(--amber-bg);  color: #92400e; border-color: var(--amber-border); }
.alert-info     { background: var(--blue-light);color: #1e40af; border-color: var(--blue-mid); }

.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 10px;
  font-size: 13px;
  border: 1px solid;
  transition: box-shadow 0.15s, transform 0.15s;
}

.alert-row:hover { box-shadow: var(--shadow-sm); transform: translateX(2px); }
.alert-row.alert-danger  { background: var(--red-bg);    color: #991b1b; border-color: var(--red-border); }
.alert-row.alert-warning { background: var(--amber-bg);  color: #92400e; border-color: var(--amber-border); }
.alert-row.alert-info    { background: var(--blue-light);color: #1e40af; border-color: var(--blue-mid); }

/* ──────────────── AVATARS ──────────────── */
.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
  background: var(--blue-light);
  color: var(--blue);
}

.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* ──────────────── DEPROVISION ──────────────── */
.deprov-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 8px;
  font-size: 13.5px;
  background: var(--bg-card);
  transition: all 0.15s;
}

.deprov-task:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.deprov-task.checked { background: #f8fafc; opacity: 0.6; }
.deprov-task-info { flex: 1; }

/* ──────────────── DETAIL META ──────────────── */
.detail-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--bg-page);
  border-radius: var(--r);
  border: 1px solid var(--border);
}

.detail-meta strong { color: var(--text); font-weight: 600; }

/* ──────────────── MISC ──────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.hidden        { display: none !important; }
.text-muted    { color: var(--text-3); }
.text-danger   { color: var(--red); }
.text-warning  { color: var(--amber); }
.text-success  { color: var(--green); }

/* ──────────────── PROGRESS ──────────────── */
.progress-bar { height: 7px; background: var(--bg-page); border-radius: 100px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--blue), #818cf8); transition: width 0.4s ease; }

/* ──────────────── SCROLLBAR ──────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ──────────────── ANIMATIONS ──────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.login-page::before {
  content: '';
  position: fixed;
  top: -25%;
  right: -15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(37,99,235,0.07) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: fixed;
  bottom: -25%;
  left: -15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.05) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 42px 38px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(15,23,42,0.12), 0 4px 20px rgba(15,23,42,0.08);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.3s ease;
}

.login-header { margin-bottom: 30px; text-align: center; }

.login-logo {
  width: 52px;
  height: 52px;
  background: var(--blue);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  box-shadow: var(--shadow-blue);
}

.login-title    { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.login-subtitle { font-size: 12.5px; color: var(--text-3); margin-top: 5px; font-family: var(--font-mono); }
