/* ===== ABSENSI ONLINE - STYLE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #1e88e5;
  --primary-dark: #1565c0;
  --success: #2e7d32;
  --danger: #c62828;
  --warning: #ef6c00;
  --info: #0277bd;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #222;
  --text-muted: #777;
  --border: #e0e4ea;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); text-decoration: none; }
.container { max-width: 720px; margin: 0 auto; padding: 12px; padding-bottom: 80px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 16px; }

/* HEADER */
.app-header {
  background: var(--primary);
  color: white;
  padding: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
  display: flex; justify-content: space-between; align-items: center;
}
.app-header h1 { font-size: 18px; font-weight: 600; }
.app-header .user-info { font-size: 12px; opacity: 0.9; }

/* CARDS */
.card {
  background: var(--card); border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 15px; margin-bottom: 10px; color: var(--text); }
.card .label { font-size: 12px; color: var(--text-muted); }
.card .value { font-size: 20px; font-weight: 600; }

/* GRID */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid-4 { grid-template-columns: 1fr 1fr; } }

/* STATUS BOX */
.status-box {
  text-align: center; padding: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border-radius: 12px; margin-bottom: 12px;
}
.status-box .clock { font-size: 32px; font-weight: 700; margin: 6px 0; }
.status-box .date { font-size: 14px; opacity: 0.9; }
.status-box .status-text { font-size: 13px; margin-top: 8px; opacity: 0.95; }

/* TIMES */
.time-row { display: flex; justify-content: space-around; margin-top: 14px; }
.time-row .time-item { text-align: center; }
.time-row .time-item .lbl { font-size: 11px; opacity: 0.85; }
.time-row .time-item .val { font-size: 18px; font-weight: 600; margin-top: 2px; }

/* BUTTONS */
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 8px;
  border: none; cursor: pointer; font-size: 14px; font-weight: 600;
  text-align: center; transition: 0.15s;
}
.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-outline { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* FORM */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 4px; color: var(--text);
}
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  background: white;
}
.form-control:focus { outline: none; border-color: var(--primary); }
textarea.form-control { min-height: 80px; resize: vertical; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; background: white; }
table.table th, table.table td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
table.table th { background: #fafbfc; font-weight: 600; }
table.table tr:hover { background: #f9fbfd; }

/* BADGE */
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}
.badge-success { background: #e8f5e9; color: var(--success); }
.badge-danger { background: #ffebee; color: var(--danger); }
.badge-warning { background: #fff3e0; color: var(--warning); }
.badge-info { background: #e3f2fd; color: var(--info); }
.badge-secondary { background: #eceff1; color: #455a64; }

/* ALERT */
.alert {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px;
  font-size: 13px; border-left: 4px solid;
}
.alert-success { background: #e8f5e9; border-color: var(--success); color: #1b5e20; }
.alert-danger { background: #ffebee; border-color: var(--danger); color: #b71c1c; }
.alert-warning { background: #fff3e0; border-color: var(--warning); color: #e65100; }
.alert-info { background: #e3f2fd; border-color: var(--info); color: #01579b; }

/* BOTTOM NAV (mobile) */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: white; border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06); z-index: 100;
}
.bottom-nav a {
  flex: 1; text-align: center; padding: 8px 4px;
  color: var(--text-muted); font-size: 11px;
  display: flex; flex-direction: column; align-items: center;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a .icon { font-size: 22px; line-height: 1; }
.bottom-nav a .label { margin-top: 2px; }

/* ADMIN LAYOUT */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #1e293b; color: white;
  padding: 16px 0; min-height: 100vh; position: sticky; top: 0;
}
.sidebar .brand {
  padding: 0 16px 16px; border-bottom: 1px solid #334155;
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
}
.sidebar a {
  display: block; padding: 10px 16px; color: #cbd5e1;
  font-size: 14px; border-left: 3px solid transparent;
}
.sidebar a:hover, .sidebar a.active {
  background: #334155; color: white; border-left-color: var(--primary);
}
.main-content { flex: 1; padding: 16px; max-width: calc(100% - 220px); }
@media (max-width: 768px) {
  .sidebar { width: 100%; min-height: auto; position: relative; }
  .main-content { max-width: 100%; }
  .admin-layout { flex-direction: column; }
}

/* STAT CARD */
.stat-card {
  background: white; border-radius: 12px; padding: 16px;
  box-shadow: var(--shadow); border-left: 4px solid var(--primary);
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); }
.stat-card .stat-value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info { border-left-color: var(--info); }

/* MAP */
#map, .map-container { height: 240px; border-radius: 8px; margin: 8px 0; }

/* PHOTO PREVIEW */
.photo-preview {
  width: 100%; max-width: 320px; aspect-ratio: 4/3;
  border-radius: 8px; background: #000; object-fit: cover;
  margin: 8px 0; display: block;
}
.video-camera {
  width: 100%; max-width: 320px; aspect-ratio: 4/3;
  border-radius: 8px; background: #000; display: block;
}

/* MODAL */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.modal-bg.show { display: flex; }
.modal {
  background: white; border-radius: 12px; padding: 20px;
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 12px; }

/* UTIL */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.hidden { display: none !important; }

/* LOGIN */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  background: white; padding: 32px; border-radius: 16px;
  width: 100%; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.login-card h1 { text-align: center; font-size: 22px; margin-bottom: 4px; color: var(--primary); }
.login-card .subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
