/* ============================================================
   Zensuu Ryouhin (ZR) System — Stylesheet
   PT. Setia Guna Sejati
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Source+Sans+3:wght@300;400;600&family=Source+Code+Pro:wght@400;600&display=swap');

:root {
  --primary: #1a3a5c;
  --primary-light: #2563a8;
  --accent: #c8960c;
  --accent-light: #f0b429;
  --danger: #c0392b;
  --success: #1a7a4a;
  --warning: #d97706;
  --info: #2563a8;
  --surface: #f5f7fa;
  --surface2: #eef1f6;
  --border: #cbd5e1;
  --text: #1e293b;
  --text-muted: #64748b;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(26,58,92,0.12);
  --radius: 8px;
}

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

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================= LOGIN / MFA SCREENS ================= */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f2342 0%, #1a3a5c 50%, #0e4d8a 100%);
  position: relative;
  overflow: hidden;
}
.auth-screen::before, .auth-screen::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(200,150,12,0.15);
}
.auth-screen::before { width: 600px; height: 600px; top: -200px; right: -200px; }
.auth-screen::after  { width: 400px; height: 400px; bottom: -150px; left: -150px; border-color: rgba(200,150,12,0.1); }

.auth-card {
  background: rgba(255,255,255,0.97);
  border-radius: 16px;
  padding: 40px 48px;
  width: 420px;
  max-width: 92vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  position: relative; z-index: 1;
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.company-name {
  font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--primary); letter-spacing: 2px; text-transform: uppercase;
}
.app-title { font-family: 'Rajdhani', sans-serif; font-size: 24px; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.app-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-family: inherit; background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary-light);
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.btn {
  display: inline-block; padding: 10px 20px; border-radius: var(--radius);
  border: none; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; text-align: center;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-light); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; display:none; }
