/* Import Outfit and Inter Font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #0d5c34;
    --primary-light: #15804c;
    --primary-dark: #073b20;
    --accent-color: #ffd700;
    --accent-dark: #ccab00;
    --accent-glow: rgba(255, 215, 0, 0.35);
    --bg-dark: #0a140f;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    --card-bg: #ffffff;
    --card-border: rgba(13, 92, 52, 0.15);
    --error-color: #ef4444;
    --success-color: #10b981;
    --transition-speed: 0.3s;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background visual decoration for premium look */
body::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(13, 92, 52, 0.4) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Container & Card */
.container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    z-index: 1;
}

.card {
    background: var(--card-bg);
    border: none;
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(13, 92, 52, 0.08);
    transform: translateY(-2px);
}

/* Header (Logo & Title) */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.05));
}

.logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    transition: transform var(--transition-speed);
}

.logo:hover {
    transform: scale(1.08) rotate(2deg);
}

.logo-dashboard-wrapper {
    display: inline-block;
}

.logo-dashboard {
    height: 50px;
    width: 50px;
    object-fit: contain;
    display: block;
}

.title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Alerts / Messages */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
    animation: slideInDown 0.3s ease-out;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

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

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    transition: color var(--transition-speed);
}

.form-control {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-family: var(--font-body);
    font-size: 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background-color: #f1f5f9;
    color: var(--text-main);
    outline: none;
    transition: all var(--transition-speed) ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 92, 52, 0.1);
}

.form-control:focus+.input-icon {
    color: var(--primary-color);
}

.form-control-select {
    padding-left: 16px;
    /* dropdown doesn't strictly need icon, but let's keep clean */
}

/* Actions (Forgot password, Remember me) */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 13px;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.forgot-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Button styling */
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(13, 92, 52, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 92, 52, 0.3),
        0 0 0 3px var(--accent-glow);
}

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

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1.5px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: var(--primary-color);
}

/* Dashboard-specific styling */
.dashboard-container {
    width: 100%;
    max-width: 1000px;
    padding: 30px 20px;
    z-index: 1;
}

.dashboard-card {
    background: var(--card-bg);
    border: none;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.dashboard-card:hover {
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
}

.dashboard-header {
    background: #ffffff;
    padding: 30px 40px;
    color: var(--primary-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--primary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background-color: rgba(13, 92, 52, 0.08);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: var(--primary-color);
}

.welcome-text h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
}

.welcome-text p {
    font-size: 14px;
    color: var(--text-muted);
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--accent-color);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.dashboard-body {
    padding: 40px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.menu-item {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
}

.menu-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(13, 92, 52, 0.05);
    background-color: #f0fdf4;
}

.menu-icon {
    font-size: 32px;
    color: var(--primary-color);
}

.menu-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
}

.menu-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    cursor: pointer;
}

/* Decorative Footer */
.footer-text {
    text-align: center;
    margin-top: 25px;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-text a {
    color: var(--text-muted);
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .card {
        padding: 30px 20px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }

    .dashboard-body {
        padding: 20px;
    }
}

/* ========================================================
   ADMIN CONTROL PANEL LAYOUT & COMPONENTS
   ======================================================== */
.admin-body {
    background-color: #f1f5f9;
    color: var(--text-main);
    display: block;
    height: 100vh;
    overflow: hidden;
}

.admin-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar styling */
.admin-sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid rgba(13, 92, 52, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all var(--transition-speed);
    height: 100vh;
}

/* Collapsed state */
.admin-sidebar.collapsed {
    width: 80px;
}

.admin-sidebar.collapsed .admin-sidebar-title,
.admin-sidebar.collapsed .admin-menu-item span {
    display: none;
}

.admin-sidebar.collapsed .admin-sidebar-header {
    padding: 24px 10px;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
}

.admin-sidebar.collapsed .admin-menu-item a {
    justify-content: center;
    padding: 12px;
}

.admin-sidebar.collapsed .admin-menu-item a i {
    margin: 0;
}

.admin-sidebar.collapsed .admin-sidebar-footer a span {
    display: none;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    margin-left: auto;
    transition: transform var(--transition-speed), color var(--transition-speed);
}

.sidebar-toggle-btn:hover {
    color: var(--primary-color);
}

.admin-sidebar.collapsed .sidebar-toggle-btn {
    margin-left: 0;
    transform: rotate(180deg);
}

.admin-sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.admin-sidebar-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.admin-sidebar-menu {
    padding: 20px 14px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.admin-menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all var(--transition-speed);
}

.admin-menu-item a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: color var(--transition-speed);
}

