:root {
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #8da0bc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #eef3f7;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: rgba(15, 118, 110, 0.12);
    --text-main: #0f172a;
    --text-soft: #64748b;
    --border: #dbe3ee;
    --border-strong: #c7d4e2;
    --danger: #dc2626;
    --warning: #d97706;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.08), transparent 22%),
        linear-gradient(180deg, #edf3f7 0%, #f8fafc 100%);
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

.admin-page {
    min-height: 100vh;
}

.admin-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem 1rem;
    background:
        radial-gradient(circle at top, rgba(20, 184, 166, 0.18), transparent 28%),
        linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: var(--sidebar-text);
    box-shadow: var(--shadow);
    z-index: 1040;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.4rem 0.7rem 1.3rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #0044ff, #0521ff);
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 10px 30px rgb(0 69 134 / 28%);
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand strong {
    font-size: 1rem;
}

.sidebar-brand small {
    color: var(--sidebar-muted);
}

.sidebar-section-label {
    padding: 0 0.8rem;
    margin: 0 0 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    text-decoration: none;
    color: var(--sidebar-text);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.14), rgba(255, 255, 255, 0.08));
    color: #fff;
    transform: translateX(4px);
}

.sidebar-nav a.active {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 1rem;
}

.sidebar-nav a.active .nav-icon {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1035;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar-footer-label {
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-muted);
}

.sidebar-footer-name {
    font-weight: 700;
    color: #fff;
}

.sidebar-footer-note {
    margin-top: 0.45rem;
    font-size: 0.85rem;
    color: var(--sidebar-muted);
    line-height: 1.5;
}

.main-panel {
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(219, 227, 238, 0.9);
}

.topbar-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.topbar-toggle {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
}

.topbar-heading {
    min-width: 0;
}

.topbar-kicker {
    display: inline-block;
    margin-bottom: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.page-title {
    font-size: clamp(1.45rem, 2vw, 1.8rem);
    font-weight: 800;
    line-height: 1.15;
}

.topbar-subtitle {
    margin-top: 0.35rem;
    color: var(--text-soft);
    font-size: 0.93rem;
    line-height: 1.45;
    max-width: 58ch;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem 0.8rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.user-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    font-weight: 800;
}

.user-meta {
    line-height: 1.2;
}

.user-meta strong,
.user-meta small {
    display: block;
}

.user-meta small {
    color: var(--text-soft);
}

.content-area {
    flex: 1;
    padding: 1.5rem;
}

.content-area > * {
    width: min(100%, 1440px);
    margin-left: auto;
    margin-right: auto;
}

.admin-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem 1.25rem;
    color: var(--text-soft);
    font-size: 0.9rem;
    width: min(100%, 1440px);
    margin: 0 auto;
}

.page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.55rem;
    margin-bottom: 1.6rem;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(59, 130, 246, 0.06)),
        #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.page-hero-body {
    max-width: 760px;
    min-width: 0;
}

.page-eyebrow {
    display: inline-block;
    margin-bottom: 0.7rem;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-hero-title {
    margin: 0;
    font-size: clamp(1.6rem, 2.6vw, 2.15rem);
    font-weight: 800;
    line-height: 1.1;
}

.page-hero-text {
    margin: 0.8rem 0 0;
    max-width: 660px;
    color: var(--text-soft);
    line-height: 1.7;
}

.page-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
}

