:root {
    --orange-700: #c85d16;
    --orange-600: #e46f1b;
    --orange-500: #f28522;
    --orange-100: #fff0df;
    --orange-050: #fff8f1;
    --ink-900: #2f241d;
    --ink-700: #5f5146;
    --surface: #ffffff;
    --surface-soft: #fffaf5;
    --line: #f1dfcf;
    --shadow: 0 12px 28px rgba(128, 74, 27, 0.1);
    --topbar-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 26%),
        radial-gradient(circle at top right, rgba(242, 133, 34, 0.16), transparent 22%),
        linear-gradient(140deg, #fff5e7 0%, #fffaf5 45%, #ffe7cc 100%);
    background-attachment: fixed;
    color: var(--ink-900);
}

a {
    color: var(--orange-700);
    text-decoration: none;
}

a:hover {
    color: var(--orange-600);
}

/* Header & Navigation */
.bg-dark-blue {
    background: linear-gradient(90deg, #fffaf5 0%, #ffffff 100%) !important;
}

.topbar {
    min-height: var(--topbar-height);
    border-bottom: 1px solid rgba(200, 93, 22, 0.12);
    box-shadow: 0 8px 20px rgba(82, 52, 20, 0.07);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.95rem;
    color: var(--ink-900) !important;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--orange-500), var(--orange-700));
    color: var(--surface);
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(228, 111, 27, 0.24);
}

.brand-copy small {
    display: block;
    color: var(--ink-700);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-copy strong {
    display: block;
    font-size: 0.98rem;
    color: var(--ink-900);
}

.topbar .navbar-toggler {
    border: 1px solid rgba(228, 111, 27, 0.2);
    border-radius: 12px;
    margin-right: 1rem;
}

.topbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(242, 133, 34, 0.18);
}

.topbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28200, 93, 22, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 0.5rem;
}

.signout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: var(--topbar-height) 0 0;
    background: transparent !important;
}

.sidebar-panel {
    height: 100%;
    padding: 0.8rem;
    background: linear-gradient(180deg, #f59a3a 0%, #e46f1b 55%, #c85d16 100%);
    border: 1px solid rgba(200, 93, 22, 0.45);
    border-radius: 18px;
    box-shadow: 0 14px 28px rgba(128, 74, 27, 0.22);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    padding: 0.65rem 0.8rem;
    margin-bottom: 0.25rem;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: 0.2s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--surface);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateX(2px);
}

.sidebar-heading {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 245, 236, 0.82) !important;
}

.sidebar-usercard {
    padding: 0.8rem 0.9rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
}

.sidebar-usercard .text-muted,
.sidebar-usercard small {
    color: rgba(255, 247, 240, 0.88) !important;
}

/* Main Content */
main {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

main.px-md-4,
main .px-md-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

main .mb-4 {
    margin-bottom: 1rem !important;
}

main .mt-4 {
    margin-top: 1rem !important;
}

.container-fluid,
.container-fluid > .row {
    position: relative;
    min-height: 100vh;
}

main.col-md-9,
main.col-lg-10 {
    position: relative;
}

main.col-md-9::before,
main.col-lg-10::before {
    content: "";
    position: fixed;
    top: calc(var(--topbar-height) + 0.5rem);
    right: 0.75rem;
    bottom: 0.75rem;
    left: max(16rem, 19vw);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(228, 111, 27, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: -1;
}

.border-bottom {
    border-bottom-color: rgba(228, 111, 27, 0.14) !important;
}

.h2,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--ink-900);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 1.75rem;
}

.h2,
h2 {
    font-size: 1.35rem;
}

h3 {
    font-size: 1.15rem;
}

h4 {
    font-size: 1rem;
}

h5 {
    font-size: 0.92rem;
}

h6 {
    font-size: 0.82rem;
}

/* Cards */
.card {
    border: 1px solid rgba(228, 111, 27, 0.1);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border-radius: 18px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(180deg, #fffdfa 0%, #fff6ec 100%);
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    padding: 0.8rem 1rem;
}

.card-body {
    background-color: var(--surface);
}

.card-body,
.card-footer {
    padding: 1rem;
}

/* Statistics Cards */
.stat-card {
    background: linear-gradient(135deg, #f28522 0%, #e46f1b 60%, #c85d16 100%);
    color: var(--surface);
    padding: 1rem;
    border-radius: 18px;
    box-shadow: 0 12px 24px rgba(228, 111, 27, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
}

.stat-info h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--surface);
}

.stat-info p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.92;
}

/* Feature Cards (Landing Page) */
.feature-card {
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border: 1px solid rgba(228, 111, 27, 0.12);
    border-radius: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 44px rgba(128, 74, 27, 0.16);
}

.feature-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    background: var(--orange-100);
    border-radius: 22px;
}

.feature-card h3 {
    color: var(--ink-900);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-sm,
.btn-group-sm > .btn {
    border-radius: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange-500), var(--orange-700));
    border-color: transparent;
    color: var(--surface);
    box-shadow: 0 10px 20px rgba(228, 111, 27, 0.16);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #fa953d, #d96314) !important;
    border-color: transparent !important;
    color: var(--surface) !important;
}

.btn-primary:focus,
.btn-warning:focus,
.btn-success:focus,
.btn-secondary:focus {
    box-shadow: 0 0 0 0.2rem rgba(242, 133, 34, 0.2) !important;
}

