/* =========================================================
   ios-style.css - Gaya antarmuka iOS/Apple untuk Absensi
   Mobile-first, glassmorphism, rounded, soft shadows.
   ========================================================= */
:root {
  --ios-blue: #007AFF;
  --ios-blue-dark: #005ecb;
  --ios-green: #34C759;
  --ios-red: #FF3B30;
  --ios-orange: #FF9500;
  --ios-gray: #8E8E93;
  --ios-bg: #F2F2F7;
  --ios-card: rgba(255, 255, 255, 0.78);
  --ios-border: rgba(60, 60, 67, 0.12);
  --ios-text: #1C1C1E;
  --ios-muted: #6C6C70;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-soft: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.06);
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #e9eef7 0%, var(--ios-bg) 40%, #f7f7fb 100%);
  color: var(--ios-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px; /* ruang untuk bottom nav mobile */
}

/* Glass card */
.ios-card {
  background: var(--ios-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.ios-card-header {
  padding: 16px 20px 8px;
  font-weight: 600;
  font-size: 1.05rem;
}

.ios-card-body { padding: 16px 20px 20px; }

/* Metric cards (dashboard) */
.metric-card {
  background: var(--ios-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255,255,255,0.6);
}
.metric-card .metric-label { color: var(--ios-muted); font-size: 0.85rem; }
.metric-card .metric-value { font-size: 1.9rem; font-weight: 700; color: var(--ios-text); }
.metric-card .metric-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem;
}

/* Tombol iOS */
.btn-ios {
  border-radius: 14px;
  padding: 10px 18px;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 8px rgba(0,122,255,0.25);
}
.btn-ios-primary { background: var(--ios-blue); color: #fff; }
.btn-ios-primary:hover { background: var(--ios-blue-dark); color: #fff; }
.btn-ios-secondary { background: #e5e5ea; color: var(--ios-text); box-shadow: none; }
.btn-ios-danger { background: var(--ios-red); color: #fff; box-shadow: 0 2px 8px rgba(255,59,48,0.25); }

/* Form input iOS */
.form-control, .form-select {
  border-radius: 14px;
  border: 1px solid var(--ios-border);
  padding: 12px 14px;
  background: rgba(255,255,255,0.9);
}
.form-control:focus, .form-select:focus {
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.15);
}

/* List/grouped list ala iOS */
.ios-list {
  background: var(--ios-card);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255,255,255,0.6);
}
.ios-list-item {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ios-border);
  gap: 12px;
}
.ios-list-item:last-child { border-bottom: none; }
.ios-list-item .title { font-weight: 600; }
.ios-list-item .subtitle { font-size: 0.85rem; color: var(--ios-muted); }

/* Segmented control untuk status absensi */
.segmented {
  display: inline-flex;
  background: #e5e5ea;
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.segmented input { display: none; }
.segmented label {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ios-muted);
  cursor: pointer;
  margin: 0;
  transition: all .15s ease;
  user-select: none;
  min-width: 64px;
  text-align: center;
}
.segmented input:checked + label.seg-hadir { background: var(--ios-green); color: #fff; }
.segmented input:checked + label.seg-izin  { background: var(--ios-orange); color: #fff; }
.segmented input:checked + label.seg-alpa  { background: var(--ios-red); color: #fff; }

/* Top navbar glass */
.navbar-ios {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ios-border);
}

/* Bottom navigation (mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 70px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--ios-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1030;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  text-decoration: none;
  color: var(--ios-gray);
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: 500;
}
.bottom-nav a .bi { font-size: 1.35rem; }
.bottom-nav a.active { color: var(--ios-blue); }

/* Tabel iOS style */
.table-ios {
  background: var(--ios-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-ios thead th {
  background: rgba(242,242,247,0.8);
  color: var(--ios-muted);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
}
.table-ios td { vertical-align: middle; border-color: var(--ios-border); }

/* Badge status */
.badge-hadir { background: rgba(52,199,89,0.15); color: #1f8a3b; }
.badge-izin  { background: rgba(255,149,0,0.15); color: #a86400; }
.badge-alpa  { background: rgba(255,59,48,0.15); color: #b3261e; }

/* Login hero */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card { width: 100%; max-width: 420px; }
.app-logo {
  width: 72px; height: 72px; border-radius: 20px;
  background: linear-gradient(135deg, var(--ios-blue), #5ac8fa);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2rem;
  box-shadow: 0 10px 25px rgba(0,122,255,0.35);
}

.page-title { font-weight: 700; font-size: 1.6rem; letter-spacing: -0.3px; }
.section-title { font-weight: 600; font-size: 1.05rem; color: var(--ios-muted); margin-bottom: 10px; }

/* ===== Admin Sidebar Layout ===== */
.admin-layout { min-height: 100vh; }
.admin-sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid var(--ios-border);
  padding: 18px 14px;
  z-index: 1040;
  display: flex;
  flex-direction: column;
}
.admin-sidebar .brand {
  font-weight: 700;
  font-size: 1.15rem;
  padding: 6px 10px 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--ios-text);
  text-decoration: none;
}
.admin-sidebar .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--ios-text);
  font-weight: 500;
  margin-bottom: 4px;
  text-decoration: none;
}
.admin-sidebar .nav-link .bi { font-size: 1.1rem; color: var(--ios-gray); }
.admin-sidebar .nav-link:hover { background: rgba(0,0,0,0.04); }
.admin-sidebar .nav-link.active {
  background: rgba(0,122,255,0.12);
  color: var(--ios-blue);
}
.admin-sidebar .nav-link.active .bi { color: var(--ios-blue); }
.admin-sidebar .sidebar-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--ios-border); }
.admin-content {
  margin-left: var(--sidebar-width);
  padding: 18px 18px 30px;
  min-height: 100vh;
}
.admin-topbar {
  display: none;
  position: sticky; top: 0; z-index: 1035;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ios-border);
  padding: 10px 14px;
  align-items: center; justify-content: space-between;
}
.sidebar-overlay { display: none; }

@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-soft);
  }
  .admin-sidebar.show { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 1039;
  }
  .sidebar-overlay.show { display: block; }
  .admin-content { margin-left: 0; padding: 14px; }
  .admin-topbar { display: flex; }
  body.has-bottom-nav { padding-bottom: 24px; }
}

@media (min-width: 992px) {
  body.has-bottom-nav { padding-bottom: 24px; }
  .bottom-nav { display: none; }
}

@media print {
  .admin-sidebar, .admin-topbar, .sidebar-overlay, .bottom-nav, .navbar-ios, .no-print { display: none !important; }
  .admin-content { margin-left: 0; padding: 0; }
  body { background: #fff; padding: 0; }
  .ios-card, .ios-list { box-shadow: none; backdrop-filter: none; }
}
