/* Bombay Wire CMS — charcoal + orange (matches public theme) */
:root {
    --admin-bg: #f4f4f5;
    --admin-topbar: #222222;
    --admin-topbar-hover: #2d2d2d;
    --admin-sidebar: #ffffff;
    --admin-sidebar-border: #e5e5e5;
    --admin-text: #222222;
    --admin-muted: #6b6b6b;
    --admin-accent: #ff5722;
    --admin-accent-light: #ff7043;
    --admin-card-shadow: 0 4px 20px rgba(34, 34, 34, 0.06);
    --admin-sidebar-width: 260px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 16px; }

body.admin-app {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--admin-text);
    background: var(--admin-bg);
    min-height: 100vh;
}

body.admin-app--minimal {
    background: var(--admin-bg);
}

/* Top navbar */
.top-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
    padding: 0 20px;
    background: var(--admin-topbar);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.top-navbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.top-navbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.top-navbar__logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(145deg, #ff7043 0%, var(--admin-accent) 55%, #e64a19 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
}

.top-navbar__title {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
}

.top-navbar__search-wrap {
    flex: 1;
    max-width: 420px;
    position: relative;
    display: none;
}

@media (min-width: 900px) {
    .top-navbar__search-wrap {
        display: block;
    }
}

.top-navbar__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--admin-muted);
    font-size: 14px;
}

.top-navbar__search {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    outline: none;
}

.top-navbar__search:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.top-navbar__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-navbar__icon {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.top-navbar__icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.top-navbar__user {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 600px) {
    .top-navbar__user {
        display: flex;
    }
}

.top-navbar__user i {
    font-size: 22px;
    opacity: 0.9;
}

.top-navbar__logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.top-navbar__logout:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.top-navbar__link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.top-navbar__link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Shell + sidebar */
.admin-shell {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: var(--admin-sidebar-width);
    flex-shrink: 0;
    background: var(--admin-sidebar);
    border-right: 1px solid var(--admin-sidebar-border);
    padding: 20px 0;
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
    z-index: 900;
    transform: translateX(0);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
}

.sidebar__section {
    padding: 0 14px;
    margin-bottom: 22px;
}

.sidebar__section--bottom {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--admin-sidebar-border);
}

.sidebar__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--admin-muted);
    padding: 0 12px 8px;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--admin-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar__link i {
    width: 20px;
    text-align: center;
    color: var(--admin-muted);
    font-size: 15px;
}

.sidebar__link:hover {
    background: rgba(255, 87, 34, 0.06);
    color: var(--admin-accent);
}

.sidebar__link:hover i {
    color: var(--admin-accent);
}

.sidebar__link.is-active {
    background: linear-gradient(90deg, rgba(255, 87, 34, 0.12), rgba(255, 112, 67, 0.06));
    color: var(--admin-accent);
    font-weight: 600;
    border-left: 3px solid var(--admin-accent);
    margin-left: -3px;
}

.sidebar__link.is-active i {
    color: var(--admin-accent);
}

/* Main panel */
.main-panel {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    min-width: 0;
    transition: margin-left 0.25s ease;
}

body.sidebar-collapsed .main-panel {
    margin-left: 0;
}

.main-panel--solo {
    margin-left: 0;
    max-width: 1100px;
    margin-right: auto;
    margin-left: auto;
    padding: 28px 20px 48px;
}

.main-panel__inner {
    padding: 24px 28px 40px;
    max-width: 1320px;
    margin: 0 auto;
}

.container-fluid {
    width: 100%;
}

@media (max-width: 991px) {
    .sidebar {
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    }

    body:not(.sidebar-collapsed) .sidebar {
        transform: translateX(0);
    }

    body:not(.sidebar-collapsed)::before {
        content: '';
        position: fixed;
        inset: 60px 0 0 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 850;
    }

    .main-panel {
        margin-left: 0 !important;
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-collapsed::before {
        display: none;
    }
}

/* Page header (breadcrumb style) */
.page-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 28px;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
    border-bottom: 1px solid var(--admin-sidebar-border);
}

.page-header-bar__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--admin-text);
    letter-spacing: -0.02em;
}

.page-header-bar__sub {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--admin-muted);
}

.page-header-bar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dashboard stat cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 8px;
}

.dashboard-stat {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid var(--admin-sidebar-border);
    box-shadow: var(--admin-card-shadow);
    border-top: 4px solid var(--admin-accent);
}

.dashboard-stat--blue { border-top-color: #ff5722; }
.dashboard-stat--sky { border-top-color: #ff7043; }
.dashboard-stat--navy { border-top-color: #e64a19; }
.dashboard-stat--teal { border-top-color: #bf360c; }

.dashboard-stat__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--admin-muted);
}

.dashboard-stat__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--admin-text);
    margin-top: 8px;
    line-height: 1.2;
}

/* Cards */
.card {
    background: #fff;
    border: 1px solid var(--admin-sidebar-border);
    border-radius: 12px;
    box-shadow: var(--admin-card-shadow);
    padding: 22px;
    margin-top: 20px;
}

.card--flush {
    margin-top: 0;
}

.card h1, .card h2 {
    margin: 0 0 10px 0;
}

.section-heading-admin {
    font-size: 18px;
    font-weight: 700;
    color: var(--admin-text);
}

.muted { color: var(--admin-muted); font-size: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }

.alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0 0 0;
    font-size: 14px;
}
.alert.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: 14px; }
input[type="text"], input[type="password"], input[type="search"], textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
textarea { min-height: 200px; resize: vertical; }
input:focus, textarea:focus, select:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.1s;
}

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

.btn.primary {
    background: linear-gradient(135deg, var(--admin-accent-light), var(--admin-accent));
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 87, 34, 0.35);
}
.btn.primary:hover { filter: brightness(1.06); color: #fff; }

.btn.secondary { background: #2d3748; color: #fff; }
.btn.secondary:hover { background: #1a202c; color: #fff; }

.btn.outline {
    background: #fff;
    border: 1px solid #cbd5e0;
    color: var(--admin-text);
}
.btn.outline:hover { background: #f7fafc; }

.btn-light {
    background: #edf2f7;
    color: var(--admin-text);
    border: 1px solid #e2e8f0;
}
.btn-light:hover { background: #e2e8f0; color: var(--admin-text); }

.btn.danger { background: #e53e3e; color: #fff; }
.btn.danger:hover { background: #c53030; color: #fff; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}
th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--admin-sidebar-border);
    vertical-align: top;
}
th {
    background: #f7fafc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--admin-muted);
    font-weight: 700;
}
code.k {
    background: #edf2f7;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 13px;
}
