/* ============================================================
   PhotoBooth PH - Main Stylesheet
   Dark Navy Sidebar + Light/Dark Mode Toggle
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root[data-theme="light"] {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --border: #e2e8f0;
    --text: #1a202c;
    --text-muted: #718096;
    --text-light: #a0aec0;
    --primary: #1e3a5f;
    --primary-light: #2d5282;
    --accent: #3b82f6;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --sidebar-bg: #1a2744;
    --sidebar-text: rgba(255,255,255,0.75);
    --sidebar-active: #3b82f6;
    --sidebar-hover: rgba(255,255,255,0.08);
    --topbar-bg: #ffffff;
    --input-bg: #f8f9fb;
    --card-header: #f8faff;
    --status-confirmed: #d1fae5; --status-confirmed-text: #065f46;
    --status-pending: #fef3c7; --status-pending-text: #92400e;
    --status-cancelled: #fee2e2; --status-cancelled-text: #991b1b;
    --status-completed: #dbeafe; --status-completed-text: #1e40af;
}

:root[data-theme="dark"] {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-2: #22263a;
    --border: #2d3250;
    --text: #e2e8f0;
    --text-muted: #8892b0;
    --text-light: #4a5568;
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --accent: #60a5fa;
    --accent-green: #34d399;
    --accent-yellow: #fbbf24;
    --accent-red: #f87171;
    --accent-purple: #a78bfa;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
    --sidebar-bg: #0d1117;
    --sidebar-text: rgba(255,255,255,0.65);
    --sidebar-active: #3b82f6;
    --sidebar-hover: rgba(255,255,255,0.06);
    --topbar-bg: #1a1d27;
    --input-bg: #22263a;
    --card-header: #1e2235;
    --status-confirmed: #064e3b; --status-confirmed-text: #6ee7b7;
    --status-pending: #451a03; --status-pending-text: #fcd34d;
    --status-cancelled: #450a0a; --status-cancelled-text: #fca5a5;
    --status-completed: #1e3a8a; --status-completed-text: #93c5fd;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; transition: background 0.3s, color 0.3s; }
a { text-decoration: none; color: inherit; }

/* ---- Layout ---- */
.app-wrapper { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    width: 220px; min-height: 100vh; background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; z-index: 100;
    transition: width 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sidebar-date { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .brand-icon { margin: 0 auto; }

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px; flex-shrink: 0;
}
.brand-name { font-size: 14px; font-weight: 700; color: #fff; line-height: 1; }
.brand-sub { font-size: 8px; color: rgba(255,255,255,0.5); letter-spacing: 0.5px; display: block; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    color: var(--sidebar-text); font-size: 13px; font-weight: 500;
    transition: all 0.2s; cursor: pointer;
}
.nav-item i { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.sidebar-footer {
    padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: space-between;
}
.sidebar-date { font-size: 10px; color: rgba(255,255,255,0.4); }
.logout-btn { color: rgba(255,255,255,0.4); font-size: 16px; transition: color 0.2s; }
.logout-btn:hover { color: var(--accent-red); }

/* ---- Main Area ---- */
.main-area { margin-left: 220px; flex: 1; display: flex; flex-direction: column; transition: margin-left 0.3s; min-height: 100vh; }
.sidebar.collapsed ~ .main-area { margin-left: 64px; }

/* ---- Topbar ---- */
.topbar {
    background: var(--topbar-bg); border-bottom: 1px solid var(--border);
    padding: 12px 24px; display: flex; align-items: center;
    justify-content: space-between; position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px; }
.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--input-bg); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 14px; width: 320px;
}
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; font-family: inherit; }
.search-box i { color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
    background: var(--input-bg); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 10px; cursor: pointer;
    color: var(--text-muted); font-size: 15px; transition: all 0.2s;
}
.theme-toggle:hover { background: var(--accent); color: white; border-color: var(--accent); }

.notif-btn { position: relative; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.badge {
    position: absolute; top: -2px; right: 0;
    background: var(--accent-red); color: white;
    border-radius: 50%; font-size: 9px; width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}

.user-profile { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); display: block; }
.user-role { font-size: 11px; color: var(--text-muted); display: block; }
.topbar-logout { color: var(--text-muted); font-size: 18px; padding: 4px; transition: color 0.2s; }
.topbar-logout:hover { color: var(--accent-red); }

