:root {
    --gt-ui-bg: #f3f6f9;
    --gt-ui-surface: #ffffff;
    --gt-ui-surface-alt: #f7f9fb;
    --gt-ui-border: #d6dee7;
    --gt-ui-border-strong: #c6d1dc;
    --gt-ui-text: #17324a;
    --gt-ui-text-soft: #53687b;
    --gt-ui-accent: #1f4e79;
    --gt-ui-accent-hover: #163a59;
    --gt-ui-danger: #9f2746;
    --gt-ui-danger-hover: #7f1f39;
    --gt-ui-success: #1f6b45;
    --gt-ui-warning: #9a6700;
    --gt-ui-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
    --gt-ui-shadow-raised: 0 12px 28px rgba(15, 23, 42, 0.09);
    --gt-ui-radius-sm: 10px;
    --gt-ui-radius-md: 14px;
    --gt-ui-radius-lg: 18px;
    --gt-ui-focus: 0 0 0 0.22rem rgba(31, 78, 121, 0.18);
}

body.gt-app-shell,
body.gt-guest-shell,
body.gt-error-shell {
    background: var(--gt-ui-bg);
    color: var(--gt-ui-text);
}

body.gt-app-shell .main,
body.gt-guest-shell main {
    color: var(--gt-ui-text);
}

body.gt-guest-shell {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(243, 246, 249, 0.94) 0%, rgba(243, 246, 249, 0.94) 100%),
        url("/assets/img/background.jpg") no-repeat center center fixed;
    background-size: cover;
}

body.gt-app-shell .pagetitle,
body.gt-guest-shell .pagetitle {
    margin-bottom: 1.5rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--gt-ui-border);
}

body.gt-app-shell .section,
body.gt-guest-shell .section {
    padding-top: 0.4rem;
}

body.gt-app-shell .card,
body.gt-guest-shell .card,
body.gt-error-shell .gt-error-card {
    border: 1px solid var(--gt-ui-border);
    border-radius: var(--gt-ui-radius-md);
    box-shadow: var(--gt-ui-shadow-soft);
    background: var(--gt-ui-surface);
}

body.gt-app-shell .card-body,
body.gt-guest-shell .card-body {
    padding: 1.4rem 1.4rem 1.5rem;
}

body.gt-app-shell .card-title,
body.gt-guest-shell .card-title {
    color: var(--gt-ui-text);
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

body.gt-app-shell .card-text,
body.gt-guest-shell .card-text,
body.gt-app-shell p,
body.gt-guest-shell p {
    color: var(--gt-ui-text);
    line-height: 1.55;
}

body.gt-app-shell .text-muted,
body.gt-guest-shell .text-muted,
.gt-helper-text {
    color: var(--gt-ui-text-soft) !important;
}

body.gt-app-shell .btn,
body.gt-guest-shell .btn {
    border-radius: var(--gt-ui-radius-sm);
    font-weight: 700;
    min-height: 2.65rem;
    padding: 0.55rem 0.95rem;
}

body.gt-app-shell .btn-primary,
body.gt-guest-shell .btn-primary {
    background: var(--gt-ui-accent);
    border-color: var(--gt-ui-accent);
}

body.gt-app-shell .btn-primary:hover,
body.gt-app-shell .btn-primary:focus,
body.gt-guest-shell .btn-primary:hover,
body.gt-guest-shell .btn-primary:focus {
    background: var(--gt-ui-accent-hover);
    border-color: var(--gt-ui-accent-hover);
}

body.gt-app-shell .btn-danger,
body.gt-guest-shell .btn-danger {
    background: var(--gt-ui-danger);
    border-color: var(--gt-ui-danger);
}

body.gt-app-shell .btn-danger:hover,
body.gt-app-shell .btn-danger:focus,
body.gt-guest-shell .btn-danger:hover,
body.gt-guest-shell .btn-danger:focus {
    background: var(--gt-ui-danger-hover);
    border-color: var(--gt-ui-danger-hover);
}

body.gt-app-shell .btn-outline-primary,
body.gt-guest-shell .btn-outline-primary {
    color: var(--gt-ui-accent);
    border-color: var(--gt-ui-border-strong);
}

body.gt-app-shell .btn-outline-danger,
body.gt-guest-shell .btn-outline-danger {
    color: var(--gt-ui-danger);
    border-color: #d8bcc5;
}

body.gt-app-shell .btn-secondary,
body.gt-guest-shell .btn-secondary {
    background: #eef3f7;
    border-color: var(--gt-ui-border);
    color: var(--gt-ui-text);
}

body.gt-app-shell .btn:focus,
body.gt-guest-shell .btn:focus,
body.gt-app-shell .form-control:focus,
body.gt-app-shell .form-select:focus,
body.gt-guest-shell .form-control:focus,
body.gt-guest-shell .form-select:focus {
    box-shadow: var(--gt-ui-focus);
}

body.gt-app-shell .form-control,
body.gt-app-shell .form-select,
body.gt-guest-shell .form-control,
body.gt-guest-shell .form-select {
    border: 1px solid var(--gt-ui-border-strong);
    border-radius: var(--gt-ui-radius-sm);
    min-height: 2.85rem;
    color: var(--gt-ui-text);
}

body.gt-app-shell .input-group > .btn,
body.gt-guest-shell .input-group > .btn {
    min-height: 2.85rem;
}

body.gt-app-shell .table,
body.gt-guest-shell .table {
    margin-bottom: 0;
    color: var(--gt-ui-text);
    vertical-align: middle;
}

body.gt-app-shell .table thead th,
body.gt-guest-shell .table thead th {
    background: #edf2f6;
    color: var(--gt-ui-text);
    border-bottom: 1px solid var(--gt-ui-border-strong);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    padding: 0.9rem 0.85rem;
}

body.gt-app-shell .table tbody td,
body.gt-guest-shell .table tbody td {
    border-color: #e7edf3;
    padding: 0.9rem 0.85rem;
}

body.gt-app-shell .table-hover tbody tr:hover,
body.gt-guest-shell .table-hover tbody tr:hover {
    background: #f6fafc;
}

.gt-index-table-row {
    cursor: pointer;
}

.gt-index-table-row:focus-visible {
    outline: 2px solid var(--gt-ui-accent);
    outline-offset: -2px;
}

.gt-index-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--gt-ui-text-soft);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.gt-record-shell {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.gt-record-heading {
    margin: 0;
    color: var(--gt-ui-text);
    font-size: 1.35rem;
    font-weight: 800;
}

.gt-record-summary {
    display: grid;
    gap: 0.9rem;
}

.gt-record-item {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e7edf3;
    border-radius: var(--gt-ui-radius-sm);
    background: var(--gt-ui-surface-alt);
}

.gt-record-label {
    color: var(--gt-ui-text-soft);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.gt-record-value {
    color: var(--gt-ui-text);
    font-size: 1rem;
    font-weight: 600;
    word-break: break-word;
}

.gt-record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--gt-ui-border);
}

