/* ==========================================================================
   Admin Panel Styles — Sidebar Layout + Mobile Cards
   ========================================================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --gold-light: #ffe44d;
    --bg-dark: #0f0f15;
    --bg-card: #1a1a25;
    --bg-input: #12121c;
    --bg-sidebar: #13131d;
    --border: #2a2a3a;
    --text: #e0e0e0;
    --text-muted: #888;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --sidebar-w: 240px;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: 
        radial-gradient(ellipse at 30% 30%, rgba(45,27,105,0.3), transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(74,14,46,0.2), transparent 50%),
        var(--bg-dark);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    margin: 20px;
}

.login-header { text-align: center; margin-bottom: 30px; }
.login-icon { font-size: 2.5rem; color: var(--gold); margin-bottom: 15px; }
.login-header h1 { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: var(--gold); margin-bottom: 5px; }
.login-header p { color: var(--text-muted); font-size: 0.9rem; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; margin-bottom: 8px; font-size: 0.85rem;
    color: var(--text-muted); font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.settings-form input[type="text"] {
    width: 100%; padding: 12px 16px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-family: 'Montserrat', sans-serif; font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.settings-form input:focus {
    outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,215,0,0.1);
}

.login-error {
    background: rgba(231,76,60,0.1); border: 1px solid rgba(231,76,60,0.3);
    border-radius: 8px; padding: 10px 15px; color: var(--danger);
    font-size: 0.85rem; margin-bottom: 15px;
}

.login-btn {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #000; border: none; border-radius: 8px;
    font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 0.95rem;
    cursor: pointer; transition: all 0.3s;
}
.login-btn:hover {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    box-shadow: 0 4px 20px rgba(255,215,0,0.3); transform: translateY(-1px);
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
}
.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem; font-weight: 700; color: var(--gold);
}

.sidebar-nav {
    flex: 1; padding: 15px 0; overflow-y: auto;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 22px; color: var(--text-muted);
    text-decoration: none; font-size: 0.9rem; font-weight: 500;
    transition: all 0.2s; cursor: pointer; border: none; background: none;
    width: 100%; text-align: left;
    font-family: 'Montserrat', sans-serif;
}
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-item.active {
    color: var(--gold); background: rgba(255,215,0,0.08);
    border-right: 3px solid var(--gold);
}
.nav-logout:hover { color: var(--danger); }

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 10px 0;
}

/* ===== FLOATING MENU BUTTON ===== */
.fab-menu {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 250;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #000;
    border: none;
    width: 40px;
    height: 48px;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 16px rgba(255,215,0,0.25);
    transition: all 0.3s;
}
.fab-menu:hover {
    width: 46px;
    box-shadow: 2px 2px 24px rgba(255,215,0,0.4);
}
.fab-menu.open {
    left: var(--sidebar-w);
}

/* ===== MOBILE TOPBAR (hidden, kept for logout on mobile) ===== */
.topbar {
    display: none;
}

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 150;
    transition: opacity 0.3s;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 0;
    padding: 25px 30px 25px 50px;
    min-height: 100vh;
    transition: margin-left 0.3s ease, padding 0.3s ease;
}
.main-content.shifted {
    margin-left: var(--sidebar-w);
    padding-left: 30px;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.page-title i { color: var(--gold); }

/* Section toggling */
.content-section { display: none; }
.content-section.active { display: block; }

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 18px;
    display: flex; align-items: center; gap: 14px;
    transition: all 0.3s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }

.stat-icon {
    width: 46px; height: 46px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    flex-shrink: 0;
}
.stat-total .stat-icon { background: rgba(255,215,0,0.15); color: var(--gold); }
.stat-accepted .stat-icon { background: rgba(46,204,113,0.15); color: var(--success); }
.stat-declined .stat-icon { background: rgba(231,76,60,0.15); color: var(--danger); }
.stat-pending .stat-icon { background: rgba(243,156,18,0.15); color: var(--warning); }
.stat-viewed .stat-icon { background: rgba(52,152,219,0.15); color: var(--info); }

.stat-number { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ===== SECTION CARDS ===== */
.section-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
}

