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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.5;
}

/* ========== LOGIN PAGE ========== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.2);
}

.login-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.login-container .alert {
    padding: 0.75rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    text-align: center;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.875rem;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-container input {
    padding: 0.875rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
}

.login-container input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-container .btn-primary {
    background: #6366f1;
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.login-container .btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

/* ========== ADMIN LAYOUT ========== */
.admin-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Admin Navbar */
.admin-nav {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.875rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.admin-logo {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}

.admin-nav-links {
    display: flex;
    gap: 1.5rem;
}

.admin-nav-links a {
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.9375rem;
}

.admin-nav-links a:hover {
    color: #6366f1;
}

.logout-link {
    color: #ef4444 !important;
}
.logout-link:hover {
    color: #dc2626 !important;
}

.mobile-toggle {
    display: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #334155;
}

/* Admin Content */
.admin-content {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
    width: 100%;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 2rem;
}
.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.dashboard-header p {
    color: #64748b;
}

/* Sub Navigation */
.dashboard-subnav {
    background: #ffffff;
    border-radius: 16px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border: 1px solid #eef2ff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.subnav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 40px;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    background: #f8fafc;
}

.subnav-item i {
    font-size: 1rem;
    color: #6366f1;
}

.subnav-item:hover {
    background: #6366f1;
    color: white;
}

.subnav-item:hover i {
    color: white;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eef2ff;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-info a {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6366f1;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-info a:hover {
    text-decoration: underline;
}

/* Recent Activity */
.recent-activity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.recent-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid #eef2ff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.view-all {
    color: #6366f1;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.view-all:hover {
    text-decoration: underline;
}

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

.recent-table th,
.recent-table td {
    padding: 0.75rem 0;
    text-align: left;
    border-bottom: 1px solid #eef2ff;
    font-size: 0.875rem;
}

.recent-table th {
    color: #64748b;
    font-weight: 600;
}

.recent-table td {
    color: #334155;
}

.empty-message {
    color: #94a3b8;
    text-align: center;
    padding: 2rem;
}

/* Tables (for other pages) */
.admin-table {
    width: 100%;
    background: white;
    border-radius: 20px;
    overflow-x: auto;
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eef2ff;
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.admin-table td {
    font-size: 0.875rem;
    color: #334155;
}

.admin-table img {
    max-width: 60px;
    max-height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.admin-table .actions a {
    color: #6366f1;
    text-decoration: none;
    margin-right: 0.75rem;
}

.admin-table .actions a:hover {
    text-decoration: underline;
}

/* Forms */
form input,
form textarea,
form select {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
}

form input:focus,
form textarea:focus,
form select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

form label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #1e293b;
}

.btn-primary {
    background: #6366f1;
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Page Header (for services, tools, etc.) */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: white;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    padding: 2rem;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.modal-card h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    color: #9ca3af;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #4b5563;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-nav-container {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .mobile-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 1rem;
    }

    .admin-nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 1rem;
        gap: 1rem;
    }

    .admin-nav-links.active {
        display: flex;
    }

    .admin-content {
        padding: 0 1rem;
    }

    .dashboard-subnav {
        justify-content: center;
        gap: 0.75rem;
    }
    .subnav-item span {
        display: none;
    }
    .subnav-item {
        padding: 0.6rem;
    }

    .recent-activity {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .admin-table,
    .recent-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}