.gt-record-actions form {
    margin: 0;
}

.gt-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 700;
}

.gt-status-badge.is-active {
    background: #eaf5ee;
    color: var(--gt-ui-success);
}

.gt-status-badge.is-inactive {
    background: #fbecef;
    color: var(--gt-ui-danger);
}

.gt-hero-note {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: #edf4fb;
    color: var(--gt-ui-accent);
    font-size: 0.86rem;
    font-weight: 700;
}

.gt-switch-summary {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border: 1px solid #e7edf3;
    border-radius: var(--gt-ui-radius-sm);
    background: var(--gt-ui-surface-alt);
}

.gt-switch-summary .form-check {
    margin: 0;
}

.gt-design-doc {
    max-width: 980px;
    margin: 0 auto;
}

.gt-design-doc h1,
.gt-design-doc h2,
.gt-design-doc h3 {
    color: var(--gt-ui-text);
}

body.gt-error-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.gt-error-wrap {
    width: min(100%, 38rem);
}

.gt-error-card {
    padding: 2rem 1.6rem;
    text-align: center;
}

.gt-error-code {
    color: var(--gt-ui-accent);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.gt-error-title {
    color: var(--gt-ui-text);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.65rem;
}

.gt-error-message {
    color: var(--gt-ui-text-soft);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.floating-scrollbar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 800px;
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf2 100%);
    border: 2px solid var(--gt-ui-accent);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.16), 0 0 0 2px rgba(31, 78, 121, 0.15);
    z-index: 900;
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

.floating-scrollbar:hover {
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.22), 0 0 0 3px rgba(31, 78, 121, 0.18);
    height: 32px;
}

.floating-scrollbar.is-dragging {
    cursor: grabbing;
}

.floating-scrollbar.is-hidden {
    display: none;
}

.floating-scrollbar::before {
    content: 'Scroll';
    margin-right: 10px;
    color: var(--gt-ui-accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.floating-scrollbar::after {
    content: 'Scroll Horizontally';
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--gt-ui-accent);
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.5px;
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.scroll-track {
    position: absolute;
    top: 4px;
    left: 0;
    height: calc(100% - 8px);
    width: 20%;
    min-width: 30px;
    background: linear-gradient(90deg, var(--gt-ui-accent) 0%, #0088ff 50%, #00d4ff 100%);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 136, 255, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    cursor: grab;
    z-index: 1;
}

.scroll-track::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 50%);
    border-radius: 10px;
}

.floating-scrollbar.is-dragging .scroll-track {
    cursor: grabbing;
}

body.gt-scrollbar-dragging {
    user-select: none;
}

@media (max-width: 991.98px) {
    body.gt-app-shell .card-body,
    body.gt-guest-shell .card-body {
        padding: 1.2rem;
    }
}

@media (max-width: 575.98px) {
    .gt-record-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .gt-record-actions .btn,
    .gt-record-actions form,
    .gt-record-actions form .btn {
        width: 100%;
    }

    .gt-error-title {
        font-size: 1.55rem;
    }

    .floating-scrollbar {
        width: calc(100% - 1.5rem);
    }
}
