:root {
    --paper: #f7f1e3;
    --paper-strong: #fffaf0;
    --canvas: #f3ede0;
    --ink-900: #182126;
    --ink-700: #314247;
    --ink-500: #5e7074;
    --line: rgba(24, 33, 38, 0.12);
    --line-strong: rgba(24, 33, 38, 0.2);
    --accent: #b6532f;
    --accent-deep: #8a3d1f;
    --accent-soft: rgba(182, 83, 47, 0.14);
    --accent-gold: #d7a13a;
    --success: #245c41;
    --success-bg: rgba(36, 92, 65, 0.12);
    --error: #9a3725;
    --error-bg: rgba(154, 55, 37, 0.12);
    --info: #2a5877;
    --info-bg: rgba(42, 88, 119, 0.12);
    --shadow-soft: 0 18px 40px rgba(57, 41, 24, 0.08);
    --shadow-strong: 0 28px 70px rgba(57, 41, 24, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --content-width: 1320px;
    --body-font: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
    --display-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink-900);
    background:
        radial-gradient(circle at top left, rgba(215, 161, 58, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(182, 83, 47, 0.16), transparent 30%),
        linear-gradient(180deg, #f8f4ec 0%, #efe6d6 100%);
    font-family: var(--body-font);
    line-height: 1.5;
    position: relative;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.skip-link {
    position: fixed;
    left: 18px;
    top: -80px;
    z-index: 100;
    background: var(--ink-900);
    color: var(--paper-strong);
    padding: 12px 16px;
    border-radius: 999px;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 16px;
}

.page-aura {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.page-aura-left {
    left: -120px;
    top: 120px;
    background: rgba(215, 161, 58, 0.25);
}

.page-aura-right {
    right: -120px;
    top: 320px;
    background: rgba(182, 83, 47, 0.18);
}

.site-shell {
    position: relative;
    z-index: 1;
    width: min(100%, var(--content-width));
    margin: 0 auto;
    padding: 24px clamp(16px, 3vw, 32px) 88px;
}

.site-header {
    position: sticky;
    top: 18px;
    z-index: 30;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-xl);
    background: rgba(255, 250, 240, 0.76);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
}

.brand-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.brand-home-link,
.brand-title-link,
.brand-company-link,
.footer-company-link {
    text-decoration: none;
}

.brand-home-link {
    display: inline-flex;
    flex: 0 0 auto;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    padding: 12px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 228, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.brand-title-link {
    display: inline-block;
    font-family: var(--display-font);
    font-size: clamp(1.5rem, 1.8vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.brand-subtitle {
    color: var(--ink-500);
    font-size: 0.95rem;
}

.brand-company-link,
.footer-company-link {
    transition: color 0.18s ease, text-decoration-color 0.18s ease;
    text-decoration: underline;
    text-decoration-color: rgba(182, 83, 47, 0.24);
    text-underline-offset: 0.16em;
}

.brand-title-link:hover,
.brand-title-link:focus-visible,
.brand-company-link:hover,
.brand-company-link:focus-visible,
.footer-company-link:hover,
.footer-company-link:focus-visible {
    color: var(--accent-deep);
    text-decoration-color: currentColor;
}

.header-actions,
.hero-actions,
.section-actions,
.form-actions,
.action-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.account-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 18px;
    border: 1px solid rgba(24, 33, 38, 0.08);
    background: rgba(255, 255, 255, 0.56);
}

.account-chip-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.account-chip-value {
    color: var(--ink-900);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease;
    cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(24, 33, 38, 0.12);
}

.btn:focus-visible,
.nav-card:focus-visible,
.action-tile:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(182, 83, 47, 0.25);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #fff8f2;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.82);
    border-color: var(--line);
    color: var(--ink-900);
}

.btn-danger {
    background: rgba(154, 55, 37, 0.12);
    border-color: rgba(154, 55, 37, 0.25);
    color: var(--error);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.45);
}

.btn-small {
    min-height: 40px;
    padding: 10px 14px;
    font-size: 0.92rem;
}

.primary-nav {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.nav-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 98px;
    padding: 14px;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.5);
    color: var(--ink-700);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease;
}

.nav-card:hover,
.nav-card.is-active {
    transform: translateY(-2px);
    border-color: rgba(182, 83, 47, 0.32);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(255, 242, 225, 0.86));
    color: var(--ink-900);
}

.nav-card-title {
    font-weight: 800;
}

.nav-card-description {
    font-size: 0.88rem;
    color: var(--ink-500);
}

.page-content {
    padding-top: 24px;
}

.breadcrumbs {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--ink-500);
    font-size: 0.92rem;
}

.breadcrumbs a {
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent-deep);
}

.hero-panel,
.panel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: rgba(255, 250, 240, 0.78);
    box-shadow: var(--shadow-soft);
}

.hero-panel::after,
.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 55%);
    pointer-events: none;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    padding: clamp(24px, 4vw, 36px);
    margin-bottom: 18px;
}

