/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    --sidebar-width: 240px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255, 255, 255, 0.07);
    --sidebar-active: rgba(99, 102, 241, 0.25);
    --primary: #6366f1;
    --primary-light: #818cf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --purple: #a855f7;
    --navbar-h: 56px;
    --radius: 10px;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --font: "Public Sans", system-ui, sans-serif;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: #f8fafc;
    color: #1e293b;
    font-size: 14px;
    margin: 0;
}

/* ── Layout ─────────────────────────────────────────────────── */
.layout-wrapper {
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.admin-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* sidebar brand */
.sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-text {
    color: #fff;
    letter-spacing: 0.3px;
}

/* sidebar user */
.sidebar-user {
    background: rgba(255, 255, 255, 0.04);
}
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

/* sidebar nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    padding: 14px 16px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    margin: 1px 8px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13.5px;
    transition: all 0.15s;
}
.nav-item i {
    font-size: 15px;
    width: 18px;
    flex-shrink: 0;
}
.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.nav-item.active {
    background: var(--sidebar-active);
    color: #a5b4fc;
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}
.sidebar-footer .btn-outline-secondary {
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    font-size: 13px;
}
.sidebar-footer .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Top Navbar ─────────────────────────────────────────────── */
.admin-navbar {
    height: var(--navbar-h);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-title h6 {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.2;
}
.navbar-title .breadcrumb {
    font-size: 11px;
}
.navbar-title .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
}

.avatar-circle-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

/* ── Cards ──────────────────────────────────────────────────── */
.admin-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.card-header-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.card-header-custom h6 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
}

/* stat cards */
.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--card-shadow);
}
.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}
.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}
.stat-change {
    font-size: 11px;
    font-weight: 500;
}
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.icon-primary {
    background: #eef2ff;
    color: var(--primary);
}
.icon-success {
    background: #f0fdf4;
    color: var(--success);
}
.icon-warning {
    background: #fffbeb;
    color: var(--warning);
}
.icon-danger {
    background: #fef2f2;
    color: var(--danger);
}
.icon-info {
    background: #f0f9ff;
    color: var(--info);
}
.icon-purple {
    background: #faf5ff;
    color: var(--purple);
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-responsive-admin {
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.admin-table thead tr {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.admin-table th {
    padding: 10px 14px;
    font-weight: 600;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    text-align: left;
}
.admin-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.admin-table tbody tr:hover {
    background: #f8fafc;
}
.admin-table tbody tr:last-child {
    border-bottom: none;
}
.admin-table td {
    padding: 11px 14px;
    vertical-align: middle;
}

/* ── Badges / Status Pills ──────────────────────────────────── */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-active {
    background: #f0fdf4;
    color: #15803d;
}
.badge-inactive {
    background: #fef2f2;
    color: #b91c1c;
}
.badge-pending {
    background: #fffbeb;
    color: #b45309;
}
.badge-approved {
    background: #f0fdf4;
    color: #15803d;
}
.badge-suspended {
    background: #fef2f2;
    color: #b91c1c;
}
.badge-trial {
    background: #f0f9ff;
    color: #0369a1;
}
.badge-expired {
    background: #f1f5f9;
    color: #64748b;
}
.badge-premium {
    background: #faf5ff;
    color: #7c3aed;
}
.badge-public {
    background: #f0fdf4;
    color: #15803d;
}
.badge-private {
    background: #fff7ed;
    color: #c2410c;
}

/* ── Action Buttons ─────────────────────────────────────────── */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-view {
    background: #eef2ff;
    color: #6366f1;
}
.btn-view:hover {
    background: #e0e7ff;
}
.btn-toggle {
    background: #f0fdf4;
    color: #16a34a;
}
.btn-toggle:hover {
    background: #dcfce7;
}
.btn-delete {
    background: #fef2f2;
    color: #dc2626;
}
.btn-delete:hover {
    background: #fee2e2;
}
.btn-warn {
    background: #fffbeb;
    color: #d97706;
}
.btn-warn:hover {
    background: #fef3c7;
}

/* ── Filter Bar ─────────────────────────────────────────────── */
.filter-bar {
    background: #fff;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}

/* ── Tab Pills ──────────────────────────────────────────────── */
.tab-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.tab-pill {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    text-decoration: none;
    transition: all 0.15s;
}
.tab-pill:hover {
    background: #f8fafc;
}
.tab-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Detail Sections ────────────────────────────────────────── */
.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-label {
    width: 160px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    flex-shrink: 0;
    padding-top: 2px;
}
.detail-value {
    flex: 1;
    font-size: 13.5px;
    color: #1e293b;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.user-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}
.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #6366f1;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}
.user-avatar-placeholder-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #6366f1;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}
.empty-state i {
    font-size: 36px;
    opacity: 0.4;
    margin-bottom: 8px;
    display: block;
}
.empty-state p {
    margin: 0;
    font-size: 13px;
}

/* ── Chart Wrapper ──────────────────────────────────────────── */
.chart-wrapper {
    position: relative;
    height: 200px;
}

/* ── Content & Footer ───────────────────────────────────────── */
.admin-content {
    background: #f8fafc;
}
.admin-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

/* ── Media Grid ─────────────────────────────────────────────── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}
.media-thumb {
    aspect-ratio: 1;
    border-radius: 7px;
    object-fit: cover;
    width: 100%;
}

/* ── Info Alert ─────────────────────────────────────────────── */
.info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 13px;
    color: #0369a1;
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 14px;
    padding: 36px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}
.login-logo {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: #fff;
}

.login-card .form-control {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn-login {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-align: center;
}

.btn-login:hover {
    background: #4f46e5;
    color: #fff;
}

.btn-login:active {
    transform: scale(0.98);
}

.btn-login:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.admin-card > .pagination-footer {
    border-radius: 0 0 var(--radius) var(--radius);
}

.pagination-footer.standalone {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    font-size: 12.5px;
    white-space: nowrap;
}

.pagination-footer .pagination {
    margin: 0;
    flex-wrap: wrap;
    gap: 4px;
}

.pagination .page-link {
    font-size: 13px;
    color: var(--primary);
    border-radius: 6px;
    padding: 6px 12px;
    border-color: #e2e8f0;
    min-width: 36px;
    text-align: center;
}

.pagination .page-link:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #94a3b8;
    background: #f8fafc;
}

/* ── Event / content status badges ────────────────────────── */
.badge-published {
    background: #f0fdf4;
    color: #15803d;
}
.badge-draft {
    background: #f1f5f9;
    color: #64748b;
}
.badge-cancelled {
    background: #fef2f2;
    color: #b91c1c;
}
.badge-completed {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ── Card footer (pagination area inside cards) ───────────── */
.card-footer-custom {
    padding: 0;
    border-top: none;
    background: transparent;
}

/* ── Form controls consistency ──────────────────────────────── */
.admin-content .form-control,
.admin-content .form-select {
    font-size: 13.5px;
    border-radius: 7px;
    border-color: #e2e8f0;
}

.admin-content .form-control:focus,
.admin-content .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.admin-content .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.admin-content .btn-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* ── Breadcrumb links ───────────────────────────────────────── */
.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ── Dropdown fix ───────────────────────────────────────────── */
.dropdown-menu {
    font-size: 13px;
    border-radius: 8px;
    border-color: #e2e8f0;
}

/* ── Modal inside tables ────────────────────────────────────── */
.admin-table .modal {
    font-size: 14px;
}

/* ── Mobile Sidebar Toggle ──────────────────────────────────── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
}
.sidebar-overlay.show {
    display: block;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
}
