:root {
    --page-bg: #f4ede6;
    --panel-bg: #fffaf5;
    --ink: #2e1d20;
    --muted: #6d5a5d;
    --line: #eadfd5;
    --brand: #6a0f1b;
    --brand-dark: #541019;
    --brand-soft: #efe0db;
    --gold: #c7a46d;
    --sidebar: #4b0f17;
    --sidebar-soft: #661621;
    --success: #16a34a;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--ink);
    letter-spacing: 0;
    font-family: Inter, system-ui, sans-serif;
}

.app-body {
    overflow-x: hidden;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(199, 164, 109, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(106, 15, 27, 0.14), transparent 22%),
        linear-gradient(135deg, #f8f2eb, #f0e5dc);
}

.login-shell {
    width: min(1080px, calc(100% - 32px));
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 0.78fr);
    gap: 22px;
    align-items: stretch;
}

.login-aside {
    padding: 38px;
    border-radius: 24px;
    color: #fff4ed;
    background:
        linear-gradient(145deg, rgba(106, 15, 27, 0.95), rgba(84, 16, 25, 0.95)),
        linear-gradient(180deg, rgba(199, 164, 109, 0.12), transparent);
    box-shadow: 0 28px 80px rgba(80, 20, 28, 0.18);
}

.login-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-aside h1 {
    margin: 1rem 0 0.7rem;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    line-height: 1;
}

.login-aside p {
    max-width: 46ch;
    color: #f7ddd4;
    line-height: 1.75;
}

