:root {
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
    --font-heading: "Outfit", "Segoe UI", sans-serif;
    --content-max-width: 1240px;
    --header-fixed-height: 84px;
    --footer-fixed-height: 52px;
    --header-floating-offset: 10px;
    --brand-600: #1d7b53;
    --brand-700: #15593d;
    --brand-soft: #e8f6ee;
    --amber-soft: #fff6df;
    --ink-900: #1f2a33;
    --ink-700: #4c5a66;
    --ink-500: #6f7f8d;
    --line-200: #dce3e9;
    --line-300: #cfd8e0;
    --surface: #ffffff;
    --surface-2: #f7fafc;
    --shadow-soft: 0 8px 22px rgba(16, 24, 40, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: calc(var(--header-fixed-height) + 8px);
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-fixed-height);
    padding-bottom: var(--footer-fixed-height);
    font-family: var(--font-body);
    color: var(--ink-900);
    background:
        radial-gradient(1200px 520px at -12% -18%, #d9f3e5 0%, rgba(217, 243, 229, 0) 62%),
        radial-gradient(900px 420px at 112% -12%, #fce7cb 0%, rgba(252, 231, 203, 0) 58%),
        #edf2f5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    letter-spacing: 0.01em;
}

h1,
h2 {
    font-weight: 700;
}

a {
    color: var(--brand-600);
    text-decoration: none;
}

a:hover {
    color: var(--brand-700);
}

.app-header {
    position: fixed;
    top: var(--header-floating-offset);
    left: 0;
    right: 0;
    z-index: 1030;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

.navbar-app {
    background:
        linear-gradient(125deg, #d9f3e6, #bfead6 55%, #a4ddc0);
    backdrop-filter: blur(14px);
    border: 1px solid #95cfb1;
    border-radius: 1rem;
    box-shadow: 0 10px 20px rgba(16, 24, 40, 0.14);
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.navbar-app .navbar-brand {
    display: inline-flex;
    align-items: center;
    margin-right: 1rem;
}

.navbar-logo {
    height: 44px;
    width: auto;
    transition: transform 0.2s ease;
}

.navbar-logo:hover {
    transform: scale(1.03);
}

.navbar-app .nav-link {
    font-weight: 600;
    color: #174a34;
    border-radius: 0.65rem;
    border: 1px solid transparent;
    padding: 0.45rem 0.75rem;
    margin-right: 0.24rem;
}

.navbar-app .nav-link:hover,
.navbar-app .nav-link.active {
    background: rgba(15, 106, 70, 0.12);
    color: #0f5132;
    border-color: #85c7a4;
}

.navbar-app .dropdown-menu {
    border: 1px solid var(--line-200);
    box-shadow: var(--shadow-soft);
}

.navbar-app .dropdown-toggle i {
    color: #1f5f9d !important;
}

.navbar-app .dropdown-menu-end {
    min-width: 220px;
}

.navbar-app .navbar-toggler {
    border-radius: 0.75rem;
    border-color: #84c4a2;
    padding: 0.34rem 0.56rem;
    background: #ecf9f1;
}

.navbar-app .navbar-toggler-icon {
    filter: none;
}

.app-main {
    flex: 1;
    padding-top: 0.9rem;
    padding-bottom: 1.2rem;
}

.app-main > .container {
    max-width: var(--content-max-width);
}

.page-shell {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.app-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1029;
    min-height: var(--footer-fixed-height);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(140deg, #132c39, #1a3d4d);
    color: #dce6ed;
    font-size: 0.8rem;
    line-height: 1.15;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.2);
}

.app-footer a {
    color: #a8ddff;
}

.app-footer a:hover {
    color: #ffffff;
}

.app-footer .container {
    min-height: calc(var(--footer-fixed-height) - 0.35rem);
}

.flash-stack {
    position: sticky;
    top: calc(var(--header-fixed-height) - 2px);
    z-index: 1025;
    padding-top: 0.5rem;
}

.flash-stack .alert {
    border: 0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.surface-card {
    background: var(--surface);
    border: 1px solid var(--line-200);
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
}

.surface-card-soft {
    background: var(--surface-2);
    border: 1px solid var(--line-200);
    border-radius: 1rem;
}

.page-hero {
    position: relative;
    background: linear-gradient(120deg, #ffffff, #f3f9fc 58%, #eef6ff);
    border: 1px solid #cfdee8;
    border-radius: 1rem;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.1);
    padding: 1.1rem 1.2rem;
    overflow: hidden;
}

.page-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, #1d7b53, #2d96ca, #15593d);
}

.page-hero h2 {
    font-size: clamp(1.6rem, 2.5vw, 2.4rem);
    margin-bottom: 0.2rem;
    letter-spacing: 0.012em;
    color: #1a2b39;
}

.page-hero p {
    color: #5c6d7c;
    font-size: 1.06rem;
}

.toolbar-row {
    background: var(--surface);
    border: 1px solid var(--line-200);
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
    padding: 0.85rem;
}

.segmented-switch {
    border: 1px solid var(--line-300);
    border-radius: 0.8rem;
    overflow: hidden;
}

.segmented-switch .btn {
    border: 0;
    border-radius: 0;
    font-weight: 600;
    padding: 0.6rem 1rem;
}

.segmented-switch .btn.active,
.segmented-switch .btn.btn-success {
    background: var(--brand-600);
    color: #fff;
}

.input-compact {
    max-width: 95px;
}

.table-shell {
    background: var(--surface);
    border: 1px solid #d6dde5;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.table-shell::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #3f5870, #53789a);
}

.table-shell .table {
    margin-bottom: 0;
}

.table-shell .table thead th {
    background: linear-gradient(130deg, #dbe6f3, #c4d4e7 55%, #afc4dd);
    color: #1c3347;
    border-bottom: 0;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}

.table-shell .table > thead > tr > th {
    background: linear-gradient(130deg, #dbe6f3, #c4d4e7 55%, #afc4dd) !important;
    color: #1c3347 !important;
}

.table-shell .table > thead > tr > th a,
.table-shell .table > thead > tr > th a:hover {
    color: #1c3347 !important;
}

.table-shell .table > thead > tr > th .table-head-filter-link {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

.table-shell .table > thead > tr > th .table-head-filter-link.active {
    color: #1f5f9d !important;
    font-weight: 700;
}

.table-shell .table td,
.table-shell .table th {
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
    border-color: #e2e9f0;
}

.table-shell .table tbody tr:nth-child(even) {
    background: #fbfdff;
}

.table-shell .table tbody tr {
    transition: background-color 0.2s ease;
}

.table-shell .table tbody tr:hover {
    background: #edf6ff;
}

.table-shell .table tbody tr.table-danger,
.table-shell .table tbody tr.table-danger > td {
    background-color: #ffeef0 !important;
}

.table-shell .table tbody tr.table-warning,
.table-shell .table tbody tr.table-warning > td {
    background-color: #fff8e5 !important;
}

.table-shell .table .btn {
    border-radius: 0.62rem;
    font-weight: 600;
}

.btn-outline-secondary {
    color: #355067;
    border-color: #9fb2c3;
}

.btn-outline-secondary:hover {
    color: #ffffff;
    background: #355067;
    border-color: #355067;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-chip.ok {
    background: #e6f6ee;
    color: #0f6a46;
}

.status-chip.warn {
    background: #fff4d9;
    color: #9a6400;
}

.status-chip.danger {
    background: #fde7e7;
    color: #a61f1f;
}

.action-icon {
    border: 0;
    background: transparent;
    color: var(--brand-600);
    text-decoration: none;
    padding: 0.1rem 0.25rem;
}

.action-icon:hover {
    color: #0b5ed7;
}

.customer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1f875b, #49ad7c);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.86rem;
    margin-right: 0.08rem;
    box-shadow: 0 7px 13px rgba(21, 104, 66, 0.28);
    flex-shrink: 0;
}

.customer-link {
    color: #1f2a33;
    text-decoration: none;
}

.customer-link:hover {
    color: #12466b;
}

.customer-name {
    font-weight: 700;
    letter-spacing: 0.005em;
}

.badge-plate {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.77rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: transform 0.18s ease;
}

.badge-plate:hover {
    transform: translateY(-1px);
}

.pagination-shell {
    margin-top: 1.55rem;
    background: var(--surface);
    border: 1px solid var(--line-200);
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.pagination-meta {
    color: var(--ink-700);
    font-size: 0.92rem;
}

.pagination-shell .page-link {
    border-radius: 0.65rem;
    border-color: var(--line-300);
    color: #344150;
    min-width: 36px;
    text-align: center;
    padding: 0.34rem 0.58rem;
}

.pagination-shell .page-item.active .page-link {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}

.pagination-shell .page-link:hover {
    background: var(--brand-soft);
    border-color: #b6dfcb;
    color: var(--brand-700);
}

.pagination-shell .form-control,
.pagination-shell .form-select {
    border-color: var(--line-300);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(29, 123, 83, 0.18);
}

@media (max-width: 991.98px) {
    :root {
        --header-fixed-height: 80px;
        --footer-fixed-height: 72px;
        --header-floating-offset: 8px;
    }

    .navbar-app .nav-link {
        margin-right: 0;
        margin-bottom: 0.15rem;
    }

    .app-main {
        padding-top: 0.8rem;
    }

    .pagination-shell {
        padding: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    :root {
        --header-fixed-height: 76px;
        --footer-fixed-height: 84px;
        --header-floating-offset: 6px;
    }

    .app-main > .container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .app-footer .container {
        justify-content: center;
        text-align: center;
        gap: 0.45rem !important;
    }

    .navbar-logo {
        height: 38px;
    }
}