.section-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.section-header h2 {
    font-family: 'Playfair Display', serif; font-size: 1.2rem;
    display: flex; align-items: center; gap: 10px;
}
.section-header h2 i { color: var(--gold); }

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px; border: none; border-radius: 8px;
    font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 0.85rem;
    cursor: pointer; transition: all 0.3s;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-gold { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #000; }
.btn-gold:hover { background: linear-gradient(135deg, var(--gold), var(--gold-light)); box-shadow: 0 4px 15px rgba(255,215,0,0.3); }
.btn-cancel { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-cancel:hover { border-color: var(--text-muted); }

.btn-icon {
    padding: 7px 10px; background: transparent; border: 1px solid var(--border);
    border-radius: 6px; color: var(--text-muted); cursor: pointer;
    transition: all 0.3s; font-size: 0.8rem;
}
.btn-icon:hover { border-color: var(--gold); color: var(--gold); }
.btn-icon.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-icon.btn-copy:hover { border-color: var(--info); color: var(--info); }
.btn-icon.btn-whatsapp { color: #25D366; }
.btn-icon.btn-whatsapp:hover { border-color: #25D366; color: #25D366; background: rgba(37,211,102,0.1); }
.btn-icon.btn-facebook { color: #1877F2; }
.btn-icon.btn-facebook:hover { border-color: #1877F2; color: #1877F2; background: rgba(24,119,242,0.1); }

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex; gap: 5px; padding: 12px 22px;
    border-bottom: 1px solid var(--border); overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.filter-tab {
    padding: 7px 16px; background: transparent; border: 1px solid var(--border);
    border-radius: 20px; color: var(--text-muted); font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem; cursor: pointer; transition: all 0.3s; white-space: nowrap;
}
.filter-tab:hover, .filter-tab.active {
    border-color: var(--gold); color: var(--gold); background: rgba(255,215,0,0.08);
}

/* ===== DESKTOP TABLE ===== */
.guest-table { width: 100%; border-collapse: collapse; }
.guest-table th {
    padding: 12px 18px; text-align: left; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
    font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.guest-table td {
    padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.88rem; vertical-align: middle;
}
.guest-table tbody tr { transition: background 0.2s; }
.guest-table tbody tr:hover { background: rgba(255,215,0,0.03); }

.loading-row { text-align: center; color: var(--text-muted); padding: 40px !important; }

/* Badges */
.badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-accepted { background: rgba(46,204,113,0.15); color: var(--success); }
.badge-declined { background: rgba(231,76,60,0.15); color: var(--danger); }
.badge-pending { background: rgba(243,156,18,0.15); color: var(--warning); }
.badge-viewed { background: rgba(52,152,219,0.15); color: var(--info); }
.badge-not-viewed { background: rgba(136,136,136,0.15); color: var(--text-muted); }

.share-buttons { display: flex; align-items: center; gap: 5px; }
.action-buttons { display: flex; gap: 5px; }

/* ===== MOBILE GUEST CARDS ===== */
.guest-cards { padding: 12px; display: grid; gap: 12px; }

.guest-card {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px; transition: border-color 0.3s;
}
.guest-card:hover { border-color: rgba(255,215,0,0.3); }

.gc-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 10px;
}
.gc-name { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.gc-number { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }

.gc-badges { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

.gc-code {
    font-size: 0.75rem; color: var(--gold); font-family: monospace;
    margin-bottom: 10px; opacity: 0.8;
}

.gc-share {
    margin-bottom: 12px;
    background: rgba(0,0,0,0.25); border-radius: 6px; padding: 8px 10px;
    justify-content: center;
}

.gc-actions {
    display: flex; gap: 8px; border-top: 1px solid var(--border);
    padding-top: 12px;
}
.gc-actions .btn-icon { flex: 1; text-align: center; justify-content: center; display: flex; padding: 9px 8px; }

/* Toggle mobile vs desktop */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* ===== SETTINGS FORM ===== */
.settings-form { padding: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 5px; }

.checkbox-label {
    display: flex !important; align-items: center; gap: 10px; cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); }

/* ===== MODAL ===== */
.modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-content {
    position: relative; width: 100%; max-width: 450px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 30px; margin: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.modal-header h3 { font-family: 'Playfair Display', serif; color: var(--gold); font-size: 1.3rem; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer; transition: color 0.3s;
}
.modal-close:hover { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 30px; right: 30px;
    padding: 14px 25px; background: var(--bg-card);
    border: 1px solid var(--gold); border-radius: 8px;
    color: var(--gold); font-size: 0.9rem; z-index: 2000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideInToast 0.4s ease;
}
@keyframes slideInToast {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.toast.toast-success { border-color: var(--success); color: var(--success); }
.toast.toast-error { border-color: var(--danger); color: var(--danger); }

/* ===== RESPONSIVE: TABLET ===== */
@media (max-width: 1024px) {
    .main-content { padding: 20px; }
}

/* ===== RESPONSIVE: MOBILE ===== */
@media (max-width: 768px) {
    /* Show topbar, hide sidebar by default */
    .topbar { display: flex; }

    .sidebar-overlay.show { display: block; }

    .main-content {
        padding: 15px 15px 15px 50px;
    }
    .main-content.shifted {
        margin-left: 0;
        padding-left: 15px;
    }

    .fab-menu.open {
        left: var(--sidebar-w);
    }

    /* Show cards, hide table */
    .mobile-only { display: block; }
    .desktop-only { display: none; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card { padding: 14px; }
    .stat-number { font-size: 1.3rem; }
    .stat-icon { width: 40px; height: 40px; font-size: 1rem; }

    .section-header {
        padding: 14px 16px;
        flex-wrap: wrap; gap: 10px;
    }
    .section-header h2 { font-size: 1.05rem; }

    .filter-tabs { padding: 10px 12px; }

    .form-row { grid-template-columns: 1fr; }
    .settings-form { padding: 16px; }

    .page-title { font-size: 1.2rem; }

    .toast { bottom: 15px; right: 15px; left: 15px; text-align: center; }
}

@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .gc-actions { flex-wrap: wrap; }
}
