/* ============================================================
   CAPTAIN 37 HRIS — GLOBAL STYLESHEET
   Primary: #3B6EC9 (Captain blue)  Accent: #F47920 (Captain orange)
   ============================================================ */

/* Site-wide form validation highlight — see assets/js/form_validation_guard.js.
   Marks any field that failed validation on submit so the person can see at
   a glance exactly where they need to fix something. */
.field-needs-attention {
    outline: 2px solid #e74c3c !important;
    outline-offset: 1px;
    background-color: #fdecea !important;
    border-color: #e74c3c !important;
}

:root {
    --primary:       #3B6EC9;
    --primary-dark:  #2A5499;
    --primary-light: #EBF1FB;
    --accent:        #F47920;
    --accent-dark:   #D4621A;
    --accent-light:  #FEF0E5;
    --navy:          #1E3A5F;
    --sidebar-bg:    #1A3252;
    --sidebar-text:  #C8D8EE;
    --sidebar-hover: #243F65;
    --white:         #FFFFFF;
    --light-bg:      #F4F7FC;
    --border:        #DCE3F0;
    --success:       #27AE60;
    --danger:        #C0392B;
    --warning:       #F39C12;
    --info:          #2980B9;
    --text:          #2C3E50;
    --text-muted:    #6C7A8A;
    --radius:        8px;
    --radius-sm:     5px;
    --shadow:        0 2px 12px rgba(59,110,201,.10);
    --shadow-md:     0 4px 20px rgba(59,110,201,.14);
    --transition:    .2s ease;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text);
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h2 { color: var(--navy); font-size: 22px; margin: 0 0 4px; font-weight: 700; }
h3 { color: var(--primary-dark); font-size: 16px; margin: 20px 0 10px; font-weight: 600; }
h4 { color: var(--navy); font-size: 14px; margin: 12px 0 8px; }
p  { margin: 0 0 10px; color: var(--text-muted); }

/* ---- LOGIN PAGE ---- */
body.login-body {
    background: linear-gradient(135deg, var(--navy) 0%, var(--primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-container {
    width: 420px;
    max-width: calc(100vw - 32px);
    background: var(--white);
    padding: 40px 36px;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
    text-align: center;
    box-sizing: border-box;
}
.login-container .login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 12px;
}
.login-container h2 { font-size: 20px; color: var(--navy); margin-bottom: 6px; }
.login-container .login-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.login-container label {
    display: block;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    margin-top: 14px;
    color: var(--text);
}
.login-container input {
    width: 100%;
    padding: 10px 14px;
    margin-top: 5px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color var(--transition);
    outline: none;
}
.login-container input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,110,201,.12); }
.login-container button {
    width: 100%;
    padding: 11px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    margin-top: 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.login-container button:hover { background: var(--primary-dark); }
.error-box   { background:#fdecea; color:#922b21; border:1px solid #f5b7b1; padding:10px 14px; border-radius:var(--radius-sm); margin-top:12px; font-size:13px; }
.success-box { background:#d5f5e3; color:#1e8449; border:1px solid #a9dfba; padding:10px 14px; border-radius:var(--radius-sm); margin-top:12px; font-size:13px; }
.footer-note { font-size:12px; color:var(--text-muted); margin-top:18px; }

/* ---- HEADER ---- */
.main-header {
    background: var(--navy);
    color: var(--white);
    padding: 0 24px;
    height: 58px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.main-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--white);
}
.main-header .logo img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 50%;
}
.main-header .logo .logo-text { font-size: 15px; }
.main-header .logo .logo-text span { color: var(--accent); }
.main-header .user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
}
.main-header .user-info span { color: #b8cde6; }

/* ---- MOBILE SIDEBAR TOGGLE (hamburger) ----
   Hidden on desktop; shown below 680px in every portal header
   (admin/employee/hr/trainee) so the sidebar nav — which is off-canvas
   on mobile, see .sidebar rules below — stays reachable.
   JS behaviour lives in assets/js/sidebar_toggle.js. */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 22px;
    line-height: 1;
    padding: 4px 10px 4px 0;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,20,35,.5);
    z-index: 199;
}
.sidebar-backdrop.show { display: block; }
.logout-btn {
    background: var(--accent);
    color: var(--white) !important;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition);
}
.logout-btn:hover { background: var(--accent-dark); }

/* ---- LAYOUT ---- */
.container { display: flex; min-height: calc(100vh - 58px); }