/* ---- Alert Area ---- */
.alert-area { padding: 0 24px; }
.alert {
    padding: 12px 16px; border-radius: 8px; margin-top: 12px;
    font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px;
    animation: slideIn 0.3s ease;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
[data-theme="dark"] .alert-success { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .alert-danger { background: #450a0a; color: #fca5a5; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Content Area ---- */
.content-area { padding: 24px; flex: 1; }

/* ---- Page Header ---- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---- Cards ---- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.card-header {
    padding: 16px 20px; background: var(--card-header);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }

/* ---- Stat Cards ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 18px 20px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); }
.stat-sub { font-size: 11px; color: var(--accent-green); margin-top: 2px; }
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.stat-icon.blue { background: #dbeafe; color: #3b82f6; }
.stat-icon.green { background: #d1fae5; color: #10b981; }
.stat-icon.yellow { background: #fef3c7; color: #f59e0b; }
.stat-icon.purple { background: #ede9fe; color: #8b5cf6; }
.stat-icon.red { background: #fee2e2; color: #ef4444; }
[data-theme="dark"] .stat-icon.blue { background: #1e3a8a; color: #60a5fa; }
[data-theme="dark"] .stat-icon.green { background: #064e3b; color: #34d399; }
[data-theme="dark"] .stat-icon.yellow { background: #451a03; color: #fbbf24; }
[data-theme="dark"] .stat-icon.purple { background: #2e1065; color: #a78bfa; }
[data-theme="dark"] .stat-icon.red { background: #450a0a; color: #f87171; }

/* ---- Tables ---- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    padding: 11px 14px; text-align: left;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
    background: var(--card-header); border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ---- Badges / Status ---- */
.badge-status {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-confirmed { background: var(--status-confirmed); color: var(--status-confirmed-text); }
.badge-pending { background: var(--status-pending); color: var(--status-pending-text); }
.badge-cancelled { background: var(--status-cancelled); color: var(--status-cancelled-text); }
.badge-completed { background: var(--status-completed); color: var(--status-completed-text); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 8px; font-size: 13px;
    font-weight: 600; border: none; cursor: pointer; transition: all 0.2s;
    font-family: inherit;
}
.btn-primary { background: #1e3a5f; color: white; }
.btn-primary:hover { background: #2d5282; }
.btn-success { background: var(--accent-green); color: white; }
.btn-success:hover { filter: brightness(0.9); }
.btn-danger { background: var(--accent-red); color: white; }
.btn-danger:hover { filter: brightness(0.9); }
.btn-warning { background: var(--accent-yellow); color: white; }
.btn-warning:hover { filter: brightness(0.9); }
.btn-outline {
    background: transparent; border: 1px solid var(--border);
    color: var(--text); 
}
.btn-outline:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px 9px; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.form-control {
    background: var(--input-bg); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 12px; font-size: 13px;
    color: var(--text); font-family: inherit; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23718096' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ---- Quick Action Buttons (Dashboard) ---- */
.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.quick-action-btn {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-radius: 8px; background: var(--surface-2);
    border: 1px solid var(--border); cursor: pointer; transition: all 0.2s;
    font-size: 13px; font-weight: 600; color: var(--text);
}
.quick-action-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.quick-action-btn:hover i { color: white; }
.quick-action-btn i { color: var(--accent); transition: color 0.2s; }

/* ---- Calendar ---- */
.calendar-table { width: 100%; border-collapse: collapse; }
.calendar-table th { padding: 10px; text-align: center; font-size: 12px; font-weight: 700; color: var(--text-muted); background: var(--card-header); border: 1px solid var(--border); }
.calendar-table td { padding: 6px; border: 1px solid var(--border); vertical-align: top; height: 80px; width: 14.28%; font-size: 12px; }
.cal-day { font-weight: 700; color: var(--text); margin-bottom: 4px; font-size: 13px; }
.cal-day.other-month { color: var(--text-light); }
.cal-event {
    padding: 2px 6px; border-radius: 4px; font-size: 10px;
    font-weight: 600; margin-bottom: 2px; cursor: pointer; line-height: 1.4;
}
.cal-event.photobooth { background: #ede9fe; color: #6d28d9; }
.cal-event.camera { background: #d1fae5; color: #065f46; }
.cal-event.equipment { background: #dbeafe; color: #1e40af; }
[data-theme="dark"] .cal-event.photobooth { background: #2e1065; color: #c4b5fd; }
[data-theme="dark"] .cal-event.camera { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .cal-event.equipment { background: #1e3a8a; color: #93c5fd; }
.cal-today { background: rgba(59,130,246,0.05); }

/* ---- Booking Type Legend ---- */
.legend { display: flex; gap: 12px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { width: 64px; }
    .sidebar .brand-text, .sidebar .nav-item span, .sidebar .sidebar-date { display: none; }
    .sidebar .nav-item { justify-content: center; padding: 12px; }
    .main-area { margin-left: 64px; }
    .search-box { width: 160px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Utility ---- */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-yellow); }
.fw-bold { font-weight: 700; }
.fs-small { font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.full-width { grid-column: 1 / -1; }