.admin-menu-item a:hover {
    background-color: #f0fdf4;
    color: var(--primary-color);
}

.admin-menu-item a:hover i {
    color: var(--primary-color);
}

.admin-menu-item.active a {
    background-color: var(--primary-color);
    color: #ffffff;
}

.admin-menu-item.active a i {
    color: #ffffff;
}

.admin-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Main Content styling */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
}

.admin-topbar {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.admin-topbar-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-user-details {
    text-align: right;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .admin-user-details {
        display: none;
        /* Hide text on mobile */
    }
}

.admin-user-name {
    font-size: 14px;
    font-weight: 600;
}

.admin-user-role {
    font-size: 11px;
    color: var(--text-muted);
    background-color: #f1f5f9;
    padding: 2px 8px;
    border-radius: 20px;
}

.admin-content {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

/* Statistics widgets */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .span-2-mobile {
        grid-column: span 2;
    }

    .stat-info h3 {
        font-size: 10px;
        white-space: normal;
        margin-bottom: 4px;
    }

    .stat-info p {
        font-size: 20px;
    }

    .stat-icon-box {
        width: 32px;
        height: 32px;
        font-size: 14px;
        flex-shrink: 0;
    }
}

.stat-card {
    background-color: #ffffff;
    border: 1px solid rgba(13, 92, 52, 0.08);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-speed);
    gap: 15px;
    /* add gap to prevent overlap */
    min-width: 0;
    /* Prevent overflow globally */
    word-wrap: break-word;
    /* Allow text to wrap globally */
}

.stat-card.span-2 {
    grid-column: span 2;
}

.stat-info {
    min-width: 0;
    /* allow flex child text to wrap */
    flex: 1;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-info h3 {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info p {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-dark);
}

.stat-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.stat-icon-green {
    background-color: #f0fdf4;
    color: var(--primary-color);
}

.stat-icon-blue {
    background-color: #eff6ff;
    color: #3b82f6;
}

.stat-icon-yellow {
    background-color: #fefce8;
    color: #ca8a04;
}

.stat-icon-purple {
    background-color: #faf5ff;
    color: #a855f7;
}

/* Table and Content Cards styling */
.admin-card-table {
    background-color: #ffffff;
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.admin-card-table:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.admin-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-card-header h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table-admin {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.table-admin th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    padding: 16px 24px;
    border-bottom: 2px solid #f1f5f9;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.table-admin td {
    padding: 16px 24px;
    border-bottom: 1px solid #f8fafc;
    color: var(--text-main);
    transition: background-color 0.2s ease;
}

.table-admin tr:last-child td {
    border-bottom: none;
}

.table-admin tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges for status */
.badge-status {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-active {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-inactive {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Buttons and Actions */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Admin Modals & Forms */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: flex-start;
    /* Align to top to allow scroll down */
    z-index: 100;
    padding: 40px 20px;
    /* Padding top & bottom for spacing when scrolling */
    overflow-y: auto;
    /* Enable scrollbar if content is taller than viewport */
}

.modal-overlay.show {
    display: flex;
}

.admin-modal {
    background-color: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: slideInDown 0.25s ease-out;
    margin: auto;
    /* Standard vertical flex spacing helper */
}

.admin-modal-large {
    max-width: 700px;
}

.admin-modal-header {
    padding: 20px 24px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.admin-modal-body {
    padding: 24px;
}

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

/* Responsive sidebar */
@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 50;
    }

    .admin-sidebar.show {
        left: 0;
    }

    .admin-content {
        padding: 15px;
        padding-bottom: 80px;
        /* Space for bottom nav */
    }

    .admin-topbar {
        padding: 0 15px;
    }

    .admin-topbar-title {
        font-size: 16px;
    }

    .admin-sidebar-logo {
        width: 30px;
        height: 30px;
    }
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    z-index: 40;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    padding: 0 10px;
    justify-content: space-around;
    align-items: center;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    flex: 1;
    height: 100%;
    transition: color 0.2s;
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item span {
    font-size: 10px;
    font-weight: 600;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:hover {
    color: var(--primary-color);
}

/* Search Box Container */
.search-container {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: none;
    border-radius: 20px;
    background-color: #f1f5f9;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-main);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.search-input:focus {
    outline: none;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 92, 52, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Utility Animations */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}