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

:root {
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --brand-darker: #115e59;
  --brand-light: #ccfbf1;
  --brand-soft: #f0fdfa;
  --navy: #0f172a;
  --navy-soft: #1e293b;
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --info: #2563eb;
  --bg-soft: #f6f8f9;
  --border-soft: #e6ebee;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg-soft);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .fw-bold, .brand-font {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

/* ============ NAVBAR ============ */
.app-navbar {
  background: linear-gradient(120deg, var(--navy) 0%, var(--brand-darker) 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  padding: .65rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.app-navbar .navbar-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-navbar .navbar-brand .brand-badge {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
}

.app-navbar .badge.role-badge {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,.25);
}

/* ============ LAYOUT ============ */
.app-wrapper {
  display: flex;
  min-height: calc(100vh - 64px);
}

.app-sidebar {
  width: 245px;
  background: #fff;
  border-right: 1px solid var(--border-soft);
  flex-shrink: 0;
  padding-top: 6px;
}

.app-sidebar .nav-section-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  font-weight: 700;
  padding: 14px 16px 4px;
}

.app-sidebar .nav-link {
  color: #475569;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 2px 10px;
  font-size: .89rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: all .15s ease;
  position: relative;
}

.app-sidebar .nav-link i { font-size: 1rem; opacity: .8; }

.app-sidebar .nav-link:hover {
  background: var(--brand-soft);
  color: var(--brand-darker);
}

.app-sidebar .nav-link.active {
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(13,148,136,.28);
}
.app-sidebar .nav-link.active i { opacity: 1; }

.app-content {
  flex: 1;
  padding: 28px 30px;
  min-width: 0;
}

/* ============ CARDS ============ */
.card-stat {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: #fff;
  transition: box-shadow .2s ease, transform .2s ease;
}

.card-stat:hover { box-shadow: var(--shadow-md); }

.card-stat .icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 6px 14px rgba(13,148,136,.25);
  flex-shrink: 0;
}

.stat-trend {
  font-size: .74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stat-trend.up { background: #dcfce7; color: #15803d; }
.stat-trend.down { background: #fee2e2; color: #b91c1c; }
.stat-trend.neutral { background: #f1f5f9; color: #64748b; }

/* ============ BUTTONS ============ */
.btn-brand {
  background: linear-gradient(120deg, var(--brand), var(--brand-dark));
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13,148,136,.28);
  transition: all .15s ease;
}
.btn-brand:hover {
  background: linear-gradient(120deg, var(--brand-dark), var(--brand-darker));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(13,148,136,.35);
}
.btn-brand:active { transform: translateY(0); }

.btn-outline-secondary, .btn-outline-primary, .btn-outline-danger, .btn-outline-success {
  border-radius: 9px;
}

/* ============ TABLES ============ */
.table thead.table-light th {
  background: var(--brand-soft);
  color: var(--brand-darker);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: none;
  padding: 12px 10px;
}
.table td { padding: 10px; vertical-align: middle; font-size: .89rem; }
.table-hover tbody tr:hover { background: var(--brand-soft); }

.badge { font-weight: 600; padding: .4em .7em; border-radius: 7px; }

/* ============ FORMS ============ */
.form-control, .form-select {
  border-radius: 9px;
  border: 1.5px solid var(--border-soft);
  padding: .55rem .8rem;
  font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13,148,136,.13);
}
.form-label { font-weight: 600; font-size: .85rem; color: var(--text-main); margin-bottom: 5px; }

/* ============ LOGIN PAGE ============ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  background: var(--navy);
}

.login-visual {
  flex: 1.1;
  background:
    radial-gradient(circle at 20% 20%, rgba(13,148,136,.35), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(245,158,11,.18), transparent 40%),
    linear-gradient(150deg, var(--navy) 0%, var(--brand-darker) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.login-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .5;
}

.login-visual .lv-content { position: relative; z-index: 1; max-width: 460px; }

.login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 40px;
}

.login-card { max-width: 400px; width: 100%; }

.login-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.login-feature .lf-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 991.98px) {
  .login-visual { display: none; }
}

/* ============ ATTENDANCE / QR ============ */
#qr-reader, #selfie-wrap {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
}

.dimensi-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--brand-soft);
  color: var(--brand-darker);
  border: 1px solid var(--brand-light);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 600;
  margin: 2px 3px 2px 0;
}
.dimensi-chip.danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.dimensi-chip.warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }

.foto-thumb {
  width: 42px; height: 42px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-soft);
  cursor: pointer;
}

/* ============ MOBILE SIDEBAR ============ */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 58px;
    left: -260px;
    height: calc(100vh - 58px);
    z-index: 1030;
    box-shadow: var(--shadow-lg);
    transition: left .22s ease;
  }
  .app-sidebar.show { left: 0; }
}

footer.app-footer {
  color: #94a3b8;
  font-size: .8rem;
}
