/* assets/css/style.css
   PRESIDENT'S AWARD KENYA - OFFICIAL BRAND COLORS
   Battery Charged Blue: #18b1e7
   Fire Engine Red:      #CB2127
   Sonic Silver:         #707578
   Black:                #000000
   Font: Calibri (digital), FF Meta OT (print)
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&display=swap');

:root {
  /* PAK Official Brand Colors */
  --pak-blue:         #18b1e7;
  --pak-blue-dark:    #0d8bb8;
  --pak-blue-light:   #e8f6fd;
  --pak-blue-mid:     #b3e0f5;
  --pak-red:          #CB2127;
  --pak-red-dark:     #a01a1f;
  --pak-red-light:    #fde8e8;
  --pak-silver:       #707578;
  --pak-silver-light: #f5f5f5;
  --pak-black:        #000000;
  --pak-white:        #FFFFFF;

  /* Duke of Edinburgh Award Colors */
  --award-red:        #E40046;
  --award-yellow:     #FFCF21;
  --award-purple:     #882581;
  --award-green:      #71A100;
  --award-blue:       #009EDC;
  --award-teal:       #00313C;

  /* Award Level Colors */
  --bronze:           #CD7F32;
  --silver-award:     #9E9E9E;
  --gold:             #FFD700;

  /* Layout */
  --sidebar-width:    270px;
  --topbar-height:    66px;
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        16px;
  --shadow-sm:        0 2px 8px rgba(24,177,231,0.10);
  --shadow-md:        0 4px 20px rgba(24,177,231,0.15);
  --shadow-lg:        0 8px 40px rgba(24,177,231,0.20);
  --transition:       all 0.25s ease;

  /* Typography */
  --font-primary:     'Montserrat', 'Calibri', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-primary);
  background: #f0f4f8;
  color: var(--pak-black);
  font-size: 14px;
}

/* ===================== MULTICOLOR BAR (Brand Guideline) ===================== */
.pak-brand-bar {
  height: 5px;
  background: linear-gradient(to right,
    var(--pak-red) 0%, var(--pak-red) 20%,
    var(--award-yellow) 20%, var(--award-yellow) 40%,
    var(--pak-blue) 40%, var(--pak-blue) 60%,
    var(--award-green) 60%, var(--award-green) 80%,
    var(--award-purple) 80%, var(--award-purple) 100%
  );
}