/* ---- SIDEBAR ---- */
.sidebar {
    width: 230px;
    background: var(--sidebar-bg);
    padding: 16px 0;
    flex-shrink: 0;
    overflow-y: auto;
}
.sidebar h3 {
    color: #8AA8C8;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 20px 4px;
    margin: 0;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar ul li a {
    display: block;
    padding: 9px 20px;
    color: var(--sidebar-text);
    font-size: 13px;
    transition: background var(--transition), color var(--transition);
    border-left: 3px solid transparent;
}
.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: var(--sidebar-hover);
    color: var(--white);
    border-left-color: var(--accent);
}
.sidebar .section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6A8AAA;
    padding: 14px 20px 4px;
    font-weight: 700;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    flex: 1;
    padding: 28px 30px;
    min-width: 0;
}
.page-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.page-title .page-icon { font-size: 22px; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--primary); }

/* ---- CARDS ---- */
.dashboard-cards, .report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    border-top: 3px solid var(--primary);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}
.card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 60px; height: 60px;
    background: var(--primary-light);
    border-radius: 0 0 0 60px;
    opacity: .4;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card.accent { border-top-color: var(--accent); }
.card.success { border-top-color: var(--success); }
.card.danger  { border-top-color: var(--danger);  }
.card.warning { border-top-color: var(--warning); }
.card h3 { font-size: 26px; color: var(--primary); font-weight: 800; margin: 0 0 4px; line-height: 1; }
.card p  { font-size: 12px; color: var(--text-muted); margin: 0; font-weight: 500; }
.card.metric h3 { font-size: 22px; }
.card.warning h3 { color: var(--warning); }
.card.accent  h3 { color: var(--accent);  }
.card.success h3 { color: var(--success); }
.card.danger  h3 { color: var(--danger);  }

/* ---- SHARED CONTENT/INFO CARD HOVER ----
   For "how it works" / feature-highlight / listing cards across public
   pages (become_mentor.php, find_mentor.php, home.php's feature + step
   cards, training listings, etc.) — distinct from the dashboard .card
   above, which already has its own hover. Add class="info-card" to any
   white, rounded, centered content card to pick this up. */
.info-card {
    transition: transform var(--transition), box-shadow var(--transition);
}
.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12));
}

