:root {
    --tdb-bg: #f5f5f5;
    --tdb-surface: rgba(255, 255, 255, 0.92);
    --tdb-border: rgba(17, 17, 17, 0.08);
    --tdb-shadow: 0 18px 40px rgba(0, 128, 255, 0.08);
    --tdb-sidebar: linear-gradient(180deg, #111111 0%, #222222 52%, #111111 100%);
    --tdb-primary: #0080ff;
    --tdb-secondary: #ce01cc;
    --tdb-accent: #0080ff;
    --tdb-text: #111111;
    --tdb-muted: #666666;
    --tdb-radius: 22px;
}

body {
    font-family: "IBM Plex Sans", sans-serif;
    color: var(--tdb-text);
    background:
        radial-gradient(circle at top left, rgba(0, 128, 255, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(206, 1, 204, 0.10), transparent 22%),
        var(--tdb-bg);
}

h1, h2, h3, h4, h5, h6, .display-6, .page-title, .topbar-title, .metric-value {
    font-family: "Manrope", sans-serif;
}

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

.app-frame {
    display: flex;
    min-height: 100vh;
}

.sidebar-panel,
.sidebar-offcanvas {
    width: 290px;
    background: var(--tdb-sidebar);
}

.sidebar-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    color: rgba(255, 255, 255, 0.92);
}

.sidebar-branding {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 2rem;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(206, 1, 204, 0.95), rgba(255, 255, 255, 0.85));
    color: #111111;
    font-weight: 800;
    letter-spacing: 0.12em;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.sidebar-overline,
.topbar-overline,
.page-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
    color: #999999;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-nav {
    display: grid;
    gap: 0.55rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: all 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateX(4px);
}

.sidebar-link i {
    font-size: 1.1rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logout-form {
    margin-top: 1rem;
}

.sidebar-logout-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 700;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sidebar-logout-button:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.sidebar-logout-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(0, 128, 255, 0.28);
}

.content-shell {
    flex: 1;
    min-width: 0;
    padding: 1.25rem;
}

.topbar-panel,
.card-panel,
.metric-card,
.table-panel,
.form-panel,
.chart-panel {
    background: var(--tdb-surface);
    border: 1px solid var(--tdb-border);
    box-shadow: var(--tdb-shadow);
    border-radius: var(--tdb-radius);
    backdrop-filter: blur(16px);
}

.topbar-panel {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.topbar-title {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0.15rem 0 0;
}

.topbar-user {
    border-radius: 999px;
    padding: 0.45rem 0.75rem 0.45rem 0.45rem;
    border: 1px solid var(--tdb-border);
    background: rgba(17, 17, 17, 0.04);
}

.topbar-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--tdb-border);
    background: rgba(17, 17, 17, 0.04);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 0.35rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #ce01cc;
    color: #fff;
    font-size: 0.72rem;
}

.notification-menu {
    width: min(380px, 92vw);
    padding: 0.5rem 0;
}

.notification-item {
    white-space: normal;
    display: block;
}

.notification-item.unread {
    background: rgba(0, 128, 255, 0.06);
}

.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-right: 0.5rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #0080ff, #111111);
    color: #fff;
    font-weight: 700;
}

.content-area {
    display: grid;
    gap: 1.25rem;
}

.page-header {
    margin-bottom: 0.25rem;
}

.page-title {
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.page-description {
    color: var(--tdb-muted);
    max-width: 780px;
}

.metric-card {
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
    animation: rise-in 0.45s ease both;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto -40px -40px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(0, 128, 255, 0.08);
}

.metric-card.metric-warning::after {
    background: rgba(206, 1, 204, 0.16);
}

.metric-title {
    color: var(--tdb-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.95rem;
    font-weight: 800;
    line-height: 1.1;
}

.metric-subtitle {
    margin-top: 0.4rem;
    color: var(--tdb-muted);
    font-size: 0.85rem;
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(0, 128, 255, 0.12);
    color: var(--tdb-primary);
    font-size: 1.25rem;
}

.table-panel,
.form-panel,
.chart-panel {
    padding: 1.25rem;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.panel-subtitle {
    color: var(--tdb-muted);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.table > :not(caption) > * > * {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.table thead th {
    color: #888888;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom-color: rgba(17, 17, 17, 0.08);
}

.badge-soft {
    border-radius: 999px;
    padding: 0.55rem 0.8rem;
    font-weight: 600;
}

.form-control,
.form-select {
    border-radius: 14px;
    border-color: rgba(17, 17, 17, 0.10);
    padding: 0.75rem 0.9rem;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 128, 255, 0.12);
    border-color: rgba(0, 128, 255, 0.35);
}

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

.btn-primary {
    background: linear-gradient(135deg, #0080ff, #0099ff);
    border-color: transparent;
}

.btn-outline-secondary {
    border-color: rgba(17, 17, 17, 0.12);
}

.data-entry-panel {
    padding: 0;
    overflow: hidden;
}

.data-entry-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 0;
}

.data-entry-copy {
    max-width: 760px;
}

.data-entry-title {
    font-family: "Manrope", sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.data-entry-description {
    color: var(--tdb-muted);
    margin-bottom: 0.85rem;
}

.data-entry-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.data-entry-toolbar .btn {
    min-width: 132px;
}

.data-entry-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0 1.25rem 1rem;
}

.data-grid-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.05);
    color: var(--tdb-text);
    font-size: 0.82rem;
    font-weight: 600;
}

.data-grid-badge-primary {
    background: rgba(0, 128, 255, 0.12);
    color: var(--tdb-primary);
}

.data-entry-grid-wrap {
    overflow: auto;
    border-top: 1px solid rgba(17, 17, 17, 0.08);
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 252, 0.98));
}