/* ===================== AUTH ===================== */
.auth-body {
  background: linear-gradient(135deg, var(--pak-blue-dark) 0%, var(--pak-blue) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.auth-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-wrapper   { width: 100%; max-width: 480px; padding: 20px; position: relative; z-index: 1; animation: fadeUp 0.5s ease; }
.auth-card      { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.auth-header    { background: var(--pak-blue); padding: 30px 24px 20px; text-align: center; color: white; }

/* FIXED: Login page logo - larger size */
.auth-logo      { width: 110px; height: 110px; object-fit: contain; background: white; border-radius: 50%; padding: 10px; margin-bottom: 15px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.auth-header h4 { font-size: 17px; font-weight: 800; margin: 0; letter-spacing: 0.5px; }
.auth-header p  { font-size: 12px; opacity: 0.85; margin: 4px 0 0; }
.auth-footer    { background: var(--pak-silver-light); text-align: center; padding: 14px; font-size: 11px; color: var(--pak-silver); border-top: 1px solid #e5e5e5; }

.auth-tabs .nav-tabs { border: none; background: #f8f9fa; }
.auth-tabs .nav-link { border: none; color: var(--pak-silver); font-weight: 600; padding: 12px 20px; border-radius: 0; }
.auth-tabs .nav-link.active { color: var(--pak-blue); border-bottom: 3px solid var(--pak-blue); background: white; }

/* ===================== LAYOUT ===================== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #001a24 0%, #003048 50%, #004d73 100%);
  z-index: 1000;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  transition: var(--transition);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(24,177,231,0.3); border-radius: 2px; }
.sidebar.collapsed { width: 70px; }

/* Sidebar Brand */
.sidebar-brand {
  padding: 16px 14px;
  background: rgba(24,177,231,0.15);
  border-bottom: 1px solid rgba(24,177,231,0.2);
}

/* FIXED: Sidebar brand logo - larger with white background */
.sidebar-logo   { width: 48px; height: 48px; object-fit: contain; background: white; border-radius: 12px; padding: 6px; }

.sidebar-title  { color: white; font-size: 12px; font-weight: 800; letter-spacing: 0.3px; line-height: 1.2; }
.sidebar-sub    { color: var(--pak-blue); font-size: 10px; letter-spacing: 0.5px; }

/* Brand bar in sidebar */
.sidebar-brand-bar {
  height: 3px;
  background: linear-gradient(to right, var(--pak-red), var(--award-yellow), var(--pak-blue), var(--award-green), var(--award-purple));
  margin: 10px 0 0;
  border-radius: 2px;
}

/* Sidebar User */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--pak-blue); object-fit: cover; }
.sidebar-user-name  { color: white; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role  { color: var(--pak-blue); font-size: 10px; letter-spacing: 0.3px; }

/* Sidebar Navigation */
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section-label {
  color: rgba(24,177,231,0.5);
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 14px 16px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  color: rgba(255,255,255,0.70);
  text-decoration: none; cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.nav-item:hover, .nav-item.active {
  color: white;
  background: rgba(24,177,231,0.15);
  border-right: 3px solid var(--pak-blue);
}
.nav-item.active { color: var(--pak-blue); }
.nav-icon   { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }
.nav-arrow  { margin-left: auto; font-size: 9px; transition: var(--transition); }
.nav-badge  { margin-left: auto; background: var(--pak-red); color: white; border-radius: 10px; padding: 1px 6px; font-size: 10px; font-weight: 700; }

.nav-item-dropdown.open .nav-arrow { transform: rotate(90deg); }
.nav-submenu { display: none; background: rgba(0,0,0,0.15); }
.nav-item-dropdown.open .nav-submenu { display: block; }
.nav-subitem {
  display: block; padding: 8px 16px 8px 44px;
  color: rgba(255,255,255,0.55); text-decoration: none;
  font-size: 12px; transition: var(--transition);
  border-left: 2px solid transparent;
}
.nav-subitem:hover { color: var(--pak-blue); border-left-color: var(--pak-blue); background: rgba(24,177,231,0.05); }

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,0.06); }

/* ===================== MAIN CONTENT ===================== */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: var(--transition);
}
.main-content.expanded { margin-left: 70px; }

/* Top Navigation Bar (used in topnav.php) - FIXED for layout */
.topnav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: white;
  border-bottom: 3px solid var(--pak-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 10px;
}
.topnav-bar .d-flex:first-child {
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .topnav-bar {
    padding: 8px 16px;
    height: auto;
  }
}

/* Old top-navbar kept for compatibility if used elsewhere */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: white;
  border-bottom: 3px solid var(--pak-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
}

.content-wrapper { padding: 24px; flex: 1; animation: fadeIn 0.3s ease; }

/* ===================== STAT CARDS ===================== */
.stat-card-link { text-decoration: none; display: block; }
.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative; overflow: hidden;
  border-top: 4px solid var(--pak-blue);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card::after {
  content: '';
  position: absolute; top: -15px; right: -15px;
  width: 70px; height: 70px;
  border-radius: 50%; opacity: 0.06;
  background: var(--pak-blue);
}
.stat-blue    { border-top-color: var(--pak-blue); }
.stat-blue::after   { background: var(--pak-blue); }
.stat-red     { border-top-color: var(--pak-red); }
.stat-red::after    { background: var(--pak-red); }
.stat-silver  { border-top-color: var(--pak-silver); }
.stat-silver::after { background: var(--pak-silver); }
.stat-gold    { border-top-color: var(--gold); }
.stat-gold::after   { background: var(--gold); }
.stat-green   { border-top-color: var(--award-green); }
.stat-green::after  { background: var(--award-green); }
.stat-purple  { border-top-color: var(--award-purple); }
.stat-purple::after { background: var(--award-purple); }
.stat-teal    { border-top-color: var(--award-teal); }
.stat-teal::after   { background: var(--award-teal); }
.stat-yellow  { border-top-color: var(--award-yellow); }
.stat-yellow::after { background: var(--award-yellow); }

.stat-icon    { position: absolute; top: 14px; right: 16px; font-size: 26px; opacity: 0.12; color: var(--pak-black); }
.stat-number  { font-size: 30px; font-weight: 800; color: var(--pak-black); line-height: 1; margin-bottom: 4px; }
.stat-label   { font-size: 11px; color: var(--pak-silver); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; }
.stat-sub     { font-size: 11px; color: var(--pak-silver); margin-top: 4px; }
.stat-footer  { font-size: 10px; color: var(--pak-blue); font-weight: 600; margin-top: 12px; padding-top: 8px; border-top: 1px solid #f0f0f0; }

/* ===================== PAK BADGES ===================== */
.pak-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pak-badge-blue          { background: var(--pak-blue); color: white; }
.pak-badge-red           { background: var(--pak-red); color: white; }
.pak-badge-silver        { background: var(--pak-silver); color: white; }
.pak-badge-yellow        { background: var(--award-yellow); color: var(--pak-black); }
.pak-badge-bronze        { background: linear-gradient(135deg, #CD7F32, #a0522d); color: white; }
.pak-badge-silver-award  { background: linear-gradient(135deg, #9E9E9E, #757575); color: white; }
.pak-badge-gold          { background: linear-gradient(135deg, #FFD700, #cc9f00); color: var(--pak-black); }
.pak-badge-green         { background: var(--award-green); color: white; }
.pak-badge-purple        { background: var(--award-purple); color: white; }

/* Award badges */
.award-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.award-badge.bronze { background: linear-gradient(135deg, #CD7F32, #a0522d); color: white; }
.award-badge.silver { background: linear-gradient(135deg, #9E9E9E, #757575); color: white; }
.award-badge.gold   { background: linear-gradient(135deg, #FFD700, #cc9f00); color: #1a1a1a; }

.leader-badge    { background: linear-gradient(135deg, var(--pak-blue), var(--pak-blue-dark)); color: white; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.volunteer-badge { background: linear-gradient(135deg, var(--award-purple), #6a1f66); color: white; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.centre-badge    { background: linear-gradient(135deg, var(--pak-blue), var(--pak-blue-dark)); color: white; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; }

/* ===================== AWAITING CARDS ===================== */
.awaiting-card {
  background: var(--pak-silver-light);
  border-radius: var(--radius-md);
  padding: 18px 10px;
  text-align: center; cursor: pointer;
  transition: var(--transition);
}
.awaiting-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.bronze-card { border-top: 4px solid #CD7F32; }
.silver-card { border-top: 4px solid #9E9E9E; }
.gold-card   { border-top: 4px solid #FFD700; }
.awaiting-number { font-size: 28px; font-weight: 800; color: var(--pak-black); }
.awaiting-label  { font-size: 11px; color: var(--pak-silver); font-weight: 700; text-transform: uppercase; }

/* ===================== HOURS CARDS ===================== */
.hours-card { background: white; border-radius: var(--radius-sm); padding: 14px 10px; text-align: center; border-top: 3px solid var(--pak-blue); }
.hours-number  { font-size: 22px; font-weight: 800; color: var(--pak-blue); margin: 5px 0; }
.hours-label   { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.hours-sublabel{ font-size: 10px; color: var(--pak-silver); }

/* ===================== BUTTONS ===================== */
.btn-pak         { background: var(--pak-blue); color: white; border: none; font-weight: 700; }
.btn-pak:hover   { background: var(--pak-blue-dark); color: white; }
.btn-outline-pak { border: 2px solid var(--pak-blue); color: var(--pak-blue); font-weight: 700; background: transparent; }
.btn-outline-pak:hover { background: var(--pak-blue); color: white; }
.btn-pak-red     { background: var(--pak-red); color: white; border: none; font-weight: 700; }
.btn-pak-red:hover { background: var(--pak-red-dark); color: white; }
.btn-xs          { padding: 2px 8px; font-size: 11px; border-radius: 4px; line-height: 1.5; }

.pak-link        { color: var(--pak-blue); font-weight: 600; text-decoration: none; }
.pak-link:hover  { color: var(--pak-blue-dark); text-decoration: underline; }

/* ===================== TABLES ===================== */
.table-pak thead th {
  background: var(--pak-blue);
  color: white;
  font-weight: 700;
  font-size: 12px;
  padding: 10px 12px;
  border: none;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table-hover tbody tr:hover { background: rgba(24,177,231,0.05) !important; }
.border-bottom-pak { border-bottom: 3px solid var(--pak-blue) !important; }

/* ===================== CARDS ===================== */
.card { border-radius: var(--radius-md) !important; border: none !important; }
.card-header { background: white !important; font-weight: 700; font-size: 14px; }

/* ===================== FORMS ===================== */
.form-control:focus, .form-select:focus {
  border-color: var(--pak-blue);
  box-shadow: 0 0 0 0.2rem rgba(24,177,231,0.20);
}
.form-label { font-weight: 700; font-size: 12.5px; color: #2d3748; }

/* ===================== BREADCRUMB ===================== */
.breadcrumb { background: white; padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); font-size: 12.5px; margin-bottom: 16px !important; }
.breadcrumb-item a { color: var(--pak-blue); }
.breadcrumb-item.active { color: var(--pak-silver); }

/* ===================== DETAIL ROWS ===================== */
.detail-row { display: flex; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid #f3f4f6; gap: 10px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { min-width: 155px; font-weight: 700; font-size: 12px; color: var(--pak-silver); flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.3px; }
.detail-value { font-size: 13px; color: var(--pak-black); flex: 1; word-break: break-word; }

/* ===================== TIMELINE ===================== */
.timeline-step { padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; background: #e5e7eb; color: #6b7280; white-space: nowrap; }
.timeline-step.completed { background: rgba(24,177,231,0.15); color: var(--pak-blue-dark); }
.timeline-step.active    { background: var(--pak-blue); color: white; }
.timeline-arrow          { color: #9ca3af; font-size: 10px; flex-shrink: 0; }

/* ===================== TICKET STYLES ===================== */
.ticket-priority-low    { border-left: 4px solid var(--award-green) !important; }
.ticket-priority-medium { border-left: 4px solid var(--award-yellow) !important; }
.ticket-priority-high   { border-left: 4px solid var(--pak-red) !important; }
.ticket-priority-urgent { border-left: 4px solid #8B0000 !important; background: #fff5f5 !important; }

/* ===================== PRINT STYLES ===================== */
.report-header { display: none; }

@media print {
  .sidebar, .top-navbar, .btn, .breadcrumb, .no-print,
  .dataTables_filter, .dataTables_length, .dataTables_info,
  .dataTables_paginate, .dt-buttons { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: white !important; font-family: Calibri, sans-serif; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .report-header { display: block !important; text-align: center; padding: 20px; border-bottom: 3px solid var(--pak-blue); margin-bottom: 20px; }
  .report-header .brand-bar { height: 4px; background: linear-gradient(to right, #CB2127 20%, #FFCF21 40%, #18b1e7 60%, #71A100 80%, #882581 100%); margin: 8px 0; }
  .table-pak thead th { background: var(--pak-blue) !important; color: white !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  @page { margin: 1.5cm; size: A4 landscape; }
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin    { to { transform: rotate(360deg); } }

/* ===================== LOADING ===================== */
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; z-index: 9999; display: none; }
.spinner-pak { width: 48px; height: 48px; border: 5px solid rgba(24,177,231,0.15); border-top-color: var(--pak-blue); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .content-wrapper { padding: 14px; }
  .stat-number { font-size: 22px !important; }
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--pak-blue-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--pak-blue); }

/* ===================== MISC ===================== */
.bg-pak  { background: var(--pak-blue) !important; color: white !important; }
.text-pak { color: var(--pak-blue) !important; }
.notification-dropdown { min-width: 300px; }
.user-btn { text-decoration: none; color: var(--pak-black); }
.avatar-sm { width: 32px; height: 32px; object-fit: cover; border: 2px solid var(--pak-blue); }
.bg-orange { background: #ea7317 !important; }

/* ===================== EXTRA SPACING FOR LOGO (sidebar brand) ===================== */
.sidebar-brand .d-flex {
  gap: 12px !important;
}