:root {
    --black: #0c0d10;
    --dark: #12141a;
    --card-bg: #181a22;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 184, 0, 0.35);
    --gold: #ffb800;
    --gold-light: #ffd54f;
    --red: #d32f2f;
    --green: #25d366;
    --white: #ffffff;
    --muted: #9e9e9e;
    --sidebar-width: 260px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--black);
    color: var(--white);
    overflow-x: hidden;
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
    display: flex;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    background: var(--black);
    padding: 20px;
}

.login-box {
    max-width: 400px;
    width: 100%;
    padding: 35px;
    background: var(--card-bg);
    border: 1px solid var(--border-hover);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85);
    border-radius: 16px;
    text-align: center;
}

.logo {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo span {
    color: var(--gold);
}

.login-subtitle {
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 6px;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.login-error {
    color: #ff5252;
    font-size: 0.85rem;
    font-weight: 600;
    display: none;
    margin-bottom: 12px;
}

.login-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    margin-top: 10px;
    font-size: 0.95rem;
}

.back-link {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 16px;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--white);
}

/* ===== LAYOUT ===== */
#admin-app {
    display: flex;
    min-height: 100vh;
}

/* ===== MOBILE NAV BAR ===== */
.mobile-nav-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--dark);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.mobile-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 150;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .subtitle {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--muted);
    text-transform: uppercase;
    margin-top: 4px;
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.25s ease;
    border-left: 4px solid transparent;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--gold);
    background: rgba(255, 184, 0, 0.1);
    border-left-color: var(--gold);
}

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

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 12px;
}

.admin-user i {
    font-size: 1.4rem;
    color: var(--gold);
}

.logout-btn-full {
    width: 100%;
    margin-top: 8px;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    cursor: pointer;
    border: 1px solid var(--red);
    border-radius: 8px;
    background: rgba(211, 47, 47, 0.1);
    color: #ff5252;
    font-weight: 700;
    transition: all 0.2s;
}

.logout-btn-full:hover {
    background: var(--red);
    color: var(--white);
}

.site-link {
    margin-top: 10px;
    display: block;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    text-decoration: none;
}

.site-link:hover {
    color: var(--gold);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-width: 0;
}

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

.top-header h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: 700;
}

/* VIEWS */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 184, 0, 0.15);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-details h3 {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
}

.section-block {
    margin-top: 30px;
}

.section-title {
    font-family: Georgia, serif;
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: var(--gold);
}

.categories-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* BUTTONS & INPUTS */
.primary-btn {
    background: linear-gradient(135deg, var(--gold) 0%, #ff8f00 100%);
    color: #000000;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.3);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 184, 0, 0.45);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.action-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px 10px;
    font-size: 1.1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.action-btn:hover {
    color: var(--gold);
    background: rgba(255, 184, 0, 0.15);
}

.action-btn.delete:hover {
    color: #ff5252;
    background: rgba(211, 47, 47, 0.15);
}

/* FILTERS BAR */
.filters-bar {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-input, .admin-select {
    background: var(--dark);
    border: 1px solid var(--border);
    color: var(--white);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    outline: none;
}

.admin-input:focus, .admin-select:focus {
    border-color: var(--gold);
}

/* TABLES */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.admin-table th, .admin-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.text-right {
    text-align: right !important;
}

.table-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

.badge.success { background: rgba(37, 211, 102, 0.15); color: var(--green); border: 1px solid rgba(37, 211, 102, 0.3); }
.badge.danger { background: rgba(211, 47, 47, 0.15); color: #ff5252; border: 1px solid rgba(211, 47, 47, 0.3); }

/* MODALS */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 16px;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-hover);
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-large {
    max-width: 740px;
}

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

.modal-header h2 {
    font-family: Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
}

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

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

.modal-form {
    padding: 22px;
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--dark);
    border: 1px solid var(--border);
    color: var(--white);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--gold);
}

.radio-group {
    display: flex;
    gap: 16px;
    margin-bottom: 6px;
}

.custom-radio, .custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--white);
}

.sizes-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.size-lbl {
    font-size: 0.75rem;
    color: var(--gold);
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.image-preview {
    width: 100%;
    height: 160px;
    background: var(--dark);
    border: 1px dashed var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--muted);
    gap: 8px;
}

.image-placeholder i {
    font-size: 2.2rem;
}

.file-label {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 4px;
    display: block;
}

/* RESPONSIVE DESIGN FOR MOBILE & TABLET */
@media (max-width: 768px) {
    .mobile-nav-bar {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        top: 60px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 80px 16px 30px 16px;
    }

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

    .top-header h1 {
        font-size: 1.4rem;
    }
}