.btn-warning {
    background-color: #fff0df;
    border-color: #ffe2bf;
    color: var(--orange-700);
}

.btn-warning:hover {
    background-color: #ffe6c6;
    border-color: #ffd7a1;
    color: var(--orange-700);
}

/* Tables */
.table {
    margin-bottom: 0;
    background-color: var(--surface);
}

.table thead th {
    background-color: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    color: var(--ink-700);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.76rem;
}

.table > :not(caption) > * > * {
    padding: 0.7rem 0.75rem;
    border-bottom-color: rgba(228, 111, 27, 0.08);
}

.table-hover tbody tr:hover {
    background-color: rgba(242, 133, 34, 0.05);
}

/* Badges */
.badge {
    padding: 0.3rem 0.6rem;
    font-weight: 600;
    border-radius: 999px;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    min-height: 40px;
    border-radius: 10px;
    border-color: var(--line);
    background-color: #fffdfb;
}

.form-control-sm,
.form-select-sm {
    min-height: 34px;
    border-radius: 8px;
}

.input-group-text {
    min-height: 40px;
    border-radius: 10px;
}

.alert {
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(228, 111, 27, 0.08);
    border-radius: 14px;
}

.modal-body,
.modal-footer {
    padding: 1rem;
}

.row.g-4,
.gx-4 {
    --bs-gutter-x: 1rem;
}

.row.g-4,
.gy-4 {
    --bs-gutter-y: 1rem;
}

.row.g-3,
.gx-3 {
    --bs-gutter-x: 0.85rem;
}

.row.g-3,
.gy-3 {
    --bs-gutter-y: 0.85rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(242, 133, 34, 0.65);
    box-shadow: 0 0 0 0.2rem rgba(242, 133, 34, 0.14);
}

/* Login Page */
.login-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 26%),
        linear-gradient(140deg, #fff5e7 0%, #fffaf5 45%, #ffe7cc 100%);
}

.login-box {
    background: rgba(255, 255, 255, 0.96);
    padding: 2.5rem;
    border: 1px solid rgba(228, 111, 27, 0.14);
    border-radius: 28px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 430px;
}

.login-badge {
    display: inline-flex;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: var(--orange-100);
    color: var(--orange-700);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-box h2 {
    color: var(--ink-900);
}

.credential-panel {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    border-radius: 18px;
}

.quick-login-panel {
    padding: 1rem;
    border: 1px solid var(--line);
    background: rgba(255, 248, 241, 0.9);
    border-radius: 18px;
}

.quick-login-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.btn-outline-warning {
    border-color: rgba(228, 111, 27, 0.35);
    color: var(--orange-700);
    background-color: rgba(255, 255, 255, 0.8);
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active {
    color: var(--surface) !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--orange-500), var(--orange-700)) !important;
}

.quick-login-grid .btn:disabled {
    opacity: 0.55;
    box-shadow: none;
}

.quick-login-meta {
    line-height: 1.5;
}

.session-alert {
    border-color: rgba(13, 110, 253, 0.12);
    background: rgba(248, 250, 255, 0.96);
}

.session-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Landing Page */
.landing-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(242, 133, 34, 0.18), transparent 24%),
        linear-gradient(160deg, #fff7ee 0%, #fffdfb 55%, #ffedd8 100%);
    color: var(--ink-900);
    padding: 4rem 0;
}

.landing-hero {
    max-width: 760px;
    margin: 0 auto;
}

.landing-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(228, 111, 27, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--orange-700);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.landing-page h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.landing-page .lead {
    font-size: 1.2rem;
    color: var(--ink-700);
}

.hero-panel {
    padding: 3rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(228, 111, 27, 0.12);
    border-radius: 30px;
    box-shadow: var(--shadow);
}

/* Modals */
.modal-content {
    border: 1px solid rgba(228, 111, 27, 0.12);
    border-radius: 24px;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(180deg, #fff3e2 0%, #ffeedb 100%);
    color: var(--ink-900);
    border-bottom: 1px solid var(--line);
}

.modal-header .btn-close {
    filter: none;
}

/* Square Corners */
.brand-mark,
.topbar .navbar-toggler,
.signout-link,
.sidebar-panel,
.sidebar .nav-link,
.sidebar-usercard,
main.col-md-9::before,
main.col-lg-10::before,
.card,
.stat-card,
.stat-icon,
.feature-card,
.feature-icon,
.btn,
.btn-sm,
.btn-group-sm > .btn,
.badge,
.form-control,
.form-select,
.form-control-sm,
.form-select-sm,
.input-group-text,
.login-box,
.login-badge,
.credential-panel,
.quick-login-panel,
.landing-kicker,
.hero-panel,
.modal-content,
.alert {
    border-radius: 0 !important;
}

/* Responsive */
@media (max-width: 767.98px) {
    .sidebar {
        position: relative;
        padding: 0.5rem 0 0;
    }

    .sidebar-panel {
        border-radius: 16px;
    }

    main {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    main.px-md-4,
    main .px-md-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    main.col-md-9::before,
    main.col-lg-10::before {
        top: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
        border-radius: 16px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .h2,
    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1.05rem;
    }

    .landing-page h1 {
        font-size: 2.4rem;
    }

    .hero-panel,
    .login-box {
        padding: 2rem 1.4rem;
    }

    .quick-login-grid {
        grid-template-columns: 1fr;
    }

    .topbar-user {
        padding: 0 0.75rem 0.75rem;
    }
}