.alert.error   { display:block; background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.alert.warning { display:block; background: #fff7e6; color: var(--warning); border: 1px solid #fde3a7; }
.alert.success { display:block; background: #e8f6ee; color: var(--success); border: 1px solid #b9e4cb; }
.alert.info    { display:block; background: #eaf2fb; color: var(--info); border: 1px solid #c6def7; }

.pin-inputs { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.pin-inputs input {
  width: 44px; height: 54px; text-align: center; font-size: 22px; font-weight: 600;
  border: 1.5px solid var(--border); border-radius: var(--radius);
}
.auth-footer-link { text-align: center; margin-top: 14px; font-size: 12.5px; }

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

.sidebar {
  width: 250px; background: var(--primary); color: rgba(255,255,255,0.88);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-header { padding: 20px 18px; display:flex; align-items:center; gap:10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-title { font-family:'Rajdhani',sans-serif; font-weight:700; font-size:17px; color:#fff; letter-spacing:0.5px; }
.sidebar-subtitle { font-size: 10px; color: rgba(255,255,255,0.55); letter-spacing:0.5px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-section-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.4); padding: 14px 18px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px; cursor: pointer;
  border-left: 3px solid transparent; font-size: 13.5px; color: rgba(255,255,255,0.82);
}
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { border-left-color: var(--accent); }
.nav-icon { width: 18px; text-align: center; }
.nav-badge {
  margin-left: auto; font-size: 10px; background: rgba(255,255,255,0.15);
  padding: 1px 6px; border-radius: 10px;
}
.sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-info { display:flex; align-items:center; gap:10px; margin-bottom: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display:flex; align-items:center; justify-content:center; font-weight:700; flex-shrink:0;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.55); }
.btn-logout {
  width: 100%; padding: 8px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.25);
  background: transparent; color: #fff; cursor: pointer; font-size: 12.5px;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); }

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px; flex-shrink: 0;
}
.topbar-title { font-family:'Rajdhani',sans-serif; font-weight: 700; font-size: 18px; color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.session-timer { font-size: 11.5px; color: var(--text-muted); display:flex; align-items:center; gap:6px; }
.timer-dot { width:7px; height:7px; border-radius:50%; background: var(--success); }
.timer-dot.warning { background: var(--danger); animation: pulse 1s infinite; }
.session-timer.warning { color: var(--danger); font-weight:600; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.35;} }

.page-content { padding: 22px; overflow-y: auto; position: relative; }

/* ================= CARDS / TABLES ================= */
.card { background:#fff; border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.card-header h3 { font-family:'Rajdhani',sans-serif; font-size:16px; color: var(--primary); }
.card-body { padding: 18px; }

.kpi-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:18px; }
.kpi-box { background:#fff; border:1px solid var(--border); border-radius: var(--radius); padding:16px; box-shadow: var(--shadow); }
.kpi-box .kpi-value { font-family:'Rajdhani',sans-serif; font-size: 30px; font-weight:700; color: var(--primary); }
.kpi-box .kpi-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing:0.4px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th, table.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.data-table thead th { background: var(--surface2); color: var(--text-muted); font-size:11.5px; text-transform:uppercase; letter-spacing:0.4px; position: sticky; top:0; }
table.data-table tbody tr:hover { background: #fafbfc; }
.table-scroll { overflow-x: auto; }
.item-link { cursor: pointer; color: var(--primary-light); font-weight:600; }
.item-link:hover { text-decoration: underline; }

.badge { display:inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight:600; }
.badge-success { background:#e8f6ee; color: var(--success); }
.badge-muted   { background:#eef1f6; color: var(--text-muted); }
.badge-warning { background:#fff7e6; color: var(--warning); }
.badge-danger  { background:#fdecea; color: var(--danger); }
.badge-info    { background:#eaf2fb; color: var(--info); }
.badge-outline { background:#fff; border:1px solid var(--border); color:var(--text-muted); }

.tag-step { display:inline-block; background: var(--primary); color:#fff; font-size:10.5px; padding:2px 8px; border-radius:4px; margin-right:4px; }

.pill-o { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; border:2px solid var(--primary); color:var(--primary); font-weight:700; font-size:12px; }

/* ================= FORMS / MISC ================= */
.toolbar { display:flex; gap:10px; align-items:center; margin-bottom: 14px; flex-wrap:wrap; }
.toolbar .spacer { flex:1; }
.search-box input { padding: 8px 12px; border:1.5px solid var(--border); border-radius: var(--radius); font-size:13px; min-width:220px; }

.step-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom: 16px; }
.step-tab {
  padding: 7px 14px; border-radius: 20px; font-size:12.5px; font-weight:600; cursor:pointer;
  border: 1.5px solid var(--border); color: var(--text-muted); background:#fff;
}
.step-tab.active { background: var(--primary); border-color: var(--primary); color:#fff; }

.progress-bar { height: 8px; background: var(--surface2); border-radius: 6px; overflow:hidden; }
.progress-bar > div { height:100%; background: var(--success); }

/* ================= MODAL ================= */
.modal-overlay {
  display:none; position: fixed; inset:0; background: rgba(15,23,42,0.55); z-index: 1000;
  align-items:center; justify-content:center;
}
.modal-overlay.open { display:flex; }
.modal { background:#fff; border-radius: var(--radius); width: 520px; max-width: 92vw; max-height: 88vh; overflow-y:auto; box-shadow: 0 24px 64px rgba(0,0,0,0.35); }
.modal-header { padding: 16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.modal-header h3 { font-family:'Rajdhani',sans-serif; color:var(--primary); font-size:16px; }
.modal-close { cursor:pointer; font-size: 20px; color: var(--text-muted); background:none; border:none; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }

/* ================= DASHBOARD WATERMARK / SCREENSHOT DETERRENCE ================= */
.watermark-layer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.watermark-tile {
  position:absolute;
  color: rgba(192, 57, 43, 0.13);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  transform: rotate(-32deg);
  user-select: none;
}
.confidential-guard { -webkit-user-select:none; user-select:none; }
.confidential-guard img { pointer-events: none; }
.blur-guard.active { filter: blur(14px) brightness(0.6); transition: filter .15s ease; }
.screenshot-warning-overlay {
  display:none; position: fixed; inset:0; background: rgba(15,23,42,0.94); color:#fff;
  z-index: 9999; align-items:center; justify-content:center; text-align:center; padding: 40px;
  font-family:'Rajdhani',sans-serif;
}
.screenshot-warning-overlay.show { display:flex; flex-direction:column; }
.screenshot-warning-overlay h2 { font-size: 26px; margin-bottom: 10px; }

@media print {
  body::before {
    content: "PRINTING DISABLED — CONFIDENTIAL DOCUMENT";
    position: fixed; top:50%; left:0; right:0; text-align:center; font-size:28px; color:#c0392b;
  }
  .app-shell, .sidebar, .page-content, table, img { display:none !important; }
}

/* ================= UTILITIES ================= */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-2 { margin-top: 10px; } .mt-3 { margin-top: 16px; } .mb-2 { margin-bottom: 10px; }
.flex { display:flex; } .items-center { align-items:center; } .gap-2 { gap:8px; } .gap-3 { gap:14px; }
.small { font-size: 12px; }
.hidden { display:none !important; }
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 210px; }
}