.data-grid-table {
    margin: 0;
    min-width: 1080px;
}

.data-grid-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(246, 249, 252, 0.98);
    box-shadow: inset 0 -1px 0 rgba(17, 17, 17, 0.08);
}

.data-grid-table > :not(caption) > * > * {
    padding: 0.55rem 0.5rem;
    vertical-align: top;
}

.data-grid-row-header,
.data-grid-row-number {
    position: sticky;
    left: 0;
    z-index: 1;
    background: rgba(246, 249, 252, 0.98);
}

.data-grid-row-number {
    font-weight: 700;
    color: var(--tdb-muted);
    text-align: center;
    min-width: 56px;
}

.data-grid-row-empty .data-grid-row-number {
    color: rgba(102, 102, 102, 0.65);
}

.data-grid-cell {
    min-width: 150px;
}

.data-grid-input {
    min-height: 42px;
    border-radius: 12px;
    border-color: rgba(17, 17, 17, 0.08);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: none;
}

.data-grid-input:focus {
    background: #fff;
}

.data-grid-input.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.data-grid-feedback {
    margin-top: 0.35rem;
    color: #b42318;
    font-size: 0.74rem;
    line-height: 1.35;
}

.data-grid-textarea {
    min-height: 42px;
    resize: vertical;
}

.data-grid-actions {
    min-width: 92px;
    position: sticky;
    right: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.98);
}

.data-entry-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem 1.25rem;
}

.data-entry-helper {
    display: grid;
    gap: 0.5rem;
    min-width: min(100%, 520px);
}

.data-entry-helper-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    background: rgba(17, 17, 17, 0.04);
    color: var(--tdb-text);
}

.data-entry-helper-item i {
    color: var(--tdb-primary);
}

.data-entry-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-left: auto;
    flex: 0 0 auto;
    align-self: flex-start;
}

.data-entry-actions .btn {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0.85rem 1.25rem;
    white-space: nowrap;
}

.chart-wrap {
    min-height: 320px;
}

.stat-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    border-bottom: 1px dashed rgba(17, 17, 17, 0.10);
}

.stat-list-item:last-child {
    border-bottom: 0;
}

.alert-card {
    padding: 1.1rem 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--tdb-shadow);
}

.empty-state {
    color: var(--tdb-muted);
}

.empty-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 128, 255, 0.1);
    font-size: 1.5rem;
    color: var(--tdb-primary);
}

.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.guest-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.5rem;
    align-items: stretch;
}

.guest-brand,
.guest-card {
    border-radius: 28px;
    box-shadow: var(--tdb-shadow);
}

.guest-brand {
    padding: 2.2rem;
    color: #fff;
    background:
        linear-gradient(135deg, #ce01cc 0%, #ce01cc 30%, #111111 70%, #0080ff),
        radial-gradient(circle at top right, rgba(206, 1, 204, 0.24), transparent 28%);
}

.guest-card {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--tdb-border);
}

.guest-footer-note {
    padding-top: 1rem;
    border-top: 1px dashed rgba(17, 17, 17, 0.12);
    color: var(--tdb-muted);
    font-size: 0.92rem;
}

.notification-list {
    display: grid;
    gap: 1rem;
}

.notification-card {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    background: rgba(255, 255, 255, 0.84);
}

.notification-card-unread {
    border-color: rgba(0, 128, 255, 0.18);
    box-shadow: inset 4px 0 0 var(--tdb-primary);
}

.log-payload {
    margin: 0.5rem 0 0;
    padding: 0.85rem;
    border-radius: 14px;
    background: rgba(17, 17, 17, 0.04);
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .content-shell {
        padding: 0.9rem;
    }

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

    .guest-brand {
        order: 2;
    }
}

@media (max-width: 767.98px) {
    .topbar-panel {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .metric-value {
        font-size: 1.6rem;
    }

    .table-panel,
    .form-panel,
    .chart-panel {
        padding: 1rem;
    }

    .data-entry-header,
    .data-entry-footer,
    .data-entry-status {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .data-entry-actions {
        width: 100%;
        justify-content: stretch;
    }

    .data-entry-actions .btn {
        flex: 1 1 100%;
    }
}
