/* assets/css/style.css — DepEd RO V WFH System */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-900: #042C53;
  --blue-800: #0C447C;
  --blue-600: #185FA5;
  --blue-400: #378ADD;
  --blue-100: #B5D4F4;
  --blue-50:  #E6F1FB;
  --green-800: #085041;
  --green-600: #0F6E56;
  --green-400: #1D9E75;
  --green-100: #9FE1CB;
  --green-50:  #EAF3DE;
  --amber-800: #633806;
  --amber-600: #854F0B;
  --amber-400: #BA7517;
  --amber-100: #FAC775;
  --amber-50:  #FAEEDA;
  --red-800:   #791F1F;
  --red-600:   #A32D2D;
  --red-100:   #F7C1C1;
  --red-50:    #FCEBEB;
  --gray-900:  #2C2C2A;
  --gray-700:  #444441;
  --gray-500:  #5F5E5A;
  --gray-300:  #B4B2A9;
  --gray-100:  #D3D1C7;
  --gray-50:   #F1EFE8;
  --white:     #ffffff;
  --bg-page:   #F4F6FA;
  --border:    rgba(0,0,0,0.09);
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --sidebar-w: 230px;
  --font: 'Plus Jakarta Sans', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── LAYOUT ───────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }
.main-wrap   { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.page-content{ flex: 1; padding: 24px; overflow-y: auto; }

/* ── SIDEBAR ──────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(175deg, var(--blue-900) 0%, var(--blue-800) 100%);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: relative;
}
.logo-icon {
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-title { display: block; color: #fff; font-size: 14px; font-weight: 600; line-height: 1.0; }
.logo-sub   { display: block; color: rgba(255,255,255,0.5); font-size: 11px; margin-top: 10px;}

.sidebar-nav { padding: 12px 8px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.16); color: #fff; font-weight: 500; }
.nav-divider { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 10px 4px; }
.nav-label   { display: block; font-size: 10px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.8px; padding: 4px 12px 6px; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue-400);
  color: #fff;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name { display: block; color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.user-role { display: block; color: rgba(255,255,255,0.45); font-size: 10px; }
.user-info { flex: 1; min-width: 0; }
.logout-btn { color: rgba(255,255,255,0.4); text-decoration: none; padding: 4px; border-radius: 4px; display: flex; }
.logout-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ── TOPBAR ───────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
}

.topbar-title { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user  { font-size: 13px; color: var(--gray-700); font-weight: 500; }
.topbar-date  { font-size: 12px; color: var(--gray-500); }

/* ── MOBILE MENU TOGGLE (HIDDEN ON DESKTOP BY DEFAULT) ── */
.mobile-menu-toggle {
  display: none !important;
  background: none;
  border: none;
  color: var(--gray-900);
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
}

.mobile-menu-toggle:hover {
  background: var(--gray-50);
}

/* ── MOBILE SIDEBAR ── */
@media (max-width: 768px) {
  /* SHOW HAMBURGER ONLY ON MOBILE */
  .mobile-menu-toggle {
    display: block !important;
  }
  
  .app-wrapper {
    position: relative;
    overflow-x: hidden;
  }
  
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-wrap {
    margin-left: 0 !important;
    width: 100%;
  }
  
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* ── DESKTOP LAYOUT ── */
@media (min-width: 769px) {
  .sidebar {
    position: sticky !important;
    left: 0;
    flex-shrink: 0 !important;
    width: var(--sidebar-w);
    z-index: 100;
  }
  
  .main-wrap {
    margin-left: 0;
  }
}

/* ── MOBILE CLOSE BUTTON ── */
.sidebar-close {
  display: none;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  align-self: flex-start;
}

.sidebar-close:hover {
  background: rgba(255,255,255,0.25);
}

@media (max-width: 768px) {
  .sidebar-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 16px;
    right: 16px;
  }
}

/* ── ALERTS ───────────────────────────────── */
.alert {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  font-size: 13px;
  flex-shrink: 0;
}
.alert-success { background: var(--green-50); color: var(--green-800); border-bottom: 1px solid var(--green-100); }
.alert-error   { background: var(--red-50);   color: var(--red-800);   border-bottom: 1px solid var(--red-100); }
.alert-warning { background: var(--amber-50); color: var(--amber-800); border-bottom: 1px solid var(--amber-100); }
.alert-close   { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: 0.6; }

/* ── CARDS & PANELS ───────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.card-sm { padding: 14px 18px; }

.panel-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.panel-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.panel-icon-blue   { background: var(--blue-50); }
.panel-icon-green  { background: var(--green-50); }
.panel-icon-amber  { background: var(--amber-50); }
.panel-icon-red    { background: var(--red-50); }
.panel-title       { font-size: 14px; font-weight: 600; color: var(--gray-900); line-height: 1.2; }
.panel-sub         { font-size: 12px; color: var(--gray-500); }

/* ── METRIC CARDS ─────────────────────────── */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.metric-card  { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-500); margin-bottom: 8px; }
.metric-value { font-size: 30px; font-weight: 600; color: var(--gray-900); line-height: 1; }
.metric-value span { font-size: 14px; font-weight: 400; color: var(--gray-500); margin-left: 4px; }
.metric-sub   { font-size: 11px; color: var(--gray-500); margin-top: 5px; }
.metric-bar   { height: 4px; background: var(--gray-100); border-radius: 2px; margin-top: 10px; }
.metric-bar-fill { height: 100%; border-radius: 2px; background: var(--blue-600); }