.hero-kicker,
.section-kicker {
    margin: 0 0 10px;
    color: var(--accent-deep);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.hero-panel h1,
.section-title,
.empty-state h3 {
    margin: 0;
    font-family: var(--display-font);
    line-height: 1.05;
    color: var(--ink-900);
}

.hero-panel h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.hero-description,
.section-intro p,
.stat-detail,
.empty-state p,
.field-hint,
.site-footer p {
    color: var(--ink-500);
}

.hero-description {
    margin: 14px 0 0;
    max-width: 62ch;
    font-size: 1.05rem;
}

.hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 700;
    font-size: 0.92rem;
}

.panel {
    padding: clamp(20px, 3vw, 30px);
    margin-bottom: 18px;
}

.auth-panel {
    width: min(100%, 760px);
    margin-left: auto;
    margin-right: auto;
}

.auth-form {
    width: min(100%, 520px);
}

.section-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title {
    font-size: clamp(1.55rem, 2.4vw, 2.1rem);
}

.flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid transparent;
    position: relative;
    z-index: 1;
}

.flash strong {
    white-space: nowrap;
}

.flash-success {
    background: var(--success-bg);
    border-color: rgba(36, 92, 65, 0.18);
    color: var(--success);
}

.flash-error {
    background: var(--error-bg);
    border-color: rgba(154, 55, 37, 0.18);
    color: var(--error);
}

.flash-info {
    background: var(--info-bg);
    border-color: rgba(42, 88, 119, 0.18);
    color: var(--info);
}

.card-grid,
.action-tile-grid {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card,
.action-tile,
.empty-state {
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.65);
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card-emphasis {
    background: linear-gradient(145deg, rgba(31, 37, 43, 0.94), rgba(66, 52, 37, 0.92));
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--paper-strong);
}

.stat-card-emphasis .stat-label,
.stat-card-emphasis .stat-detail {
    color: rgba(255, 250, 240, 0.8);
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.stat-value {
    font-family: var(--display-font);
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    line-height: 1.05;
}

.stat-detail {
    margin: 0;
}

.action-tile {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 170px;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.action-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(57, 41, 24, 0.1);
    border-color: rgba(182, 83, 47, 0.24);
}

.action-tile-title {
    font-family: var(--display-font);
    font-size: 1.3rem;
}

.action-tile-copy {
    color: var(--ink-500);
}

.table-shell {
    position: relative;
    z-index: 1;
    overflow-x: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table th,
.data-table td {
    padding: 16px 18px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(247, 241, 227, 0.96);
    color: var(--ink-700);
    font-size: 0.82rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(182, 83, 47, 0.06);
}

.inline-form {
    margin: 0;
}

.search-field,
.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.search-field {
    min-width: min(100%, 320px);
}

.search-field span,
.field-group label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink-700);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink-900);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--line-strong);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: rgba(182, 83, 47, 0.4);
    box-shadow: 0 0 0 4px rgba(182, 83, 47, 0.12);
    background: #fff;
}

.form-shell {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 26px;
}

.compact-form {
    gap: 18px;
}

.form-section {
    display: grid;
    gap: 18px;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
}

.section-intro h3 {
    margin: 0;
    font-family: var(--display-font);
    font-size: 1.35rem;
}

.section-intro p {
    margin: 6px 0 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-group.full-width {
    grid-column: 1 / -1;
}

.field-hint {
    margin: 0;
    font-size: 0.92rem;
}

.empty-state {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    justify-items: flex-start;
    text-align: left;
}

.empty-state-compact {
    margin-top: 16px;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

[hidden] {
    display: none !important;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 26px;
    padding: 0 6px;
    color: var(--ink-500);
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    min-height: 48px;
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(24, 33, 38, 0.92), rgba(58, 44, 31, 0.95));
    color: #fffaf0;
    box-shadow: var(--shadow-strong);
    cursor: pointer;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hero-panel,
.panel,
.site-header {
    animation: rise-in 0.6s ease both;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1140px) {
    .primary-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 860px) {
    .site-shell {
        padding-bottom: 110px;
    }

    .site-header {
        top: 10px;
        padding: 16px;
        border-radius: 24px;
    }

    .brand-row,
    .section-header,
    .site-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions,
    .hero-actions,
    .section-actions,
    .form-actions {
        width: 100%;
    }

    .header-actions .btn,
    .hero-actions .btn,
    .form-actions .btn {
        flex: 1 1 200px;
    }

    .primary-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid,
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .table-shell {
        overflow: visible;
        border: none;
        background: transparent;
    }

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table {
        min-width: 0;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        border: 0;
    }

    .data-table tbody {
        display: grid;
        gap: 14px;
    }

    .data-table tr {
        border-radius: 20px;
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.7);
        box-shadow: var(--shadow-soft);
        overflow: hidden;
    }

    .data-table td {
        border-bottom: 1px solid rgba(24, 33, 38, 0.08);
        padding: 12px 16px;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--accent-deep);
        font-size: 0.78rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    .action-group {
        align-items: stretch;
    }
}

@media (max-width: 620px) {
    .site-shell {
        padding-top: 16px;
    }

    .brand-lockup {
        align-items: flex-start;
    }

    .brand-mark {
        width: 64px;
        height: 64px;
        border-radius: 20px;
    }

    .primary-nav {
        grid-template-columns: 1fr;
    }

    .btn,
    .back-to-top {
        width: 100%;
    }

    .header-actions .btn,
    .hero-actions .btn,
    .form-actions .btn,
    .action-group .btn {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
