:root {
    /* SMIT School Colors - Navy & Gold */
    --primary: #2578a8;
    --primary-dark: #09426b;
    --primary-light: #5c8dbc;

    --secondary: #0F172A;
    --accent: #22C55E;
    --accent-dark: #16A34A;

    --warning: #500404;
    --warning-dark: #efab5e;
    --danger: #c92828;
    --danger-dark: #7c370e;

    /* Clean Surfaces */
    --bg: #f1f5f9;
    --bg-dark: #ebeff3;

    --card: #ffffff;

    /* Text */
    --text: #0B1220;
    --text-secondary: #787f89;
    --text-light: #94A3B8;
    --border: #e2e8f0;

    --shadow: 0 1px 3px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    --sidebar-width: 280px;
    --header-height: 60px;
}


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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

/* Login Page - Clean School Gradient */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0B2A5C 0%, #0B3B91 40%, #1a4fa0 70%, #0B2A5C 100%);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(800px ellipse at 20% 0%, rgba(34,197,94,0.12) 0%, transparent 60%),
        radial-gradient(600px ellipse at 80% 100%, rgba(29,78,216,0.10) 0%, transparent 50%);
    pointer-events: none;
}


.login-container {
    width: 50%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(11,59,145,0.25);
}


.login-header .logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.login-footer code {
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-size: 12px;
}

.demo-accounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.demo-accounts span {
    font-size: 11px;
    background: var(--bg-dark);
    padding: 4px 8px;
    border-radius: var(--radius-xs);
}

/* Password Toggle */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Multi-select fixes: override conflicting single-select styles */
.form-group select[multiple] {
    height: auto;
    min-height: 80px;
    padding: 8px;
    overflow-y: auto;
    resize: vertical;
    cursor: pointer;
}

.form-group select[multiple] option {
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: background 0.15s;
}

.form-group select[multiple] option:hover {
    background: var(--primary-light);
    color: white;
}

.form-group select[multiple] option:checked {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.form-group textarea {
    height: auto;
    min-height: 100px;
    padding: 12px 14px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(11,59,145,0.20);
}


.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-dark);
}

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-success:hover {
    background: var(--accent-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-radius: 4px; /* Adjust the value as needed */
}
.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: var(--warning-dark);
}

.btn-sm {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #FEF2F2;
    color: var(--danger);
    border: 1px solid #FECACA;
}

.alert-success {
    background: #ECFDF5;
    color: var(--accent);
    border: 1px solid #A7F3D0;
}

.alert-warning {
    background: #FFFBEB;
    color: var(--warning);
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #EFF6FF;
    color: var(--primary);
    border: 1px solid #BFDBFE;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Clean Dark Navy */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #47b7f4 0%, #5eaace 100%);
    color: rgb(7, 0, 0);

    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.sidebar-logo svg {
    width: 32px;
    height: 32px;
    color: var(--primary-light);
    filter: drop-shadow(0 6px 10px rgba(29,78,216,0.25));
}

.sidebar-logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}