/* ── BADGES ───────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-green  { background: var(--green-50);  color: var(--green-600); }
.badge-blue   { background: var(--blue-50);   color: var(--blue-800); }
.badge-amber  { background: var(--amber-50);  color: var(--amber-600); }
.badge-red    { background: var(--red-50);    color: var(--red-600); }
.badge-gray   { background: var(--gray-50);   color: var(--gray-500); }

/* ── TABLES ───────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table      { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th   { background: var(--gray-50); color: var(--gray-500); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap; }
tbody td   { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--gray-900); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

/* ── FORMS ────────────────────────────────── */
.form-group    { margin-bottom: 16px; }
.form-label    { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.form-control  {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font);
  color: var(--gray-900); background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { outline: none; border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(55,138,221,0.12); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── BUTTONS ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; border: none; text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary   { background: var(--blue-900); color: #fff; }
.btn-primary:hover { background: var(--blue-800); }
.btn-green     { background: var(--green-400); color: #fff; }
.btn-green:hover { background: var(--green-600); }
.btn-danger    { background: transparent; color: var(--red-600); border: 1px solid var(--red-100); }
.btn-danger:hover { background: var(--red-50); }
.btn-outline   { background: transparent; color: var(--blue-800); border: 1px solid var(--blue-100); }
.btn-outline:hover { background: var(--blue-50); }
.btn-sm        { padding: 6px 12px; font-size: 12px; }
.btn-block     { width: 100%; justify-content: center; }

/* ── ATTENDANCE TIMELINE ──────────────────── */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-step {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--gray-50);
}
.timeline-step.done   { background: var(--green-50); border-color: var(--green-100); }
.timeline-step.active { background: var(--blue-50);  border-color: var(--blue-100); }
.step-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100); flex-shrink: 0;
}
.step-icon.done   { background: var(--green-400); }
.step-icon.active { background: var(--blue-600); }
.step-info { margin-left: 10px; flex: 1; }
.step-name { font-size: 13px; font-weight: 600; }
.step-time { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.timeline-step.done .step-name  { color: var(--green-800); }
.timeline-step.done .step-time  { color: var(--green-600); }
.timeline-step.active .step-name{ color: var(--blue-800); }

/* ── ATTENDANCE ROW ───────────────────────── */
.attendance-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--gray-50);
  margin-bottom: 8px;
}
.attendance-row.present { background: var(--green-50); border-color: var(--green-100); }
.attendance-row.late    { background: var(--amber-50); border-color: var(--amber-100); }

/* ── PROGRESS BAR ─────────────────────────── */
.progress-wrap { margin-bottom: 16px; }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; color: var(--gray-500); }
.progress-bar  { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue-600); border-radius: 3px; transition: width 0.4s; }

/* ── CLOCK CARD ───────────────────────────── */
.clock-card {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: #fff;
}
.clock-date { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.55); margin-bottom: 6px; }
.clock-time { font-size: 42px; font-weight: 600;  font-variant-numeric: tabular-nums; }
.clock-status { margin-top: 14px; }

/* ── GRID HELPERS ─────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.mb-4   { margin-bottom: 16px; }
.mb-6   { margin-bottom: 24px; }

/* ── LOGIN PAGE ───────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 60%, #1a5fa0 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.login-logo {
  text-align: center; margin-bottom: 28px;
}
.login-logo-icon {
  width: 60px; height: 60px; background: var(--blue-50); border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.login-title { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.login-sub   { font-size: 13px; color: var(--gray-500); }
.login-error { background: var(--red-50); color: var(--red-800); border: 1px solid var(--red-100); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.login-footer{ text-align: center; font-size: 12px; color: var(--gray-500); margin-top: 16px; }

/* ── TEAM MEMBER ROW ──────────────────────── */
.member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}

/* ── PAGE HEADER ──────────────────────────── */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.page-header p  { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 768px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2       { grid-template-columns: 1fr; }
  .grid-3       { grid-template-columns: 1fr; }
  .form-row     { grid-template-columns: 1fr; }
}