:root {
    --primary-color: #FF6B35;
    --secondary-color: #000000;
    --success-color: #2ECC71;
    --warning-color: #F39C12;
    --danger-color: #E74C3C;
    --info-color: #ff9800;
    --dark-color: #2C3E50;
    --light-color: #ECF0F1;
    --white: #FFFFFF;
    --warm: #ECF0F1;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #333;
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, var(--secondary-color), #003366);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255,255,255,0.1);
    border-left: 4px solid var(--primary-color);
    padding-left: 16px;
}

.sidebar-menu li a i {
    margin-right: 10px;
    font-size: 18px;
    width: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: var(--transition);
}

.top-bar {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left h1 {
    font-size: 24px;
    color: var(--dark-color);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
}

.content-area {
    padding: 30px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.card-header h3 {
    font-size: 20px;
    color: var(--dark-color);
}

.card-body {
    padding: 10px 0;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.blue { background: rgba(52, 152, 219, 0.1); color: var(--info-color); }
.stat-icon.green { background: rgba(46, 204, 113, 0.1); color: var(--success-color); }
.stat-icon.orange { background: rgba(243, 156, 18, 0.1); color: var(--warning-color); }
.stat-icon.red { background: rgba(231, 76, 60, 0.1); color: var(--danger-color); }
.stat-icon.purple { background: rgba(155, 89, 182, 0.1); color: #9B59B6; }

.stat-details h4 {
    font-size: 32px;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-details p {
    color: #7f8c8d;
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group label.required::after {
    content: " *";
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #ff5722;
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-info {
    background: var(--info-color);
    color: var(--white);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-secondary {
    background: #95a5a6;
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

table thead {
    background: var(--light-color);
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #ddd;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

table tbody tr:hover {
    background: #f8f9fa;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: var(--success-color); color: var(--white); }
.badge-warning { background: var(--warning-color); color: var(--white); }
.badge-danger { background: var(--danger-color); color: var(--white); }
.badge-info { background: var(--info-color); color: var(--white); }
.badge-secondary { background: #95a5a6; color: var(--white); }

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Modal (legacy system - single .modal element acts as the overlay,
   toggled via .show; .modal-content is the dialog box). Used by
   other pages. Left exactly as-is: the newer .modal-overlay /
   .modal-dialog system further below is a SEPARATE, non-conflicting
   set of classes for pages like cohorts.php that nest an inner card
   inside an outer overlay element. */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal.show {
    display: block;
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    text-align: right;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: var(--danger-color);
}

/* Progress Bar */
.progress {
    height: 25px;
    background: var(--light-color);
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--warning-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
    transition: width 0.5s ease;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a {
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 5px;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.pagination a:hover,
.pagination a.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Charts */
.chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff6b352e;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-260px);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        padding: 15px;
    }
    
    .content-area {
        padding: 15px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th, table td {
        padding: 8px;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.float-right { float: right; }
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--light-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .sidebar, .top-bar, .btn, .table-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Enhanced Sidebar Styles */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--dark-color);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
}

.sidebar-header {
    padding: 20px;
    background: var(--primary-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sidebar-brand i {
    font-size: 24px;
}

.sidebar-brand h1 {
    font-size: 18px;
    margin: 0;
    color: white;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.sidebar-user .user-avatar {
    font-size: 36px;
    color: white;
}

.sidebar-user .user-info {
    flex: 1;
}

.sidebar-user .user-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: white;
    display: block;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 2px 10px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar-menu li a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar-menu li.active a {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
    background: rgba(231, 76, 60, 0.2);
}

.logout-btn:hover {
    background: #E74C3C;
    color: white;
}

.logout-btn i {
    font-size: 16px;
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Enhanced Header Styles */
.main-header {
    background: #000000;
    color: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ff6b35;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-details .user-name {
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-details .user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.btn-icon {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.badge-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #E74C3C;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: calc(100vh - 70px);
    background: #f5f6fa;
    transition: margin-left 0.3s;
}

.alert-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 5px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.alert-close:hover {
    opacity: 1;
}

/* Additional Responsive Styles */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .user-details {
        display: none;
    }
    
    .top-bar-right {
        gap: 10px;
    }
    
    .main-header {
        padding: 12px 15px;
    }
    
    .top-bar-left h2 {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .user-name {
        display: none;
    }
    
    .logout-text {
        display: none;
    }
    
    .top-bar-left h2 i {
        display: none;
    }
}

/* ========================================
   LOGIN PAGE STYLES
   ======================================== */

/* Enhanced Password Field Styling */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 45px !important;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.password-toggle:focus {
    outline: none;
    color: var(--primary-color);
}

.password-toggle i {
    font-size: 16px;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff6b352e;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-header h1 img {
    height: 60px;
    margin-right: 10px;
}

.login-header p {
    color: #7f8c8d;
    margin: 0;
    font-size: 14px;
}

/* Login Form Elements */
.login-card .form-group {
    margin-bottom: 20px;
}

.login-card .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 500;
    font-size: 14px;
}

.login-card .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.login-card .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.login-card .btn-block {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 10px;
    border-radius: 8px;
    font-weight: 500;
}

/* Login Alert */
.login-card .alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-card .alert-danger {
    background-color: #fee;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.login-card .alert i {
    font-size: 18px;
}

/* Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Login Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .login-header h1 img {
        height: 50px;
    }
}
a.text-decoration-none,
a.text-decoration-none:hover,
a.text-decoration-none:focus {
    text-decoration: none !important;
}


/* -- Progress stepper -- */
.stepper-wrap { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 53px; z-index: 90; }
.stepper {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 18px;
  gap: 4px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: .4px;
  flex-shrink: 0;
}
.step .step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  transition: background .2s, color .2s;
}
.step.active { color: var(--accent); border-bottom-color: var(--accent); }
.step.active .step-num { background: var(--accent); color: #fff; }
.step.done { color: var(--ink); }
.step.done .step-num { background: #22c55e; color: #fff; }

/* -- Layout -- */
.layout { max-width: 860px; margin: 0 auto; padding: 32px 16px 0; }

/* -- Flash -- */
.flash { padding: 14px 18px; border-radius: 10px; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; }
.flash-error { background: #fde8e8; border: 1px solid #fca5a5; color: #7f1d1d; }
.flash-draft { background: #e0f2fe; border: 1px solid #7dd3fc; color: #075985; }

/* -- Cards / Sections -- */
.section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: none;
}
.section.active { display: block; }

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.section-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.section-title-group h2 {
  font-family: 'Arial', serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.section-title-group p { font-size: 13px; color: var(--mid); }

/* -- Form elements -- */
.form-group { margin-bottom: 22px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.form-row-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 7px;
  letter-spacing: .1px;
}
label .req { color: var(--accent); margin-left: 2px; }
.hint { font-size: 12px; color: var(--mid); margin-top: 5px; line-height: 1.5; }

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--warm);
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212,85,14,.12);
  background: #fff;
}
textarea.form-control { resize: vertical; min-height: 110px; line-height: 1.6; }
select.form-control { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b72' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* File upload */
.file-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
  background: var(--warm);
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.file-zone:hover { border-color: var(--accent); background: #fdf5f1; }
.file-zone i { font-size: 28px; color: var(--accent); margin-bottom: 8px; }
.file-zone p { font-size: 13px; color: var(--mid); margin-bottom: 10px; }
.file-zone input[type="file"] { font-size: 13px; }
.file-uploaded { font-size: 12px; color: #15803d; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; justify-content: center; }

/* Radio / checkbox groups */
.radio-group, .check-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-pill input { display: none; }
.radio-pill label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  background: var(--warm);
  margin: 0;
}
.radio-pill input:checked + label {
  border-color: var(--accent);
  background: rgba(212,85,14,.08);
  color: var(--accent);
}

/* Nav buttons */
.nav-bar {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: #ff9800; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212,85,14,.3); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--ink); background: var(--warm); }
.btn-draft { background: var(--ink); color: #fff; }
.btn-draft:hover { background: #2a2d37; transform: translateY(-1px); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(22,163,74,.3); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* -- Summary card (last step) -- */
.summary-chip {
  display: inline-block;
  background: var(--warm);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--mid);
  margin-top: 4px;
}

/* -- Alerts -- */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }

/* -- Sticky bottom bar -- */
.sticky-actions {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: center;
  gap: 14px;
  z-index: 200;
}
.progress-bar-wrap {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 18px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width .4s ease;
}

@media(max-width:640px){
  .hero { padding: 40px 20px 36px; }
  .section { padding: 22px 18px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .hero-meta { gap: 12px; font-size: 13px; }
}

/* ============================================================
   MODAL-DIALOG COMPONENT (cohorts.php and similar admin pages)

   Namespaced as .modal-overlay / .modal-dialog rather than reusing
   the bare ".modal" class above. This file already has a DIFFERENT
   legacy modal system further up (.modal / .modal-content / .show)
   where ".modal" itself IS the full-screen overlay. Reusing ".modal"
   here for the inner dialog card collided with that rule: because
   both rules have equal specificity, the later one in the file wins
   property-by-property rather than wholesale, so the "dialog" ended
   up inheriting position:fixed/width:100%/height:100% from the
   legacy rule while also getting display:flex from this block —
   producing a full-viewport white box instead of a centered card.
   That's the "modal won't open" bug: the overlay's own show/hide
   toggle (.modal-overlay.open) was working fine the whole time; the
   inner element just weren't a modal box.
   ============================================================ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.modal-overlay.open {
    display: flex;
}

.modal-dialog {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    animation: modal-pop-in .15s ease-out;
}

.modal-dialog.modal-dialog-lg {
    max-width: 860px;
}

.modal-dialog.modal-dialog-sm {
    max-width: 420px;
}

@keyframes modal-pop-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-dialog-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.modal-dialog-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.modal-dialog-close:hover {
    background: #f3f4f6;
    color: var(--dark-color);
}

.modal-dialog-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

.modal-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Form grid used inside modal-dialog bodies */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid .form-group.full {
    grid-column: 1 / -1;
}

.form-group .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 6px;
}

.form-group .req {
    color: var(--danger-color);
}

.img-preview {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    object-fit: cover;
}

@media (max-width: 640px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .modal-overlay {
        padding: 12px;
    }
}