.sidebar-logo h2 {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section--active {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-left: 8px;
    margin-right: 8px;
    padding: 4px 0;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgb(11, 11, 11);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(12, 12, 12, 0.993);
    text-decoration: none;
    transition: all 0.2s;
    border-color: #1a4fa0;
}

.nav-item:hover {
   background: rgba(138, 137, 139, 0.56);
    color: white;
}

.nav-item.active {
    background: rgba(138, 137, 139, 0.56);
    color: white;
    border-left-color: var(--accent);
}


.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item span {
    font-size: 14px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    background: #5cd0c9;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Header - Clean White with Light Bottom Shadow */
.header {
    height: var(--header-height);
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.header-icon-btn:hover {
    background: var(--bg-dark);
    color: var(--text);
}

.header-icon-btn svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: var(--bg-dark);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu:hover {
    background: var(--border);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Page Content */
.page-content {
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-action-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-action-group::after {
    content: '';
    width: 1px;
    height: 28px;
    background: var(--border);
    margin-left: 4px;
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.card-body {
    padding: 14px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: #627588;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
    border-color: #16A34A;
}

.stat-card {
    background-color: #ced7dd;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #5c8fd1, #fcfdff);
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(11, 59, 145, 0.10);
}

.stat-icon.green {
    background: linear-gradient(135deg, #73e194, #DCFCE7);
    color: var(--accent);
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.10);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #d8b62c, #f3f2f0);
    color: var(--warning);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.10);
}

.stat-icon.red {
    background: linear-gradient(135deg, #e85454, #f5f1f1);
    color: var(--danger);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.10);
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-trend {
    font-size: 12px;
    margin-top: 4px;
}

.stat-trend.up {
    color: var(--accent);
}

.stat-trend.down {
    color: var(--danger);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    border-color: #f6faf6;
}

th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg);
}

tr:hover td {
    background: var(--bg);
}

.table-actions {
    display: flex;
    gap: 8px;

}

.table-actions button,
.table-actions a {
    padding: 6px 10px;
    font-size: 12px;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
}

.badge-success {
    background: #ECFDF5;
    color: var(--accent);
}

.badge-warning {
    background: #FFFBEB;
    color: var(--warning);
}

.badge-danger {
    background: #FEF2F2;
    color: var(--danger);
}

.badge-success {
    background: #F0FDF4;
    color: #16A34A;
}

.badge-info {
    background: #EFF6FF;
    color: var(--primary);
}

.badge-secondary {
    background: var(--bg-dark);
    color: var(--text-secondary);
}

/* ==============================================
   MODAL - Premium Professional Design
   ============================================== */

/* ---- KEYFRAME ANIMATIONS ---- */

@keyframes modalOverlayIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes modalOverlayOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes modalEntrance {
    0% {
        transform: scale(0.85) translateY(30px);
        opacity: 0;
    }
    50% {
        transform: scale(1.02) translateY(-4px);
        opacity: 1;
    }
    75% {
        transform: scale(0.98) translateY(2px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes modalExit {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
}

@keyframes gradientAccentPulse {
    0% { background-position: 0% 50%; opacity: 1; }
    50% { background-position: 100% 50%; opacity: 1; }
    100% { background-position: 0% 50%; opacity: 1; }
}

@keyframes headerSlideIn {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes bodySlideIn {
    0% { transform: translateY(8px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes footerSlideIn {
    0% { transform: translateY(8px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes shimmerSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ---- MODAL OVERLAY ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(11, 59, 145, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(245, 158, 11, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
        rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    animation: modalOverlayIn 0.3s ease forwards;
}

.modal-overlay.closing {
    animation: modalOverlayOut 0.25s ease forwards;
}

/* ---- MODAL CONTAINER ---- */
.modal {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 18px;
    box-shadow: 
        0 25px 60px rgba(2, 6, 23, 0.35),
        0 8px 20px rgba(2, 6, 23, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Ensure forms inside modals behave as flex containers so the
   .modal-body can scroll while the header/footer stay fixed. */
.modal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Explicit scroll fallback: guarantees the form body is scrollable even
   when the flexbox chain isn't constraining it. Applies to all form modals
   (equipment, athlete, sport, schedule, user, borrow, etc.). */
.modal form .modal-body {
    max-height: calc(90vh - 150px);
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-overlay.active .modal {
    animation: modalEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-overlay.closing .modal {
    animation: modalExit 0.25s ease forwards;
}

/* Gradient accent bar at top with shimmer */
.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent), var(--warning), var(--accent), var(--primary-light), var(--primary));
    background-size: 400% 100%;
    z-index: 1;
    animation: gradientAccentPulse 4s ease infinite;
}

.modal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    z-index: 2;
    transform: translateX(-100%);
    animation: shimmerSlide 2.5s ease-in-out infinite;
}

/* ---- MODAL HEADER ---- */
.modal-header {
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
    transform: translateY(-10px);
    opacity: 0;
}

.modal-overlay.active .modal-header {
    animation: headerSlideIn 0.35s ease 0.15s forwards;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent 80%);
    border-radius: 1px;
}

/* ---- MODAL TITLE ---- */
.modal-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.modal-title svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ---- MODAL CLOSE BUTTON ---- */
.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    transform: rotate(90deg) scale(1.1);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

/* Notification delete button */
.notification-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
}

.notification-item:hover .notification-delete-btn {
    opacity: 1;
}

.notification-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.notification-delete-btn:active {
    transform: scale(0.9);
}

/* ---- MODAL BODY ---- */
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    overscroll-behavior: contain;
    background: 
        radial-gradient(ellipse at 0% 0%, rgba(11, 59, 145, 0.02) 0%, transparent 60%),
        radial-gradient(ellipse at 100% 100%, rgba(245, 158, 11, 0.02) 0%, transparent 60%),
        #ffffff;
    transform: translateY(8px);
    opacity: 0;
}

.modal-overlay.active .modal-body {
    animation: bodySlideIn 0.35s ease 0.25s forwards;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ---- MODAL FOOTER ---- */
.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateY(8px);
    opacity: 0;
}

.modal-overlay.active .modal-footer {
    animation: footerSlideIn 0.35s ease 0.35s forwards;
}

.modal-footer .btn {
    height: 42px;
    padding: 0 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    min-width: 100px;
}

.modal-footer .btn-secondary {
    background: var(--card);
    border: 2px solid var(--border);
    color: var(--text);
    box-shadow: none;
}

.modal-footer .btn-secondary:hover {
    background: var(--bg-dark);
    border-color: var(--text-light);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(11, 59, 145, 0.25);
}

.modal-footer .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(11, 59, 145, 0.35);
    transform: translateY(-1px);
}

.modal-footer .btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.modal-footer .btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Search & Filter */
.search-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding-left: 40px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-light);
}

.filter-box select {
    min-width: 160px;
}

/* Calendar */
.calendar-container {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-nav button {
    background: none;
    border: 1px solid var(--border);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.calendar-nav button:hover {
    background: var(--bg-dark);
}

.calendar-title {
    font-size: 16px;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.calendar-day {
    min-height: 70px;
    padding: 6px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.other-month {
    background: #F8FAFC;
}

.calendar-day.today {
    background: #EFF6FF;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.calendar-day.today .calendar-day-number {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-event {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: var(--radius-xs);
    margin-bottom: 1px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event.training {
    background: #DBEAFE;
    color: var(--primary);
}

.calendar-event.competition {
    background: #FEF3C7;
    color: var(--warning);
}

.calendar-event.meeting {
    background: #D1FAE5;
    color: var(--accent);
}

/* Equipment Cards */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.equipment-card {
    background: linear-gradient(145deg, #eaf3fb 0%, #d6e7f7 100%);
    border: 1px solid #bdd8ee;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.equipment-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.equipment-image {
    width: 100%;
    height: 150px;
    margin: -20px -20px 16px -20px;
    background: var(--border);
}

.equipment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.equipment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.equipment-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.equipment-category {
    font-size: 12px;
    color: var(--text-secondary);
}

.equipment-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.equipment-stat {
    text-align: center;
    padding: 12px;
    background: #F8FAFC;
    border-radius: var(--radius-sm);
}

.equipment-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.equipment-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--accent);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info .toast-icon {
    color: var(--primary);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-dark);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        max-width: 85vw;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

@media (min-width: 1025px) {
    .sidebar-overlay {
        display: none !important;
    }
    
    .sidebar {
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 85vw;
        max-width: 300px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-header-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-action-group {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-action-group::after {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .calendar-day {
        min-height: 60px;
    }
    
    .calendar-event {
        font-size: 10px;
    }
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Allow direct .active class toggle (used by sidebar user menu)
   since layout.php toggles `.user-dropdown` active class directly */
.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.dropdown-item:hover {
    background: var(--bg-dark);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-avatar:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.profile-avatar:hover .avatar-overlay {
    opacity: 1;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.profile-info h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-info p {
    color: var(--text-secondary);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modern Pagination Styles */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--card);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 24px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-prev svg,
.pagination-next svg {
    width: 16px;
    height: 16px;
}

.pagination-dots {
    color: var(--text-secondary);
    padding: 0 4px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .pagination {
        flex-direction: column;
        align-items: center;
    }
    
    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Athlete Profile (View modal) */
.athlete-profile {

    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.athlete-profile__header {
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(37,99,235,0.18) 0%, rgba(16,185,129,0.10) 60%, rgba(255,255,255,0) 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.athlete-profile__avatarWrap {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.athlete-profile__avatar {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 30px;
    letter-spacing: 0.5px;
}

.athlete-profile__main {
    flex: 1;
    min-width: 0;
}

.athlete-profile__name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.2;
}

.athlete-profile__metaRow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.athlete-profile__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(37,99,235,0.10);
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    border: 1px solid rgba(37,99,235,0.20);
}

.athlete-profile__pill--success {
    background: rgba(34,197,94,0.10);
    color: #16A34A;
    border-color: rgba(34,197,94,0.22);
}

.athlete-profile__pill--danger {
    background: rgba(239,68,68,0.10);
    color: #DC2626;
    border-color: rgba(239,68,68,0.22);
}

.athlete-profile__pill--secondary {
    background: rgba(100,116,139,0.10);
    color: #64748b;
    border-color: rgba(100,116,139,0.22);
}

.athlete-profile__body {
    padding: 18px 20px 22px;
}

.athlete-profile__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.athlete-profile__grid .athlete-profile__item {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.athlete-profile__grid .athlete-profile__item[style*="grid-column"] {
    min-height: 90px;
}

.athlete-profile__grid .athlete-profile__address {
    grid-column: 1 / -1;
}

.athlete-profile__item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    min-height: 64px;
}

.athlete-profile__label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
}

.athlete-profile__value {
    font-size: 14px;
    color: var(--text);
    font-weight: 650;
    word-break: break-word;
}

.athlete-profile__value--muted {
    color: var(--text-secondary);
    font-weight: 600;
}

.athlete-profile__sectionTitle {
    margin: 18px 0 10px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.athlete-profile__address {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.athlete-profile__address pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    color: var(--text);
    font-weight: 600;
}

@media (max-width: 768px) {
    .athlete-profile__grid {
        grid-template-columns: 1fr;
    }
    .athlete-profile__header {
        align-items: flex-start;
    }
}

/* ==============================================
   DARK ATHLETE PROFILE MODAL (ap-*)
   Modern dark dashboard with 3-column layout
   ============================================== */

/* Modal container overrides */
#viewAthleteModal .modal {
    max-width: 960px;
    background: transparent;
    box-shadow: none;
    transform: scale(0.95);
}

#viewAthleteModal.modal-overlay.active .modal {
    transform: scale(1);
}

/* Main dark container */
.ap-profile {
    background: #0F172A;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    color: #F1F5F9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ---- HEADER SECTION ---- */
.ap-header {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.ap-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.ap-avatar-ring {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.ap-avatar-inner {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #1E293B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 32px;
    color: #F59E0B;
    letter-spacing: 1px;
}

.ap-header-info {
    flex: 1;
    min-width: 0;
}

.ap-athlete-name {
    font-size: 26px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 8px;
    line-height: 1.2;
}

.ap-athlete-id {
    font-size: 14px;
    color: #94A3B8;
    font-weight: 500;
    margin-bottom: 10px;
}

.ap-header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ap-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
}

.ap-badge--gold {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
    border-color: rgba(245, 158, 11, 0.25);
}

.ap-badge--green {
    background: rgba(16, 185, 129, 0.12);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.25);
}

.ap-badge--blue {
    background: rgba(59, 130, 246, 0.12);
    color: #60A5FA;
    border-color: rgba(59, 130, 246, 0.25);
}

.ap-badge--purple {
    background: rgba(139, 92, 246, 0.12);
    color: #A78BFA;
    border-color: rgba(139, 92, 246, 0.25);
}

.ap-badge--red {
    background: rgba(239, 68, 68, 0.12);
    color: #F87171;
    border-color: rgba(239, 68, 68, 0.25);
}

.ap-badge--gray {
    background: rgba(148, 163, 184, 0.12);
    color: #94A3B8;
    border-color: rgba(148, 163, 184, 0.25);
}

/* ---- 3-COLUMN BODY ---- */
.ap-body {
    padding: 28px 32px 32px;
}

.ap-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.ap-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Section title with gold accent */
.ap-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #F59E0B;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ap-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.3), transparent);
}

/* Card style for each info block */
.ap-card {
    background: #1E293B;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ap-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ap-card--accent {
    border-left: 3px solid #F59E0B;
}

.ap-card--discount {
    border-left: 3px solid #10B981;
}

.ap-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    margin-bottom: 6px;
}

.ap-card-value {
    font-size: 16px;
    font-weight: 700;
    color: #F1F5F9;
    word-break: break-word;
}

.ap-card-value--gold {
    color: #F59E0B;
}

.ap-card-value--green {
    color: #34D399;
}

.ap-card-value--muted {
    color: #94A3B8;
    font-weight: 600;
}

/* Discount big display */
.ap-discount-display {
    font-size: 28px;
    font-weight: 800;
    color: #34D399;
    line-height: 1.1;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

/* Competition level pill in card */
.ap-card-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(139, 92, 246, 0.12);
    color: #A78BFA;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* Address / pre block */
.ap-address {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 2px;
}

.ap-address pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 13px;
    color: #CBD5E1;
    font-weight: 500;
    line-height: 1.5;
}

/* Personal info grid inside card */
.ap-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ap-info-item {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.ap-info-item-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748B;
    margin-bottom: 6px;
}

.ap-info-item-value {
    font-size: 14px;
    font-weight: 600;
    color: #F1F5F9;
    word-break: break-word;
}

/* ---- ACTION BUTTONS (right column) ---- */
.ap-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    text-decoration: none;
    font-family: inherit;
}

.ap-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ap-btn--gold {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #0F172A;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.ap-btn--gold:hover {
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

.ap-btn--gold:active {
    transform: translateY(0);
}

.ap-btn--outline {
    background: transparent;
    color: #F1F5F9;
    border-color: rgba(255, 255, 255, 0.15);
}

.ap-btn--outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.ap-btn--outline:active {
    transform: translateY(0);
}

.ap-btn--danger-outline {
    background: transparent;
    color: #F87171;
    border-color: rgba(239, 68, 68, 0.25);
}

.ap-btn--danger-outline:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.ap-btn--ghost {
    background: transparent;
    color: #94A3B8;
    border-color: transparent;
}

.ap-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #F1F5F9;
}

/* ---- MODAL HEADER OVERRIDE for dark theme ---- */
#viewAthleteModal .modal-header {
    background: #0F172A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 24px;
}

#viewAthleteModal .modal-title {
    color: #F1F5F9;
    font-size: 16px;
}

#viewAthleteModal .modal-close {
    color: #64748B;
}

#viewAthleteModal .modal-close:hover {
    color: #F1F5F9;
    background: rgba(255, 255, 255, 0.05);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .ap-columns {
        grid-template-columns: 1fr;
    }
    
    .ap-header {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
    
    .ap-header-badges {
        justify-content: center;
    }
    
    .ap-body {
        padding: 20px;
    }
    
    .ap-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .btn,
    .modal-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid var(--border);
    }
}

/* ========== PHOTO UPLOAD ========== */
.photo-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.photo-preview {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    background: #F1F5F9;
    border: 2px dashed #CBD5E1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.photo-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #94A3B8;
    font-size: 10px;
}

.photo-preview-placeholder svg {
    width: 24px;
    height: 24px;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.photo-remove:hover {
    background: #DC2626;
}

.photo-upload-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.photo-upload-actions input[type="file"] {
    display: none;
}

.photo-upload-actions .btn {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.photo-hint {
    font-size: 11px;
    color: #94A3B8;
}

.user-avatar-img {
    border-radius: 50%;
    object-fit: cover;
}

/* Athlete Name Link - clickable to view profile */
.athlete-name-link {
    color:   #080808;
    cursor: pointer;
    text-decoration: none;
    
    transition: color 0.2s ease;
}

.athlete-name-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.athlete-name-link:active {
    color: #041c4a;
}

/* ===== MOBILE RESPONSIVE ENHANCEMENTS ===== */
@media (max-width: 768px) {
    /* General */
    * {
        box-sizing: border-box;
    }
    
    body {
        font-size: 14px;
    }
    
    /* Cards */
    .card {
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .card-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    /* Tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    table {
        font-size: 13px;
        min-width: 600px;
    }
    
    th, td {
        padding: 10px 8px !important;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Header */
    .header {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    /* Page Header */
    .page-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
    
    /* Sidebar */
    .sidebar {
        width: 280px;
        max-width: 85vw;
    }
    
    .nav-item {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* Modals */
    .modal {
        margin: 16px;
        max-width: calc(100% - 32px);
        max-height: calc(100vh - 32px);
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
        max-height: calc(100vh - 200px);
    }
    
    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Calendar */
    .calendar-day {
        min-height: 50px;
        padding: 4px;
    }
    
    .calendar-event {
        font-size: 9px;
        padding: 1px 3px;
    }
    
    .calendar-day-header {
        font-size: 10px;
        padding: 6px 4px;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    /* Profile */
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
        margin: 0 auto;
    }
    
    .profile-info h2 {
        font-size: 20px;
    }
    
    /* Notifications */
    .notification-modal {
        max-width: calc(100% - 32px);
        margin: 16px;
    }
    
    /* Pagination */
    .pagination {
        flex-direction: column;
        gap: 8px;
    }
    
    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Filter forms */
    .filter-form {
        flex-direction: column;
    }
    
    .filter-form input,
    .filter-form select {
        width: 100%;
    }
    
    /* Equipment cards */
    .equipment-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Borrowing table actions */
    .table-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .menu-toggle {
        display: flex !important;
    }
    
    /* Overlay for sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .card {
        border-radius: 8px;
    }
    
    .card-header {
        padding: 12px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    table {
        font-size: 11px;
        min-width: 500px;
    }
    
    th, td {
        padding: 8px 6px !important;
    }
    
    .calendar-day {
        min-height: 40px;
    }
    
    .calendar-event {
        font-size: 8px;
    }
}

/* Ensure proper touch targets on mobile */
@media (max-width: 768px) {
    .header-icon-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .nav-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .btn {
        min-height: 44px;
    }
    
    input, select, textarea {
        min-height: 44px;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .header,
    .menu-toggle,
    .btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ==============================================
   ATHLETE MODULE IN-PAGE NAVIGATION (TAB BAR)
   ============================================== */
.athlete-module-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.athlete-module-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
}

.athlete-module-nav__link:hover {
    background: var(--bg-dark);
    color: var(--text);
}

.athlete-module-nav__link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    font-weight: 600;
}

.athlete-module-nav__link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.athlete-module-nav__link.active svg {
    color: white;
}

@media (max-width: 768px) {
    .athlete-module-nav {
        gap: 2px;
        padding: 4px;
    }

    .athlete-module-nav__link {
        padding: 8px 14px;
        font-size: 13px;
    }

    .athlete-module-nav__link svg {
        width: 16px;
        height: 16px;
    }
}
