/* Admin Portal Styles */

/* --- Auth Pages --- */
.auth-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: 1.5rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0f172a, #334155);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 1.8rem;
}

.auth-logo::after {
    content: "🔒";
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-soft);
}

.auth-form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-soft);
    background: var(--page-bg);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-auth {
    width: 100%;
    padding: 0.85rem;
    border-radius: 0.75rem;
    background: var(--accent);
    color: white;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s;
    margin-top: 1rem;
}

.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-soft);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-soft);
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

/* --- Dashboard Layout --- */
.dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: var(--page-bg);
}



/* Mobile Top Bar (Only visible on mobile) */
.mobile-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--card);
    border-bottom: 1px solid var(--border-soft);
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

@media (max-width: 900px) {
    .mobile-top-bar {
        display: flex;
    }
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    margin-left: -0.5rem;
}

.dash-overlay {
    display: none;
}

/* Sidebar */
.dash-sidebar {
    background: var(--card);
    border-right: 1px solid var(--border-soft);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.dash-brand {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-main);
}

.dash-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.dash-nav-item {
    padding: 0.8rem 1rem;
    border-radius: 0.6rem;
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.dash-nav-item:hover {
    background: var(--page-bg-soft);
    color: var(--text-main);
}

.dash-nav-item.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-soft);
}

.dash-user {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-soft);
    font-size: 0.85rem;
    color: var(--text-soft);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 0.6rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
    transition: 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Main Content */
.dash-main {
    padding: 2.5rem;
    overflow-y: auto;
    height: 100vh;
    max-width: 100%;
}

.dash-header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 1.5rem;
}

.dash-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Content Panels */
.dash-panel {
    display: none;
    animation: fadeUp 0.4s ease-out;
}

.dash-panel.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin Lists (Team/Events) - Flex List View */
.data-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.data-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-soft);
    padding: 1.2rem 1.5rem;
    border-radius: 0;
    position: relative;
    transition: background 0.2s;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.5fr 0.8fr auto;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .data-card {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        align-items: flex-start;
        position: relative;
    }

    /* Labeling for mobile context could be added here if needed, 
       but for now we just stack them nicely. */

    .data-info-primary {
        font-size: 1.1rem;
    }

    .data-info-tertiary {
        white-space: normal !important;
        /* Allow wrapping on mobile */
        max-width: 100% !important;
    }

    .data-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.8rem;
        padding-top: 0.8rem;
        border-top: 1px dashed var(--border-soft);
        gap: 1rem;
    }

    .btn-sm {
        padding: 0.6rem 1.2rem;
        /* Larger touch targets */
    }
}

.data-card:last-child {
    border-bottom: none;
}

.data-card:hover {
    background: var(--page-bg-soft);
}

.data-info-primary {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
}

.data-info-secondary,
.data-info-tertiary {
    font-size: 0.9rem;
    color: var(--text-soft);
}

.data-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

/* Action Buttons */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 1px solid var(--border-soft);
    background: white;
    color: var(--text-soft);
    transition: 0.2s;
}

.btn-sm:hover {
    background: var(--page-bg-soft);
    color: var(--text-main);
    border-color: var(--text-main);
}

.btn-delete {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-soft);
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.open .modal-box {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-soft);
    line-height: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 900px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        display: block;
        /* Ensure no grid rows are created for fixed elements */
    }

    /* Sidebar - Mobile: Hidden by default, slides in */
    .dash-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 1.5rem;
        border-right: 1px solid var(--border-soft);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
    }

    .dash-sidebar.open {
        transform: translateX(0);
    }

    .dash-nav {
        flex-direction: column;
        overflow-x: visible;
        padding-bottom: 0;
    }

    /* Mobile toggle overlay */
    .dash-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .dash-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .dash-main {
        padding: 1.5rem;
        padding-top: 5rem !important;
        /* Visual clearance for fixed header */
        /* Space for top bar */
        height: auto;
        min-height: 100vh;
    }

    .dash-panel .dash-header {
        margin-top: 1rem;
    }
}