:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #ccfbf1;
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --info: #0284c7;
  --warning: #d97706;
  --dark: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --bg: #f1f5f9;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: #0f172a; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 278px; background: linear-gradient(180deg, #064e3b 0%, #0f766e 48%, #134e4a 100%); color: white; z-index: 40; display: flex; flex-direction: column; box-shadow: 12px 0 30px rgba(15,23,42,.14); }
.brand { display: flex; gap: 12px; align-items: center; padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand strong { display: block; font-size: 17px; line-height: 1.2; }
.brand small { display: block; margin-top: 5px; opacity: .78; }
.brand-logo, .brand-logo-fallback { width: 48px; height: 48px; border-radius: 14px; object-fit: contain; background: white; padding: 5px; flex: 0 0 auto; }
.brand-logo-fallback { display: grid; place-items: center; color: var(--primary); font-weight: 900; font-size: 19px; }
.nav-menu { padding: 18px 14px; display: grid; gap: 7px; overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; color: rgba(255,255,255,.85); font-weight: 650; transition: .2s; }
.nav-link span { width: 24px; text-align: center; font-size: 18px; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.14); color: white; transform: translateX(2px); }
.sidebar-footer { margin-top: auto; padding: 18px; border-top: 1px solid rgba(255,255,255,.14); }
.user-mini { margin-bottom: 12px; }
.user-mini strong, .user-mini small { display: block; }
.user-mini small { opacity: .75; margin-top: 3px; }
.main-content { margin-left: 278px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 92px; padding: 19px 30px; display: flex; align-items: center; gap: 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 25; }
.topbar h1 { margin: 0; font-size: 24px; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.topbar-user { margin-left: auto; text-align: right; }
.topbar-user strong, .topbar-user span { display: block; }
.topbar-user span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.menu-button { display: none; border: 0; border-radius: 11px; background: var(--primary-soft); color: var(--primary-dark); width: 42px; height: 42px; cursor: pointer; }
.page-content { padding: 28px; flex: 1; }
.page-footer { padding: 18px 28px 26px; color: var(--muted); font-size: 13px; text-align: center; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card { background: var(--surface); border: 1px solid rgba(226,232,240,.9); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 19px 21px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.card-header h2, .card-header h3 { margin: 0; font-size: 18px; }
.card-body { padding: 21px; }
.card-footer { padding: 16px 21px; border-top: 1px solid var(--border); background: #f8fafc; }
.stat-card { padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 23px; background: var(--primary-soft); color: var(--primary-dark); }
.stat-content strong { display: block; font-size: 26px; }
.stat-content span { color: var(--muted); font-size: 14px; }
.hero { background: linear-gradient(135deg, #0f766e, #0f4c5c); color: white; border-radius: 24px; padding: 26px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.hero h2 { margin: 0 0 8px; font-size: 25px; }
.hero p { margin: 0; opacity: .84; line-height: 1.6; }
.hero-badge { background: rgba(255,255,255,.14); padding: 13px 16px; border-radius: 15px; text-align: center; min-width: 160px; }
.hero-badge strong { display: block; font-size: 21px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 18px; }
.toolbar .form-group { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.form-control { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 11px 13px; background: white; color: #0f172a; outline: none; transition: .2s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15,118,110,.12); }
textarea.form-control { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.45; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 10px 15px; font-weight: 750; cursor: pointer; transition: .2s; }
.btn:hover { transform: translateY(-1px); }
.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-warning { background: var(--warning); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-dark { background: var(--dark); color: white; }
.btn-outline { background: transparent; border-color: currentColor; color: inherit; }
.btn-light { background: white; color: var(--primary-dark); }
.btn-sm { padding: 7px 10px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; background: white; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f8fafc; color: #334155; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; position: sticky; top: 0; }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-secondary { background: #e2e8f0; color: #475569; }
.badge-dark { background: #334155; color: white; }
.alert { padding: 14px 16px; border-radius: 13px; margin-bottom: 16px; transition: .4s; border: 1px solid transparent; }
.alert.fade { opacity: .15; }
.alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.schedule-list { display: grid; gap: 14px; }
.schedule-item { display: grid; grid-template-columns: 92px minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 17px; border: 1px solid var(--border); border-radius: 15px; background: white; }
.schedule-time { font-weight: 850; color: var(--primary-dark); }
.schedule-main strong { display: block; font-size: 16px; }
.schedule-main span { display: block; color: var(--muted); margin-top: 5px; font-size: 13px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.camera-box { background: #0f172a; border-radius: 18px; overflow: hidden; aspect-ratio: 4/3; position: relative; }
.camera-box video, .camera-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-box img[hidden] { display: none; }
.camera-overlay { position: absolute; inset: auto 12px 12px; padding: 9px 12px; border-radius: 10px; color: white; background: rgba(15,23,42,.65); font-size: 12px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 4px; }
.tab { padding: 9px 13px; border-radius: 999px; background: white; border: 1px solid var(--border); color: var(--muted); font-weight: 700; white-space: nowrap; }
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.kpi-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.kpi-chip { border: 1px solid var(--border); background: white; border-radius: 12px; padding: 10px 12px; }
.kpi-chip strong { margin-left: 6px; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: #ecfdf5; }
.login-visual { background: linear-gradient(145deg, rgba(6,78,59,.96), rgba(15,118,110,.91)), radial-gradient(circle at 20% 20%, #5eead4, transparent 35%); color: white; padding: 60px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-visual::after { content: ''; position: absolute; width: 420px; height: 420px; border: 70px solid rgba(255,255,255,.06); border-radius: 50%; right: -150px; bottom: -130px; }
.login-visual h1 { font-size: clamp(34px, 5vw, 66px); line-height: 1.04; margin: 0 0 18px; max-width: 780px; }
.login-visual p { font-size: 18px; line-height: 1.65; max-width: 640px; opacity: .85; }
.login-points { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 28px; max-width: 620px; }
.login-point { padding: 13px 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.13); border-radius: 14px; }
.login-panel { padding: 30px; display: grid; place-items: center; }
.login-card { width: min(440px,100%); background: white; border-radius: 24px; padding: 30px; box-shadow: 0 25px 70px rgba(15,23,42,.14); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .brand-logo-fallback { box-shadow: 0 8px 20px rgba(15,118,110,.18); }
.login-card h2 { margin: 0 0 7px; }
.login-card > p { margin: 0 0 22px; color: var(--muted); }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }.mt-1 { margin-top: 8px; }.mt-2 { margin-top: 16px; }.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }.mb-1 { margin-bottom: 8px; }.mb-2 { margin-bottom: 16px; }.mb-3 { margin-bottom: 24px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 35; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); } .grid-3 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 860px) {
  .sidebar { transform: translateX(-105%); transition: .25s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .menu-button { display: inline-grid; place-items: center; }
  .topbar { padding: 15px 17px; }
  .topbar-user { display: none; }
  .page-content { padding: 18px 14px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-badge { width: 100%; }
  .schedule-item { grid-template-columns: 78px minmax(0,1fr); }
  .schedule-item .actions { grid-column: 1/-1; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { padding: 34px 24px; min-height: 320px; }
  .login-visual h1 { font-size: 37px; }
  .login-points { grid-template-columns: 1fr 1fr; }
  .login-panel { padding: 20px 14px 35px; }
}
@media (max-width: 520px) {
  .topbar h1 { font-size: 19px; }
  .topbar p { font-size: 12px; }
  .card-body, .card-header { padding: 16px; }
  .stat-card { padding: 16px; }
  .schedule-item { grid-template-columns: 1fr; gap: 8px; }
  .schedule-item .actions { grid-column: auto; }
  .login-points { grid-template-columns: 1fr; }
  .login-card { padding: 22px 18px; border-radius: 20px; }
}
@media print {
  .sidebar, .topbar, .page-footer, .toolbar, .btn, .sidebar-overlay { display: none !important; }
  .main-content { margin: 0; }
  .page-content { padding: 0; }
  .card { box-shadow: none; border: 0; }
}


/* =========================================================
   LOGIN PROFESIONAL — KOMPATIBEL DENGAN INDEX.PHP
   ========================================================= */

.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 10%, rgba(45, 212, 191, .22), transparent 32%),
    radial-gradient(circle at 90% 90%, rgba(14, 165, 233, .13), transparent 34%),
    linear-gradient(145deg, #ecfdf5 0%, #f0fdfa 46%, #f8fafc 100%);
}

.login-body .login-page {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: transparent;
}

.login-bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(2px);
}

.login-bg-shape-one {
  width: 340px;
  height: 340px;
  top: -170px;
  right: -110px;
  background: rgba(20, 184, 166, .14);
}

.login-bg-shape-two {
  width: 420px;
  height: 420px;
  bottom: -230px;
  left: -180px;
  background: rgba(14, 165, 233, .09);
}

.login-body .login-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.login-body .login-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow:
    0 26px 70px rgba(15, 118, 110, .15),
    0 8px 24px rgba(15, 23, 42, .07);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.login-body .login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 25px;
}

.login-body .login-brand .brand-logo,
.login-body .login-brand .brand-logo-fallback {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 15px;
  box-shadow: 0 9px 22px rgba(15, 118, 110, .15);
}

.login-brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.login-brand-copy strong {
  display: block;
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-brand-copy small {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.login-heading {
  margin-bottom: 23px;
}

.login-badge {
  display: inline-flex;
  margin-bottom: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #115e59;
  background: #ccfbf1;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.login-body .login-card h1 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 28px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -.5px;
}

.login-heading p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.login-alert {
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.login-form-group {
  margin-bottom: 17px;
}

.login-form-group label {
  margin-bottom: 8px;
  color: #25324a;
  font-size: 13px;
  font-weight: 800;
}

.login-input-wrap {
  position: relative;
}

.login-input-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 14px;
  display: flex;
  color: #94a3b8;
  transform: translateY(-50%);
  pointer-events: none;
}

.login-control {
  min-height: 50px;
  padding: 12px 14px 12px 46px;
  border: 1.5px solid #dbe5e4;
  border-radius: 13px;
  background: #fbfefd;
  font-size: 14px;
  font-weight: 550;
}

.login-control::placeholder {
  color: #a3afbd;
  font-weight: 450;
}

.login-control:focus {
  border-color: #0f766e;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}

.login-input-wrap:focus-within .login-input-icon {
  color: #0f766e;
}

.login-password-control {
  padding-right: 50px;
}

.login-password-toggle {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 7px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  color: #0f766e;
  background: #ecfdf5;
  outline: none;
}

.login-submit {
  min-height: 52px;
  margin-top: 6px;
  border-radius: 13px;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  box-shadow: 0 12px 24px rgba(15, 118, 110, .24);
  font-size: 14px;
}

.login-submit:hover {
  background: linear-gradient(135deg, #115e59, #0f766e);
  box-shadow: 0 15px 28px rgba(15, 118, 110, .28);
}

.login-roles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
}

.login-roles span {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #526174;
  background: #f8fafc;
  font-size: 10px;
  font-weight: 700;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid #edf2f1;
  color: #8a97a7;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 600px) {
  .login-body .login-page {
    padding:
      max(14px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .login-body .login-card {
    max-width: 100%;
    padding: 24px 20px;
    border-radius: 20px;
  }

  .login-body .login-brand {
    margin-bottom: 21px;
  }

  .login-body .login-brand .brand-logo,
  .login-body .login-brand .brand-logo-fallback {
    width: 47px;
    height: 47px;
    flex-basis: 47px;
    border-radius: 13px;
  }

  .login-brand-copy strong {
    font-size: 14px;
  }

  .login-brand-copy small {
    font-size: 11px;
  }

  .login-body .login-card h1 {
    font-size: 25px;
  }

  .login-heading p {
    font-size: 13px;
  }

  .login-control {
    min-height: 50px;
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .login-body .login-card {
    padding: 21px 16px;
    border-radius: 18px;
  }

  .login-body .login-brand {
    gap: 10px;
  }

  .login-body .login-card h1 {
    font-size: 23px;
  }

  .login-roles span {
    padding: 4px 7px;
    font-size: 9px;
  }
}

@media (max-height: 700px) {
  .login-body .login-page {
    align-items: flex-start;
    overflow-y: auto;
  }

  .login-body .login-card {
    margin-top: 2px;
    margin-bottom: 2px;
  }
}