/* ---- RECENT SECTIONS ---- */
.recent-section {
    margin-top: 22px;
    background: var(--white);
    padding: 22px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.recent-section h3 { margin-top: 0; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

/* ---- TABLES ---- */
table { width: 100%; border-collapse: collapse; }
.data-table, .recent-section table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .recent-section table th,
.data-table td, .recent-section table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.data-table th, .recent-section table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.data-table tr:nth-child(even) td { background: #f8fafd; }
.data-table tr:hover td { background: var(--primary-light); transition: background .15s; }

/* ---- BUTTONS ---- */
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: var(--white) !important;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
    line-height: 1.4;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
    display: inline-block;
    background: #95a5a6;
    color: var(--white) !important;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
}
.btn-secondary:hover { background: #7f8c8d; }
.btn-edit   { background: var(--info);    color: var(--white); padding: 5px 10px; border-radius: var(--radius-sm); text-decoration: none; font-size: 12px; }
.btn-delete { background: var(--danger);  color: var(--white); padding: 5px 10px; border-radius: var(--radius-sm); text-decoration: none; font-size: 12px; }
.btn-save   { background: var(--success); color: var(--white); padding: 7px 18px; border-radius: var(--radius-sm); border: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-cancel { background: #bdc3c7;        color: var(--text);  padding: 7px 18px; border-radius: var(--radius-sm); text-decoration: none; font-size: 13px; font-weight: 600; display: inline-block; }
.btn-filter { background: var(--navy); color: var(--white); border: none; padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 13px; }
.btn-reset  { background: #7f8c8d; color: var(--white); padding: 7px 14px; border-radius: var(--radius-sm); text-decoration: none; font-size: 13px; font-weight: 600; }
.btn-viewall { display: inline-block; padding: 7px 14px; background: var(--primary); color: var(--white) !important; border-radius: var(--radius-sm); text-decoration: none; font-size: 13px; font-weight: 600; }
.btn-generate { background: var(--primary); color: var(--white); border: none; padding: 9px 18px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 600; }
.btn-generate:hover { background: var(--primary-dark); }
.btn-cancel-edit { background: #e0e6ef; color: var(--text); padding: 7px 16px; border-radius: var(--radius-sm); border: none; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }

/* ---- FORMS ---- */
.form-container, .form-section, .form-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 860px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid > div { display: flex; flex-direction: column; gap: 5px; }
.form-grid label, .form-section label, .form-container label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}
.form-grid input, .form-grid select, .form-grid textarea,
.form-section input, .form-section select, .form-section textarea,
.form-container input, .form-container select, .form-container textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    transition: border-color var(--transition);
    outline: none;
    background: var(--white);
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus,
.form-section input:focus, .form-container input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,110,201,.10); }
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.form-inline label { font-weight: 600; font-size: 13px; }
.form-inline input, .form-inline select { padding: 7px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.form-inline button { background: var(--primary); color: var(--white); border: none; padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 13px; }
.edit-actions { display: flex; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Inline edit box */
.inline-edit-box {
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.inline-edit-box h3 { margin-top: 0; color: var(--primary-dark); }

/* ---- ALERTS & MESSAGES ---- */
.alert, .info-box {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
}
.alert.success, .info-box.success { background: #d5f5e3; color: #1e8449; border-left: 4px solid var(--success); }
.alert.error   { background: #fdecea; color: #922b21; border-left: 4px solid var(--danger); }
.alert.warning { background: #fef9e7; color: #7d6608; border-left: 4px solid var(--warning); }
.success-box   { background: #d5f5e3; padding: 12px 16px; border: 1px solid #a9dfba; color: #1e8449; border-radius: var(--radius-sm); }
.summary-box   { background: var(--primary-light); padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }

/* ---- STATUS BADGES ---- */
.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--white);
}
.status.Pending, .status.pending      { background: var(--warning); }
.status.Approved, .status.approved, .status.Active, .status.active, .status.Completed { background: var(--success); }
.status.Rejected, .status.rejected, .status.Declined, .status.declined, .status.inactive, .status.Inactive { background: var(--danger); }
.status.Planned, .status.planned      { background: var(--info); }
.status.Ongoing, .status.ongoing      { background: var(--primary); }

/* ---- ACTION BADGE COLOURS ---- */
.action-add   { color: var(--success); font-weight: 700; }
.action-del   { color: var(--danger);  font-weight: 700; }
.action-other { color: var(--info);    font-weight: 700; }

/* ---- FILTER FORM ---- */
.filter-form { background: var(--white); padding: 16px 20px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.filter-row  { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-row label { font-weight: 600; font-size: 13px; }
.filter-row select, .filter-row input { padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }

/* ---- CHARTS ---- */
.chart-section, .chart-card {
    background: var(--white);
    padding: 22px 24px;
    border-radius: var(--radius);
    margin: 16px 0;
    box-shadow: var(--shadow);
}
.charts-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
canvas { width: 100% !important; }

/* ---- TABS ---- */
.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 2px solid var(--border);
    padding: 0 0 0 0;
    margin-bottom: 0;
}
.tab-button {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
}
.tab-button:hover { color: var(--primary); }
.tab-button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; padding: 20px 0; }
.tab-content.active { display: block; }

/* ---- PAYSLIP ---- */
.payslip-container { background: var(--white); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 720px; margin: auto; }
.payslip-container h2 { text-align: center; color: var(--navy); }
.payslip-info p { margin: 4px 0; font-size: 13px; }
.payslip-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.payslip-table th, .payslip-table td { border: 1px solid var(--border); padding: 8px 12px; font-size: 13px; }
.payslip-table th { background: var(--primary); color: var(--white); text-align: left; }

/* ---- NOTIFICATIONS ---- */
.notifications-section { margin-top: 22px; background: var(--white); padding: 22px 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.notification-list { list-style: none; padding: 0; margin: 0; }
.notification-list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; font-size: 13px; }
.notification-list li:last-child { border-bottom: none; }
.notification-list small { color: var(--text-muted); font-size: 11px; }
.unread { background: #f0f8ff; border-left: 3px solid var(--primary); padding-left: 10px !important; }

/* ---- LEAVE & BALANCE BADGES ---- */
.balance { display: inline-block; padding: 4px 12px; border-radius: 20px; font-weight: 700; color: var(--white); font-size: 12px; }
.balance.positive { background: var(--success); }
.balance.low      { background: var(--warning); }
.balance.zero     { background: var(--danger);  }

/* ---- EMPLOYEE DASHBOARD ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.quick-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.quick-card {
    background: var(--primary);
    color: var(--white);
    padding: 14px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    flex: 1 1 160px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    transition: background var(--transition), transform var(--transition);
}
.quick-card:hover { background: var(--primary-dark); transform: translateY(-2px); color: var(--white) !important; }

/* ---- INFO NOTES ---- */
.info-note { background: var(--primary-light); border-left: 4px solid var(--primary); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin-top: 20px; }
.info-note p { margin: 0; font-size: 13px; color: var(--primary-dark); }

/* ---- TASK WIDGET ---- */
.task-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 320px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 6px 30px rgba(0,0,0,.18);
    z-index: 1000;
    border-top: 4px solid var(--accent);
    overflow: hidden;
    transition: height var(--transition);
}
.task-widget-header {
    background: var(--navy);
    color: var(--white);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.task-widget-header span { font-size: 13px; font-weight: 700; }
.task-widget-header .tw-toggle { font-size: 18px; line-height: 1; }
.task-widget-body { padding: 12px; max-height: 340px; overflow-y: auto; }
.task-widget-body.collapsed { display: none; }
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-item input[type="checkbox"] { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.task-item label { font-size: 12px; color: var(--text); cursor: pointer; }
.task-item label.done { text-decoration: line-through; color: var(--text-muted); }
.task-item .task-due { font-size: 10px; color: var(--text-muted); display: block; margin-top: 2px; }
.task-badge { background: var(--accent); color: var(--white); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }

/* ---- REPORTS ---- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.report-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; }
.report-links .card { text-align: center; text-decoration: none; display: block; }
.report-links .card:hover { background: var(--primary-light); }
.metric-big { font-size: 38px; font-weight: 800; color: var(--primary); line-height: 1; }
.metric-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---- SECURITY / PROFILE ---- */
.security-section, .password-section, .twofa-section {
    background: var(--white); padding: 22px 24px; margin-top: 18px;
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-table strong { color: var(--navy); }

/* ---- CONTACT FORM ---- */
.contact-form { background: var(--white); padding: 22px 24px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; }
.contact-form textarea { width: 100%; resize: vertical; }
.success-message { background: #d5f5e3; color: #1e8449; padding: 12px 18px; border: 1px solid #a9dfba; border-radius: var(--radius-sm); margin: 14px 0; text-align: center; font-weight: 600; }

/* ---- PACKAGE CARDS ---- */
.packages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.package-card {
    background: var(--white); border-radius: 12px; padding: 28px;
    box-shadow: var(--shadow); text-align: center;
    border: 2px solid transparent; transition: transform var(--transition), border-color var(--transition);
}
.package-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.package-card.featured { border-color: var(--accent); }
.package-card .badge { background: var(--accent); color: var(--white); font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 4px; display: inline-block; margin-bottom: 10px; }
.package-card h3 { color: var(--navy); margin: 5px 0 8px; font-size: 21px; font-weight: 800; letter-spacing: 0.2px; line-height: 1.25; }
.package-card.featured h3 { background: linear-gradient(90deg, var(--navy), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.package-card .price { font-size: 30px; font-weight: 800; color: var(--primary); margin: 10px 0; }
.package-card .price small { font-size: 13px; color: var(--text-muted); font-weight: 400; }
.package-card .reg-fee-note { font-size: 12.5px; color: var(--text-muted); margin: -4px 0 4px; }
.package-card .reg-fee-note strong { color: var(--navy); }

/* ---- FOOTER ---- */
.main-footer {
    background: var(--navy);
    color: #8aaac8;
    text-align: center;
    padding: 14px 24px;
    font-size: 12px;
}
.main-footer span { color: var(--accent); font-weight: 600; }
.main-footer a { color: #8aaac8; }

/* ---- PRINT ---- */
@media print {
    .sidebar, .main-header, .main-footer, .btn-primary, .task-widget { display: none !important; }
    .payslip-container { box-shadow: none; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .sidebar { width: 180px; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    /* Off-canvas sidebar instead of hiding it outright — the hamburger
       button (.sidebar-toggle, added to each portal header) slides it
       in over the page via JS (assets/js/sidebar_toggle.js) so mobile
       users can still reach every nav link. */
    .sidebar-toggle { display: inline-block; }
    .sidebar {
        position: fixed;
        top: 0;
        left: -270px;
        width: 250px;
        max-width: 80vw;
        height: 100vh;
        z-index: 200;
        box-shadow: 4px 0 24px rgba(0,0,0,.3);
        transition: left .25s ease;
    }
    .sidebar.open { left: 0; }
    body.sidebar-open { overflow: hidden; }
    /* Floating widgets sit at a higher z-index than the drawer so they're
       reachable normally, but that means they'd float on top of the open
       mobile menu too — hide them while the drawer is open instead. */
    body.sidebar-open #supportFloat,
    body.sidebar-open .task-widget { display: none; }

    .main-header { padding: 0 14px; flex-wrap: wrap; height: auto; min-height: 58px; }
    .main-header .logo { font-size: 14px; }
    .main-header .logo .logo-text { font-size: 13px; }
    .main-header .user-info { font-size: 12px; gap: 8px; }
    .main-header .user-info > span { display: none; } /* "Welcome, X" — reclaim space, name still visible in sidebar/account pages */

    .main-content { padding: 16px; }
    .dashboard-cards { grid-template-columns: 1fr 1fr; }
    .task-widget { width: calc(100vw - 24px); right: 12px; }

    /* Any data table wider than the screen scrolls horizontally inside
       itself instead of blowing out the page layout. */
    .data-table, .recent-section table, .info-table, .payslip-table, #payslip {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}
@media (max-width: 420px) {
    .dashboard-cards, .report-cards { grid-template-columns: 1fr; }
}
