/* ============================================================
   YICA School Management System — Custom Stylesheet
   Colours: Deep Navy #0B2545 | Gold #C8992A | White | Soft Gray
   ============================================================ */

:root {
  --yica-navy:   #0B2545;
  --yica-navy2:  #153E70;
  --yica-gold:   #C8992A;
  --yica-gold2:  #F0BC4A;
  --yica-light:  #F4F7FB;
  --yica-border: #E0E6EF;
  --sidebar-w:   240px;
  --topbar-h:    58px;
}

/* ─── RESET / BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--yica-light); font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; color: #1a2533; }
a { color: var(--yica-navy2); text-decoration: none; }
a:hover { color: var(--yica-gold); }

/* ─── TOPBAR ────────────────────────────────────────────── */
.yica-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1040;
  height: var(--topbar-h);
  background: var(--yica-navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.yica-topbar .navbar-brand { color: #fff; }
.yica-topbar .btn-light { background: rgba(255,255,255,.1); border: none; color: #fff; }
.yica-topbar .btn-light:hover { background: rgba(255,255,255,.2); }
.yica-logo-badge {
  width: 34px; height: 34px; background: var(--yica-gold);
  border-radius: 8px; display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: var(--yica-navy);
}
.yica-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--yica-gold); color: var(--yica-navy);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.yica-user-btn { background: rgba(255,255,255,.1); border: none; color: #fff; border-radius: 20px; padding: 4px 10px 4px 4px; }
.yica-user-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ─── LAYOUT ────────────────────────────────────────────── */
.yica-wrapper { display: flex; min-height: 100vh; padding-top: var(--topbar-h); }

/* ─── SIDEBAR ───────────────────────────────────────────── */
.yica-sidebar {
  width: var(--sidebar-w); min-height: calc(100vh - var(--topbar-h));
  background: var(--yica-navy); position: fixed;
  top: var(--topbar-h); left: 0; bottom: 0;
  overflow-y: auto; z-index: 1030;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
.yica-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: rgba(255,255,255,.75);
  font-size: 13px; transition: all .15s; border-left: 3px solid transparent;
}
.yica-nav a:hover, .yica-nav a.active {
  background: rgba(255,255,255,.08); color: #fff;
  border-left-color: var(--yica-gold);
}
.yica-nav a svg { width: 15px; height: 15px; flex-shrink: 0; }
.yica-nav .nav-section {
  padding: 16px 20px 6px; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; color: rgba(255,255,255,.35); text-transform: uppercase;
}
.yica-nav .nav-badge {
  margin-left: auto; background: var(--yica-gold); color: var(--yica-navy);
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
}

/* ─── MAIN CONTENT ──────────────────────────────────────── */
.yica-content {
  margin-left: var(--sidebar-w);
  flex: 1; padding: 24px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ─── PAGE HEADER ───────────────────────────────────────── */
.yica-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.yica-page-header h1 { font-size: 20px; font-weight: 600; color: var(--yica-navy); margin: 0; }
.yica-page-header .breadcrumb { font-size: 12px; margin: 0; }

/* ─── STAT CARDS ────────────────────────────────────────── */
.yica-stat-card {
  background: #fff; border-radius: 12px; padding: 20px;
  border: 1px solid var(--yica-border);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  display: flex; align-items: flex-start; gap: 14px; height: 100%;
}
.yica-stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.yica-stat-card .stat-icon svg { width: 22px; height: 22px; }
.yica-stat-card .stat-value { font-size: 26px; font-weight: 700; line-height: 1; color: var(--yica-navy); }
.yica-stat-card .stat-label { font-size: 12px; color: #6b7a8d; margin-top: 4px; }
.yica-stat-card .stat-trend { font-size: 11px; margin-top: 6px; }

.icon-bg-blue   { background: #EBF3FF; color: #1a6fc4; }
.icon-bg-green  { background: #E8F8F0; color: #1a9c5c; }
.icon-bg-gold   { background: #FEF6E4; color: #C8992A; }
.icon-bg-red    { background: #FEE8E8; color: #c43a3a; }
.icon-bg-purple { background: #F0EBFF; color: #6b3fc4; }
.icon-bg-teal   { background: #E5F7F7; color: #1a8c8c; }

/* ─── CARDS ─────────────────────────────────────────────── */
.yica-card {
  background: #fff; border-radius: 12px;
  border: 1px solid var(--yica-border);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  overflow: hidden;
}
.yica-card .card-header {
  padding: 14px 18px; background: #fff;
  border-bottom: 1px solid var(--yica-border);
  display: flex; align-items: center; justify-content: space-between;
}
.yica-card .card-header h5 { font-size: 14px; font-weight: 600; margin: 0; color: var(--yica-navy); }
.yica-card .card-body { padding: 18px; }

/* ─── TABLES ────────────────────────────────────────────── */
.yica-table thead th {
  background: var(--yica-navy); color: #fff;
  font-size: 12px; font-weight: 600; padding: 10px 12px;
  text-transform: uppercase; letter-spacing: .04em; border: none;
}
.yica-table tbody td { padding: 10px 12px; vertical-align: middle; border-color: var(--yica-border); }
.yica-table tbody tr:hover { background: #f8fafd; }
table.dataTable thead th { background: var(--yica-navy) !important; color: #fff !important; border: none !important; }
table.dataTable thead th::after, table.dataTable thead th::before { color: rgba(255,255,255,.5) !important; }

/* ─── FORMS ─────────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--yica-border); font-size: 13px;
  border-radius: 8px; padding: 8px 12px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--yica-navy2);
  box-shadow: 0 0 0 3px rgba(21,62,112,.15);
}
.form-label { font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn-yica {
  background: var(--yica-navy); color: #fff;
  border: none; border-radius: 8px; padding: 8px 18px;
  font-size: 13px; font-weight: 500; transition: all .15s;
}
.btn-yica:hover { background: var(--yica-navy2); color: #fff; }
.btn-gold {
  background: var(--yica-gold); color: var(--yica-navy);
  border: none; border-radius: 8px; padding: 8px 18px;
  font-size: 13px; font-weight: 600;
}
.btn-gold:hover { background: var(--yica-gold2); color: var(--yica-navy); }
.btn { border-radius: 8px; font-size: 13px; padding: 7px 14px; }

/* ─── ALERTS ────────────────────────────────────────────── */
.alert { border-radius: 10px; font-size: 13px; border-width: 0; }
.alert-success { background: #e8f8f0; color: #0f5132; }
.alert-error, .alert-danger { background: #fee8e8; color: #842029; }
.alert-warning { background: #fff8e1; color: #664d03; }
.alert-info    { background: #e7f0fe; color: #084298; }

/* ─── BADGES ────────────────────────────────────────────── */
.badge { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 3px 8px; }

/* ─── STATUS BADGES ─────────────────────────────────────── */
.status-pending   { background: #fff8e1; color: #b45309; }
.status-approved  { background: #e8f8f0; color: #065f46; }
.status-rejected  { background: #fee8e8; color: #991b1b; }
.status-disbursed { background: #e7f0fe; color: #1e40af; }
.status-completed { background: #e8f8f0; color: #065f46; }
.status-partial   { background: #fff8e1; color: #b45309; }
.status-verified  { background: #e8f8f0; color: #065f46; }
.status-director  { background: linear-gradient(135deg, var(--yica-navy), var(--yica-navy2)); color: #fff; }

/* ─── DIRECTOR SPECIAL STYLING ──────────────────────────── */
.director-only-banner {
  background: linear-gradient(135deg, var(--yica-navy) 0%, #1a4a8a 100%);
  color: #fff; border-radius: 12px; padding: 14px 20px;
  margin-bottom: 20px; display: flex; align-items: center; gap: 12px;
  border-left: 4px solid var(--yica-gold);
}
.director-only-banner svg { width: 20px; height: 20px; color: var(--yica-gold); flex-shrink: 0; }
.pl-positive { color: #0f7a3c; font-weight: 700; }
.pl-negative { color: #c43a3a; font-weight: 700; }

/* ─── P&L CARDS ─────────────────────────────────────────── */
.pl-card {
  border-radius: 14px; padding: 22px; color: #fff; height: 100%;
}
.pl-card.income     { background: linear-gradient(135deg, #0f7a3c, #1fa855); }
.pl-card.expenditure{ background: linear-gradient(135deg, #b91c1c, #e03131); }
.pl-card.balance    { background: linear-gradient(135deg, var(--yica-navy), var(--yica-navy2)); }
.pl-card.outstanding{ background: linear-gradient(135deg, #92400e, #d97706); }
.pl-card .pl-amount { font-size: 28px; font-weight: 700; }
.pl-card .pl-label  { font-size: 12px; opacity: .85; }

/* ─── EXPENDITURE TIMELINE ──────────────────────────────── */
.exp-timeline { position: relative; padding-left: 24px; }
.exp-timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--yica-border); }
.exp-timeline-item { position: relative; margin-bottom: 16px; }
.exp-timeline-dot {
  position: absolute; left: -20px; top: 4px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--yica-navy); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--yica-border);
}
.exp-timeline-dot.approved  { background: #0f7a3c; }
.exp-timeline-dot.rejected  { background: #c43a3a; }
.exp-timeline-dot.disbursed { background: #1d4ed8; }
.exp-timeline-dot.cancelled { background: #6b7280; }

/* ─── RECEIPT UPLOAD ZONE ───────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--yica-border); border-radius: 12px;
  padding: 30px; text-align: center; cursor: pointer;
  transition: all .2s; background: #fafbfd;
}
.upload-zone:hover { border-color: var(--yica-navy2); background: #f0f5ff; }
.upload-zone.dragover { border-color: var(--yica-gold); background: #fffbea; }
.upload-zone svg { width: 40px; height: 40px; color: #aab4c4; margin-bottom: 10px; }

/* ─── LOGIN PAGE ────────────────────────────────────────── */
.yica-login-page {
  min-height: 100vh; background: var(--yica-navy);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.yica-login-card {
  background: #fff; border-radius: 18px; padding: 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.yica-login-logo {
  width: 60px; height: 60px; background: var(--yica-gold);
  border-radius: 16px; display: grid; place-items: center;
  font-size: 28px; font-weight: 700; color: var(--yica-navy);
  margin: 0 auto 20px;
}
.yica-login-card h2 { font-size: 22px; font-weight: 700; color: var(--yica-navy); margin-bottom: 4px; }
.yica-login-card .login-subtitle { color: #6b7a8d; font-size: 13px; margin-bottom: 28px; }
.yica-login-card .btn-yica { width: 100%; padding: 12px; font-size: 15px; font-weight: 600; }
.yica-login-card .form-control { padding: 11px 14px; }

/* ─── ATTENDANCE GRID ───────────────────────────────────── */
.att-present  { background: #e8f8f0; color: #0f5132; }
.att-absent   { background: #fee8e8; color: #842029; }
.att-late     { background: #fff8e1; color: #664d03; }
.att-excused  { background: #e7f0fe; color: #084298; }

/* ─── REPORT CARD PRINT STYLES ──────────────────────────── */
@media print {
  .yica-topbar, .yica-sidebar, .no-print { display: none !important; }
  .yica-content { margin: 0; padding: 0; }
  .print-card { page-break-inside: avoid; }
}

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .yica-sidebar { transform: translateX(-240px); width: 240px; transition: transform .25s; }
  .yica-sidebar.open { transform: translateX(0); }
  .yica-content { margin-left: 0; padding: 16px; }
}