.login-points {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.login-points div {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.login-points i {
    color: var(--gold);
}

.login-panel {
    padding: 36px;
    background: rgba(255, 250, 245, 0.94);
    border: 1px solid rgba(106, 15, 27, 0.08);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(80, 28, 34, 0.12);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-title {
    margin: 0 0 0.25rem;
    font-family: Fraunces, Georgia, serif;
    font-size: 1.55rem;
    color: var(--brand-dark);
}

.login-copy {
    margin: 0;
    color: var(--muted);
}

.brand-mark,
.brand-logo {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), #872336);
    color: #fff;
    font-weight: 800;
    font-size: 1.35rem;
}

.field-wrap {
    position: relative;
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: rgba(106, 15, 27, 0.55);
    pointer-events: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: var(--sidebar);
    color: #fff;
    padding: 22px;
}

.sidebar-brand {
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand-lockup strong,
.brand-lockup small {
    display: block;
    line-height: 1.15;
}

.brand-lockup small {
    margin-top: 4px;
    color: #e7cfc5;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 24px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding-right: 6px;
    align-content: start;
}

.sidebar-group {
    padding: 10px 0;
}

.sidebar-group + .sidebar-group {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
    margin-top: 2px;
}

.sidebar-group-title {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 0 4px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.sidebar-group-title::-webkit-details-marker {
    display: none;
}

.sidebar-group-title i {
    font-size: 0.95rem;
    transition: transform 0.18s ease;
}

.sidebar-group[open] .sidebar-group-title i {
    transform: rotate(180deg);
}

.sidebar-group-items {
    display: grid;
    gap: 8px;
    padding-top: 8px;
}

.sidebar-group:not([open]) .sidebar-group-items {
    display: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #f1ddd6;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--sidebar-soft);
    color: #fff;
}

.sidebar-link.active {
    box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-footer {
    display: grid;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
}

.user-chip strong,
.user-chip small {
    display: block;
    line-height: 1.15;
}

.user-chip small {
    margin-top: 3px;
    color: #e7cfc5;
}

.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff4ed;
    color: var(--brand-dark);
    font-weight: 800;
}

.mobile-sidebar {
    background: var(--sidebar);
    color: #fff;
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 28px;
    background: rgba(244, 237, 230, 0.88);
    border-bottom: 1px solid rgba(234, 223, 213, 0.9);
    backdrop-filter: blur(14px);
}

.topbar h2 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--brand-dark);
}

.topbar-eyebrow {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    background: #fff;
}

.app-content {
    width: 100%;
    padding: 28px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.page-heading h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
}

.page-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

.content-section,
.metric-card {
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(80, 28, 34, 0.06);
}

.content-section {
    padding: 20px;
    max-width: 100%;
    overflow: hidden;
}

.admin-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable;
}

.admin-table-wrap .dt-container,
.admin-table-wrap .dataTables_wrapper {
    width: 100%;
    max-width: 100%;
}

.admin-table-wrap table.dataTable {
    width: 100% !important;
    margin-bottom: 0;
}

.admin-table-wrap td:last-child,
.admin-table-wrap th:last-child {
    white-space: nowrap;
}

.metric-card {
    min-height: 112px;
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: none;
}

.metric-icon {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(106, 15, 27, 0.08);
    color: var(--brand);
    font-size: 1.25rem;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.08rem;
}

.btn {
    border-radius: 12px;
    font-weight: 600;
}

.btn-primary {
    border-color: var(--brand);
    background: linear-gradient(135deg, var(--brand), #872336);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--brand-dark);
    background: linear-gradient(135deg, var(--brand-dark), #701926);
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: var(--line);
    min-height: 48px;
}

.field-wrap .form-control {
    padding-left: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(106, 15, 27, 0.35);
    box-shadow: 0 0 0 0.2rem rgba(106, 15, 27, 0.12);
}

.login-submit {
    min-height: 50px;
}

.table {
    vertical-align: middle;
}

.table thead th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.table .btn {
    margin-right: 4px;
}

.badge-status {
    min-width: 72px;
}

.permission-toolbar {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.permission-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fdf8f3;
}

.permission-group strong {
    width: 100%;
    font-size: 0.9rem;
}

.logo-preview-card {
    min-height: 170px;
    display: grid;
    place-items: center;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    background: #fdf8f3;
}

.logo-preview-image {
    max-width: 100%;
    max-height: 138px;
    object-fit: contain;
}

.logo-preview-empty {
    color: var(--muted);
    font-size: 0.92rem;
}

.slider-preview-card {
    min-height: 210px;
    display: grid;
    place-items: center;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    background:
        radial-gradient(circle at top, rgba(199, 164, 109, 0.12), transparent 30%),
        #fdf8f3;
}

.slider-preview-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}

.slider-preview-empty {
    color: var(--muted);
    font-size: 0.92rem;
}

.swal2-popup {
    border-radius: 14px;
}

.logout-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(199, 164, 109, 0.16), transparent 26%),
        radial-gradient(circle at top right, rgba(106, 15, 27, 0.14), transparent 22%),
        linear-gradient(135deg, #f8f2eb, #f0e5dc);
}

.logout-stage {
    width: min(460px, calc(100% - 32px));
}

.logout-card {
    display: grid;
    justify-items: center;
    text-align: center;
    padding: 38px 32px;
    background: rgba(255, 250, 245, 0.96);
    border: 1px solid rgba(106, 15, 27, 0.08);
    border-radius: 22px;
    box-shadow: 0 26px 80px rgba(80, 28, 34, 0.14);
}

.logout-card h1 {
    margin: 20px 0 8px;
    font-size: 1.8rem;
    font-weight: 800;
}

.logout-card p,
.logout-card small {
    color: var(--muted);
}

.logout-orbit {
    position: relative;
    display: grid;
    place-items: center;
    width: 118px;
    height: 118px;
    border-radius: 999px;
    background: rgba(106, 15, 27, 0.08);
}

.logout-orbit::before {
    content: "";
    position: absolute;
    inset: 9px;
    border: 2px solid rgba(106, 15, 27, 0.18);
    border-top-color: var(--brand);
    border-radius: 999px;
    animation: logoutSpin 1.15s linear infinite;
}

.logout-core {
    z-index: 1;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), #872336);
    color: #fff;
    font-size: 1.7rem;
    box-shadow: 0 16px 30px rgba(106, 15, 27, 0.25);
}

.orbit-dot {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--brand);
    opacity: 0.75;
}

.dot-one {
    top: 7px;
    right: 34px;
}

.dot-two {
    right: 10px;
    bottom: 30px;
    background: var(--gold);
}

.dot-three {
    left: 18px;
    bottom: 24px;
    background: var(--success);
}

.logout-progress {
    width: 100%;
    height: 8px;
    margin: 20px 0 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #eadfd5;
}

.logout-progress span {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), #872336);
    transform-origin: left;
    animation: logoutProgress 3s linear forwards;
}

@keyframes logoutSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes logoutProgress {
    to {
        transform: scaleX(0);
    }
}

@media (max-width: 991.98px) {
    .login-shell {
        grid-template-columns: 1fr;
        width: min(560px, calc(100% - 32px));
    }

    .login-aside {
        padding: 24px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .topbar {
        padding: 14px 16px;
    }

    .app-content {
        padding: 18px 14px;
    }

    .topbar-actions {
        display: none;
    }
}

@media (max-width: 768px) {
    .login-panel {
        padding: 24px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .permission-toolbar {
        grid-template-columns: 1fr;
    }
}
