/* =====================================================================
   EventPro Admin — theme
   ===================================================================== */
:root {
    --primary: #5b3cc4;
    --primary-dark: #4527a0;
    --primary-soft: #efeafd;
    --accent: #e9a23b;
    --sidebar-bg: #17132b;
    --sidebar-bg-2: #211b3d;
    --sidebar-text: #b9b3d6;
    --body-bg: #f5f6fb;
    --card-border: #e8e9f2;
    --text: #22223a;
    --muted: #7a7c93;
    --radius: 12px;
    --sidebar-w: 256px;
}

body.admin-body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--body-bg); color: var(--text); font-size: .9rem; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
.font-weight-600 { font-weight: 600; }
.xsmall { font-size: .72rem; }
.lh-sm { line-height: 1.2; }
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):not(.disabled):active { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn { border-radius: 8px; font-weight: 500; }
.btn-sm { border-radius: 6px; }
.form-control, .custom-select { border-radius: 8px; border-color: #dcdded; font-size: .9rem; }
.form-control:focus, .custom-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(91, 60, 196, .15); }
label { font-weight: 500; font-size: .82rem; color: #4a4b63; margin-bottom: .3rem; }
label .req { color: #e3342f; }

/* Extra badge colours used by booking statuses */
.badge { font-weight: 600; padding: .38em .7em; letter-spacing: .01em; }
.badge-purple { background: #7c3aed; color: #fff; }
.badge-orange { background: #f97316; color: #fff; }
.badge-teal { background: #0d9488; color: #fff; }
.badge-indigo { background: #4338ca; color: #fff; }
.badge-accent { background: var(--accent); color: #1b1530; }
.badge-light { background: #eef0f6; color: #555; }
.badge-soft { background: var(--primary-soft); color: var(--primary); }

/* Layout */
.admin-wrapper { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2)); color: var(--sidebar-text); position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040; display: flex; flex-direction: column; transition: transform .25s ease, width .25s ease; }
.sidebar-brand { height: 64px; display: flex; align-items: center; padding: 0 1.1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-brand .brand-text { color: #fff; font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #f5c46b); color: #1b1530; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-logo { height: 36px; max-width: 60px; object-fit: contain; }
.sidebar-nav { overflow-y: auto; flex: 1; padding: .6rem .6rem 2rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar-nav .nav-heading { font-size: .66rem; font-weight: 700; letter-spacing: .12em; color: rgba(255,255,255,.35); padding: 1rem .8rem .35rem; }
.sidebar-nav .nav-item { display: flex; align-items: center; gap: .7rem; color: var(--sidebar-text); padding: .5rem .8rem; border-radius: 8px; font-size: .86rem; text-decoration: none; margin-bottom: 1px; transition: background .15s, color .15s; }
.sidebar-nav .nav-item i { width: 18px; text-align: center; opacity: .85; }
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-item.active { background: linear-gradient(90deg, var(--primary), #7a5ae0); color: #fff; box-shadow: 0 6px 16px rgba(91,60,196,.35); }
.admin-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; transition: margin .25s ease; }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--card-border); display: flex; align-items: center; padding: 0 1.25rem; position: sticky; top: 0; z-index: 1030; }
.topbar-title { font-weight: 600; font-size: 1rem; }
.btn-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #555a75; background: transparent; border: 0; }
.btn-icon:hover { background: #f1f1f8; color: var(--primary); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.user-toggle { background: transparent; border: 0; padding: .25rem .4rem; }
.notif-count { position: absolute; top: 3px; right: 3px; background: #ef4444; color: #fff; font-size: .62rem; min-width: 17px; height: 17px; line-height: 17px; border-radius: 9px; padding: 0 4px; font-weight: 700; }
.notif-menu { width: 360px; max-width: 92vw; padding: 0; border-radius: 12px; border: 0; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: .7rem; padding: .7rem 1rem; border-bottom: 1px solid #f1f1f6; color: var(--text); text-decoration: none !important; }
.notif-item:hover { background: #faf9ff; }
.notif-item.unread { background: #f7f4ff; }
.notif-item .ni-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.admin-content { padding: 1.5rem; flex: 1; }
.admin-footer { display: flex; padding: 1rem 1.5rem; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--card-border); background: #fff; }
.breadcrumb { background: transparent; padding: 0; margin-bottom: 1rem; font-size: .8rem; }
.sidebar-backdrop { display: none; }

body.sidebar-collapsed .sidebar { width: 72px; }
body.sidebar-collapsed .sidebar .brand-text, body.sidebar-collapsed .sidebar .nav-item span, body.sidebar-collapsed .sidebar .nav-heading, body.sidebar-collapsed .sidebar .nav-item .badge { display: none; }
body.sidebar-collapsed .sidebar .nav-item { justify-content: center; }
body.sidebar-collapsed .admin-main { margin-left: 72px; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .admin-main { margin-left: 0 !important; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 12, 30, .45); z-index: 1035; }
    .admin-content { padding: 1rem; }
}

/* Page header */
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.page-header .page-sub { color: var(--muted); font-size: .85rem; margin: .15rem 0 0; }
.page-header .page-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* Cards */
.card { border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 20, 50, .04); }
.card-header { background: #fff; border-bottom: 1px solid var(--card-border); font-weight: 600; padding: .9rem 1.2rem; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-body { padding: 1.2rem; }
.card-title-sm { font-size: .95rem; font-weight: 600; margin: 0; }

.stat-card { position: relative; overflow: hidden; padding: 1.1rem 1.2rem; height: 100%; }
.stat-card .stat-label { color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; margin-top: .25rem; line-height: 1.2; }
.stat-card .stat-icon { position: absolute; right: 1rem; top: 1rem; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.stat-card .stat-foot { font-size: .75rem; color: var(--muted); margin-top: .35rem; }
.si-violet { background: #efeafd; color: #5b3cc4; } .si-amber { background: #fdf3e2; color: #c97d0f; } .si-green { background: #e3f6ec; color: #15803d; }
.si-blue { background: #e4efff; color: #1d4ed8; } .si-red { background: #fde8e8; color: #dc2626; } .si-teal { background: #dcf5f2; color: #0f766e; }
.si-pink { background: #fde7f3; color: #be185d; } .si-slate { background: #eceef4; color: #475569; }

.attention-list .item { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px dashed #ececf4; }
.attention-list .item:last-child { border-bottom: 0; }
.date-chip { width: 48px; min-width: 48px; text-align: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); padding: .3rem 0; line-height: 1.1; }
.date-chip .m { font-size: .62rem; font-weight: 700; text-transform: uppercase; }
.date-chip .d { font-size: 1.1rem; font-weight: 700; }
.empty-state { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2rem; opacity: .35; margin-bottom: .6rem; display: block; }

/* Tables */
table.dataTable { border-collapse: collapse !important; width: 100% !important; }
.table thead th { background: #f8f8fc; color: #5b5d77; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--card-border) !important; border-top: 0; white-space: nowrap; }
.table td { vertical-align: middle; border-top: 1px solid #f0f0f6; }
.table-hover tbody tr:hover { background: #fbfaff; }
.dataTables_wrapper .dataTables_filter input { border-radius: 8px; border: 1px solid #dcdded; padding: .3rem .7rem; }
.dataTables_wrapper .dataTables_length select { border-radius: 8px; }
.dt-buttons .btn { font-size: .75rem; padding: .25rem .6rem; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.page-link { color: var(--primary); }
.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #eee; }
.row-actions .btn { padding: .2rem .45rem; }

/* Modal */
.modal-content { border: 0; border-radius: 14px; }
.modal-header { border-bottom: 1px solid var(--card-border); }
.modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-footer { border-top: 1px solid var(--card-border); }
.img-preview { max-height: 120px; border-radius: 8px; margin-top: .5rem; }

/* Detail views */
.detail-list dt { color: var(--muted); font-weight: 500; font-size: .78rem; }
.detail-list dd { font-weight: 500; margin-bottom: .75rem; }
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: -4px; width: 2px; background: #e6e3f5; }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); }
.workflow { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; }
.workflow .step { flex: 1; min-width: 110px; text-align: center; padding: .55rem .4rem; font-size: .72rem; font-weight: 600; border-radius: 8px; background: #f0f0f6; color: #8a8ca3; }
.workflow .step.done { background: #e3f6ec; color: #15803d; }
.workflow .step.current { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(91,60,196,.3); }
.money { font-variant-numeric: tabular-nums; }
.totals-table td { padding: .35rem .5rem; }
.item-table input { min-width: 70px; }
.nav-tabs .nav-link { font-weight: 500; color: var(--muted); border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.status-tabs .nav-link { border-radius: 20px; font-size: .8rem; padding: .35rem .9rem; color: #555; background: #fff; border: 1px solid var(--card-border); margin: 0 .35rem .35rem 0; }
.status-tabs .nav-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Loading */
.page-loader { position: fixed; inset: 0; background: rgba(255,255,255,.6); z-index: 2000; display: none; align-items: center; justify-content: center; }
.page-loader.show { display: flex; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Calendar */
.fc { font-size: .85rem; }
.fc .fc-button-primary { background: var(--primary); border-color: var(--primary); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--primary-dark); border-color: var(--primary-dark); }
.fc-event { cursor: pointer; border-radius: 4px; padding: 1px 3px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }

/* Auth pages */
.auth-page { min-height: 100vh; display: flex; background: #f5f3ff; font-family: 'Inter', sans-serif; }
.auth-visual { flex: 1; background: linear-gradient(135deg, rgba(23,19,43,.88), rgba(91,60,196,.75)), url('https://images.unsplash.com/photo-1511795409834-ef04bbd61622?auto=format&fit=crop&w=1400&q=80') center/cover; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: flex-end; }
.auth-visual h2 { font-family: 'Playfair Display', serif; font-size: 2.3rem; }
.auth-form { width: 100%; max-width: 480px; background: #fff; display: flex; flex-direction: column; justify-content: center; padding: 3rem; }
@media (max-width: 767.98px) { .auth-visual { display: none; } .auth-form { max-width: 100%; padding: 2rem 1.5rem; } }

/* Print */
@media print {
    .sidebar, .topbar, .admin-footer, .breadcrumb, .no-print, .dt-buttons, .dataTables_filter, .dataTables_length, .dataTables_paginate, .dataTables_info { display: none !important; }
    .admin-main { margin: 0 !important; }
    .admin-content { padding: 0; }
    .card { border: 0; box-shadow: none; }
    body { background: #fff; }
}
