:root {
    --primary-blue: #3A5BDE;
    --primary-pink: #FF3385;
    --dark-bg: #0F172A;
    --card-bg: #1E293B;
    --border-color: #334155;
    --text-white: #F8FAFC;
    --text-muted: #94A3B8;
    --gradient-pink: linear-gradient(135deg, #FF66A3, #E6005C);
    --gradient-blue: linear-gradient(135deg, #3A5BDE, #2563EB);
    --gradient-brand: linear-gradient(135deg, #3A5BDE 0%, #FF3385 100%);
    --font-sans: 'Outfit', 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

body {
    background-color: var(--dark-bg);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Login Modal ────────────────────────────────────────────── */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 51, 133, 0.1) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.login-logo {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.login-logo span.blue { color: var(--primary-blue); }
.login-logo span.pink { color: var(--primary-pink); }

.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
    position: relative;
    z-index: 1;
}

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

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-white);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-pink);
    box-shadow: 0 0 10px rgba(255, 51, 133, 0.2);
}

.btn-login {
    width: 100%;
    background: var(--gradient-brand);
    border: none;
    border-radius: 12px;
    padding: 14px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

.btn-login:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.login-error {
    color: #EF4444;
    font-size: 13px;
    margin-top: 15px;
    display: none;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #0B0F19;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-brand span.blue { color: var(--primary-blue); }
.sidebar-brand span.pink { color: var(--primary-pink); }

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-item a:hover {
    color: var(--text-white);
    background: rgba(30, 41, 59, 0.5);
}

.sidebar-item.active a {
    color: white;
    background: var(--gradient-brand);
    box-shadow: 0 4px 15px rgba(255, 51, 133, 0.25);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #EF4444;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    flex-grow: 1;
    padding: 40px;
    background-color: var(--dark-bg);
}

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

.header-title h1 {
    font-size: 28px;
    font-weight: 800;
}

.header-title p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.btn-view-site {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-view-site:hover {
    background: var(--border-color);
    border-color: var(--text-muted);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.pink { background: rgba(255, 51, 133, 0.1); color: var(--primary-pink); }
.stat-icon.blue { background: rgba(58, 91, 222, 0.1); color: var(--primary-blue); }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: #10B981; }

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

/* Sections tabs */
.tab-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards & Modules */
.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
}

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

.card-header-flex h2 {
    font-size: 20px;
    font-weight: 800;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
}

/* Lists and Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

.admin-table th {
    background-color: rgba(15, 23, 42, 0.4);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-white);
    vertical-align: middle;
}

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

.admin-table tr:hover td {
    background-color: rgba(30, 41, 59, 0.2);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}

.badge-yellow { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.badge-blue { background: rgba(58, 91, 222, 0.1); color: var(--primary-blue); }
.badge-pink { background: rgba(255, 51, 133, 0.1); color: var(--primary-pink); }
.badge-red { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.badge-cyan { background: rgba(6, 182, 212, 0.1); color: #06B6D4; }
.badge-green { background: rgba(16, 185, 129, 0.1); color: #10B981; }

.badge-tall { border: 1px dashed var(--primary-pink); }

/* Row actions */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: var(--text-white);
    border-color: var(--text-white);
}

.btn-icon.btn-edit:hover {
    background: rgba(58, 91, 222, 0.1);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-icon.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border-color: #EF4444;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.open .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 800;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-close-modal:hover {
    color: var(--text-white);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Image preview box */
.image-preview-container {
    width: 100%;
    height: 160px;
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.3);
}

.image-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview-placeholder {
    color: var(--text-muted);
    font-size: 13px;
}