.content-panel,
.stats-card,
.card,
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.content-panel,
.section-card {
    padding: 1.4rem;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.panel-title {
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.panel-text {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.panel-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stats-card {
    position: relative;
    height: 100%;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
}

.stats-card .icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: #fff;
}

.stats-card .value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stats-card .label {
    margin-top: 0.4rem;
    font-weight: 700;
    line-height: 1.3;
}

.stats-card .helper {
    margin-top: 0.5rem;
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.55;
}

.mini-stat {
    padding: 1.1rem 1.15rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    height: 100%;
}

.mini-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.mini-stat-label {
    margin-top: 0.3rem;
    font-weight: 700;
}

.mini-stat-text {
    margin-top: 0.35rem;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.quick-link-grid {
    display: grid;
    gap: 0.9rem;
}

.quick-links a {
    text-decoration: none;
}

.quick-link-card {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.05rem;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-link-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft);
}

.quick-link-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 1.15rem;
}

.quick-link-title {
    font-weight: 800;
}

.quick-link-text {
    margin-top: 0.2rem;
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.55;
}

.aside-stack {
    display: grid;
    gap: 1rem;
}

.bullet-list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bullet-list li {
    display: flex;
    gap: 0.75rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.bullet-list li i {
    color: var(--primary);
    margin-top: 0.15rem;
}

.filter-panel {
    margin-bottom: 1.6rem;
}

.filter-toolbar {
    display: grid;
    gap: 1rem;
}

.toolbar-form .form-label {
    margin-bottom: 0.4rem;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.results-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.results-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.table-responsive {
    border-radius: 18px;
    overflow-x: auto;
}

.table-card .table {
    margin-bottom: 0;
}

.table-card .table-responsive {
    margin-inline: -0.2rem;
    padding-inline: 0.2rem;
}

.table thead th {
    color: var(--text-soft);
    font-size: 0.77rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border-bottom-width: 1px;
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.table tbody td {
    vertical-align: middle;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-color: rgba(219, 227, 238, 0.75);
}

.entity-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 220px;
}

.entity-avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(59, 130, 246, 0.14));
    color: var(--primary-dark);
    font-weight: 800;
}

.entity-title {
    font-weight: 800;
    line-height: 1.3;
}

.entity-subtitle {
    margin-top: 0.15rem;
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.4;
}

.action-cluster {
    display: inline-flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.action-cluster .btn {
    white-space: nowrap;
    min-height: 36px;
}

.badge {
    padding: 0.6em 0.85em;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    font-weight: 800;
}

.app-alert {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    border: none;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    padding: 0.95rem 1rem;
}

.app-alert-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

.app-alert-content {
    flex: 1;
}

.form-shell {
    display: grid;
    gap: 1.35rem;
}

.form-section {
    padding-top: 0.25rem;
}

.form-section + .form-section {
    margin-top: 0.2rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border);
}

.section-kicker {
    margin-bottom: 0.25rem;
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.section-subtitle {
    margin: 0.35rem 0 1.15rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.form-label {
    font-weight: 700;
    color: #334155;
}

.form-control,
.form-select,
.input-group-text,
.btn {
    border-radius: 14px;
}

.btn {
    min-height: 44px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn-sm {
    min-height: 36px;
}

.form-control,
.form-select {
    min-height: 50px;
    border-color: var(--border);
    box-shadow: none;
}

textarea.form-control {
    min-height: 120px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.5);
    box-shadow: 0 0 0 0.25rem rgba(15, 118, 110, 0.12);
}

.form-hint {
    margin-top: 0.35rem;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1.3rem;
    border-top: 1px solid var(--border);
}

.action-bar-note {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.detail-grid {
    display: grid;
    gap: 1rem;
}

.detail-card {
    height: 100%;
    padding: 1.15rem 1.2rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.detail-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-value {
    font-weight: 800;
    line-height: 1.5;
    word-break: break-word;
}

.detail-muted {
    color: var(--text-soft);
    font-weight: 500;
}

.logo-preview {
    display: block;
    max-width: 220px;
    max-height: 110px;
    padding: 0.65rem;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: radial-gradient(circle at top left, rgb(0 144 255 / 18%), transparent 30%), radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.14), transparent 25%), linear-gradient(180deg, #f8fafc 0%, #eef3f7 100%);
}
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(219, 227, 238, 0.95);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.login-brand h1 {
    margin-bottom: 0.15rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-soft);
}

.toolbar-form .col-md-2,
.toolbar-form .col-md-3,
.toolbar-form .col-lg-3 {
    min-width: 0;
}

.bg-teal { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.bg-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.bg-orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.bg-red { background: linear-gradient(135deg, #f87171, #dc2626); }
.bg-green { background: linear-gradient(135deg, #4ade80, #16a34a); }
.bg-slate { background: linear-gradient(135deg, #64748b, #334155); }

@media (max-width: 1199.98px) {
    .content-area {
        padding: 1.35rem;
    }

    .page-hero {
        flex-direction: column;
    }

    .page-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    body.sidebar-open {
        overflow: hidden;
    }

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

    .topbar {
        padding: 1rem;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
    }

    .content-area {
        padding: 1.15rem;
    }

    .entity-cell {
        min-width: 180px;
    }
}

@media (max-width: 767.98px) {
    .topbar,
    .topbar-user,
    .admin-footer,
    .results-meta,
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .page-title {
        font-size: 1.45rem;
    }

    .content-area {
        padding: 1rem;
    }

    .page-hero,
    .content-panel,
    .section-card {
        padding: 1.1rem;
        border-radius: 22px;
    }

    .user-chip {
        width: 100%;
    }

    .toolbar-actions .btn,
    .panel-actions .btn,
    .page-hero-actions .btn {
        width: 100%;
    }

    .table-card .table-responsive {
        margin-inline: -0.35rem;
        padding-inline: 0.35rem;
    }

    .table thead th,
    .table tbody td {
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }

    .action-cluster {
        width: 100%;
        justify-content: stretch;
    }

    .action-cluster .btn {
        flex: 1 1 100%;
    }

    .entity-cell {
        min-width: 240px;
    }
}

@media (max-width: 575.98px) {
    .sidebar {
        width: min(86vw, 320px);
        padding: 1.2rem 0.85rem 0.9rem;
    }

    .topbar {
        gap: 0.85rem;
    }

    .topbar-kicker {
        margin-bottom: 0.4rem;
    }

    .topbar-subtitle {
        font-size: 0.9rem;
    }

    .content-panel,
    .stats-card,
    .section-card,
    .page-hero {
        border-radius: 20px;
    }

    .content-panel,
    .stats-card,
    .section-card {
        padding: 1.05rem;
    }

    .results-chip {
        width: 100%;
        justify-content: center;
    }

    .admin-footer {
        font-size: 0.84rem;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .btn,
    form,
    .admin-footer {
        display: none !important;
    }

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

    .content-area {
        padding: 0;
    }

    .page-hero,
    .content-panel,
    .stats-card,
    .card,
    .section-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
