/* ============================================================
   SOKA CARE - BASE CSS
   Variables, Reset, Layout, Sidebar, Login Modal, SVG
   ============================================================ */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bg-body: #FFFFFF;
  --bg-subtle: #FAFAF9;
  --bg-hover: #F5F5F4;
  --bg-active: #F0EFED;
  
  --border: #E7E5E4;
  --border-strong: #D6D3D1;
  
  --text-primary: #1C1917;
  --text-secondary: #57534E;
  --text-muted: #A8A29E;
  
  --accent: #8B6F47;
  --accent-hover: #755D3A;
  --accent-light: #F5F1EA;
  --accent-border: #E8DFCD;
  --accent-text: #5C4A2F;
  
  --success: #16A34A;
  --success-bg: #F0FDF4;
  --success-border: #BBF7D0;
  
  --warning: #CA8A04;
  --warning-bg: #FEFCE8;
  --warning-border: #FDE68A;
  
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --danger-border: #FECACA;
  
  --info: #2563EB;
  --info-bg: #EFF6FF;
  --info-border: #BFDBFE;
  
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10);
  
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --sidebar-width: 240px;
  --sidebar-width-mobile: 260px;
  
  --transition: 0.15s ease;
}

/* ============================================================
   RESET
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   SVG GLOBAL — FIX UKURAN
   ============================================================ */
svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-body);
  border-right: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 0 12px;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 24px 8px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin: 0;
}

.sidebar-brand h1 span { color: var(--accent); }

.sidebar-brand p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.sidebar-menu {
  padding: 16px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.sidebar-menu a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-menu a.active {
  background: var(--accent-light);
  color: var(--accent-text);
  font-weight: 600;
}

.sidebar-menu a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 24px 32px 60px;
  max-width: 1400px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Hamburger */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-body);
  border: 1px solid var(--border);
  cursor: pointer;
  margin-bottom: 16px;
}

.hamburger svg { width: 20px; height: 20px; color: var(--text-primary); }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
  backdrop-filter: blur(2px);
}

.overlay.show { display: block; }

.hidden { display: none !important; }

/* ============================================================
   ICON SIZE OVERRIDES (per konteks)
   ============================================================ */
.btn svg { width: 16px; height: 16px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon svg { width: 16px; height: 16px; }

.card-title svg { width: 16px; height: 16px; }

.stat-card .icon-box svg { width: 22px; height: 22px; }

.action-btn svg { width: 14px; height: 14px; }

.alert-poin .title svg { width: 16px; height: 16px; }

.batch-card .batch-title svg { width: 16px; height: 16px; }

.report-card .photo-badge svg { width: 12px; height: 12px; }
.report-card .img-wrap .no-photo svg { width: 40px; height: 40px; }

.timeline-item .thumb .no-photo svg { width: 24px; height: 24px; }

.modal-close svg { width: 18px; height: 18px; }

.toast svg { width: 16px; height: 16px; }

.empty-state svg,
.trainee-empty svg { width: 48px; height: 48px; }

.photo-viewer .close-btn svg { width: 20px; height: 20px; }
.photo-viewer .nav-btn svg { width: 24px; height: 24px; }

.drop-zone .icon-upload svg { width: 20px; height: 20px; }

.info-box svg { width: 16px; height: 16px; }

.absen-notice svg { width: 18px; height: 18px; }

.detail-section h3 svg { width: 14px; height: 14px; }

.login-modal svg { width: 28px; height: 28px; }

/* ============================================================
   LOGIN MODAL
   ============================================================ */
.login-modal {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.login-modal .modal-content {
  animation: loginIn 0.3s ease;
}

@keyframes loginIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   SHAKE ANIMATION
   ============================================================ */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-width-mobile);
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  
  .main-content {
    margin-left: 0;
    padding: 16px 16px 40px;
  }
  
  .hamburger { display: flex; }
}