:root {
    --bg: #eef3f1;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-strong: #ffffff;
    --panel-soft: rgba(246, 250, 248, 0.96);
    --line: #d7e0dc;
    --text: #213234;
    --muted: #5f7270;
    --primary: #0f766e;
    --primary-strong: #0a5b55;
    --accent: #d97706;
    --danger: #b42318;
    --ok: #157f3d;
    --shadow: 0 18px 48px rgba(23, 45, 46, 0.08);
    --shadow-soft: 0 10px 24px rgba(23, 45, 46, 0.06);
    --radius: 10px;
    --font-main: "Aptos", "Segoe UI", sans-serif;
    --font-head: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.1), transparent 24%),
        linear-gradient(180deg, #f6fbfa 0%, #eef3f1 100%);
    color: var(--text);
    font-family: var(--font-main);
}

a {
    color: inherit;
}

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

button {
    cursor: pointer;
}

.page-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.admin-shell {
    padding-bottom: 56px;
}

.login-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 22px;
    min-height: 100vh;
    align-items: center;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 0 0 20px;
}

.topbar-hero {
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(245, 250, 248, 0.82)),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.brand h1,
.brand h2 {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 700;
    letter-spacing: 0;
}

.brand p {
    margin: 8px 0 0;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.layout-grid {
    display: grid;
    gap: 20px;
}

.layout-grid.employee {
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
}

.layout-grid.buyer {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

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

.admin-users-grid {
    display: grid;
    grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
    gap: 20px;
}

.panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.panel.soft {
    background: var(--panel-soft);
}

.panel-header {
    padding: 20px 22px 0;
}

.panel-header h3,
.panel-header h4 {
    margin: 0;
    font-family: var(--font-head);
}

.panel-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.panel-body {
    padding: 20px 22px 22px;
}

.hero-panel {
    padding: 38px;
    background:
        linear-gradient(140deg, rgba(15, 118, 110, 0.96), rgba(18, 97, 89, 0.94)),
        var(--panel);
    color: #f4fbfa;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.hero-panel h1 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(40px, 5vw, 62px);
    font-family: var(--font-head);
    line-height: 1.02;
}

.hero-panel p {
    margin: 16px 0 0;
    max-width: 52ch;
    color: rgba(244, 251, 250, 0.9);
    font-size: 17px;
    line-height: 1.55;
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 30px;
}

.feature-chip {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.feature-chip strong {
    display: block;
    font-size: 15px;
}

.feature-chip span {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(244, 251, 250, 0.78);
}

.login-card {
    padding: 30px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

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

.field {
    display: grid;
    gap: 6px;
}

.field label,
.field span {
    font-size: 14px;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(208, 220, 216, 0.9);
    border-radius: 12px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(15, 118, 110, 0.8);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.field textarea {
    min-height: 116px;
    resize: vertical;
}

.button-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: linear-gradient(180deg, #14877d 0%, var(--primary) 100%);
    color: #fff;
}

.btn.primary:hover {
    background: linear-gradient(180deg, #0e6e66 0%, var(--primary-strong) 100%);
}

.btn.secondary {
    background: rgba(237, 243, 240, 0.92);
    color: var(--text);
    border: 1px solid var(--line);
}

.btn.warn {
    background: #fff4e6;
    color: #a85a04;
    border: 1px solid #f6cf93;
}

.btn.danger {
    background: #fff0ee;
    color: var(--danger);
    border: 1px solid #f2c2bc;
}

.muted {
    color: var(--muted);
}

.helper {
    font-size: 13px;
    line-height: 1.45;
}

.alert {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    white-space: pre-line;
}

.alert.error {
    display: block;
    color: #7d1d14;
    background: #fef1ef;
    border: 1px solid #f3b3ad;
}

.alert.success {
    display: block;
    color: #135b30;
    background: #eefbf2;
    border: 1px solid #9ad4ab;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.summary-grid-admin {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.summary-grid-buyer {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.summary-card {
    padding: 18px;
    background: var(--panel-strong);
    border: 1px solid rgba(214, 224, 220, 0.85);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.summary-card.compact {
    padding: 16px;
}

.summary-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    font-family: var(--font-head);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    text-align: left;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

tbody tr {
    cursor: pointer;
}

tbody tr:hover {
    background: #f6faf9;
}

tbody tr.selected {
    background: #eaf6f5;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-new {
    background: #e9f5ff;
    color: #0a5ea8;
}

.status-in_review {
    background: #fff2dd;
    color: #9f5b00;
}

.status-ordered {
    background: #eef4ff;
    color: #405ec8;
}

.status-rejected {
    background: #feeded;
    color: var(--danger);
}

.status-completed {
    background: #ecf9ef;
    color: var(--ok);
}

.role-employee {
    background: #e9f5ff;
    color: #0a5ea8;
}

.role-buyer {
    background: #fff4e6;
    color: #a85a04;
}

.role-admin {
    background: #eaf6f5;
    color: #0f766e;
}

.detail-stack {
    display: grid;
    gap: 18px;
}

.detail-block {
    padding: 14px 16px;
    border: 1px solid rgba(214, 224, 220, 0.85);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
}

.detail-block h4 {
    margin: 0 0 10px;
    font-size: 15px;
}

.detail-list {
    display: grid;
    gap: 10px;
}

.detail-list div strong {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

.empty-state {
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

.info-box {
    margin-top: 20px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-soft);
}

.item-editor {
    display: grid;
    gap: 10px;
}

.item-row {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) 110px 120px 48px;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid rgba(214, 224, 220, 0.85);
    border-radius: 14px;
    background: rgba(249, 252, 251, 0.98);
}

.item-row button {
    height: 46px;
}

.items-preview {
    display: grid;
    gap: 8px;
}

.items-preview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(214, 224, 220, 0.85);
    border-radius: 12px;
    background: #fff;
}

.items-preview-row small {
    color: var(--muted);
}

.document-grid {
    display: grid;
    gap: 12px;
}

.document-card {
    padding: 14px;
    border: 1px solid rgba(214, 224, 220, 0.85);
    border-radius: 14px;
    background: #fff;
}

.document-card strong {
    display: block;
    margin-bottom: 8px;
}

.document-card a {
    color: var(--primary);
    text-decoration: none;
}

.document-card a:hover {
    text-decoration: underline;
}

.document-upload {
    display: grid;
    gap: 10px;
}

.reference-list,
.report-stack,
.report-request-stack {
    display: grid;
    gap: 12px;
}

.reference-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(214, 224, 220, 0.85);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.reference-row strong {
    display: block;
}

.reference-row span {
    color: var(--muted);
    font-size: 13px;
}

.note-strip {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #f6cf93;
    background: #fff8ee;
    color: #946020;
    font-size: 13px;
}

.tabs-shell {
    display: grid;
    gap: 18px;
}

.tabbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(214, 224, 220, 0.85);
    box-shadow: var(--shadow-soft);
}

.tab-button {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}

.tab-button.active {
    background: linear-gradient(180deg, #14877d 0%, var(--primary) 100%);
    color: #fff;
}

.tab-panel {
    display: block;
}

.user-card {
    padding: 14px 16px;
    border: 1px solid rgba(214, 224, 220, 0.85);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.user-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.user-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.report-card {
    overflow: hidden;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.report-request-card {
    padding: 16px;
    border: 1px solid rgba(214, 224, 220, 0.85);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.report-request-top,
.request-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.report-request-meta,
.request-card-body,
.document-links {
    display: grid;
    gap: 8px;
}

.request-card {
    padding: 16px;
    border: 1px solid rgba(214, 224, 220, 0.85);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.request-card-clickable {
    cursor: pointer;
}

.selected-card {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

.card-list {
    display: grid;
    gap: 12px;
}

.document-links a {
    color: var(--primary);
    text-decoration: none;
}

.document-links a:hover {
    text-decoration: underline;
}

.section-switcher {
    display: none;
    gap: 8px;
    margin: 0 0 16px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(214, 224, 220, 0.85);
    box-shadow: var(--shadow-soft);
}

.switcher-button {
    flex: 1 1 0;
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}

.switcher-button.active {
    background: linear-gradient(180deg, #14877d 0%, var(--primary) 100%);
    color: #fff;
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

[data-mobile-panel] {
    display: block;
}

@media (max-width: 1180px) {
    .summary-grid,
    .summary-grid-admin,
    .summary-grid-buyer {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .layout-grid.employee,
    .layout-grid.buyer,
    .layout-grid.admin,
    .admin-users-grid,
    .login-shell {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 760px) {
    .page-shell,
    .login-shell {
        width: min(100% - 18px, 100%);
    }

    .feature-strip,
    .form-grid.two,
    .summary-grid,
    .summary-grid-admin,
    .summary-grid-buyer,
    .report-summary-grid,
    .item-row,
    .items-preview-row {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-hero,
    .hero-panel,
    .login-card,
    .panel-body,
    .panel-header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .reference-row,
    .user-card-top,
    .user-card-meta,
    .report-request-top,
    .request-card-top {
        flex-direction: column;
    }

    .section-switcher {
        display: flex;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    [data-mobile-panel] {
        display: none;
    }

    [data-mobile-panel].mobile-panel-active {
        display: block;
    }
}
