/* =========================================================
   TAGE OFFICE
   Core application UI
   ========================================================= */

:root {
    --ink: #15201c;
    --muted: #6f7975;
    --soft: #98a19d;

    --green: #0b3528;
    --green-2: #123f31;
    --green-soft: #edf5f1;

    --line: #e4e9e6;
    --line-dark: #d6ddda;

    --paper: #ffffff;
    --canvas: #f7f9f8;
    --sidebar: #fbfcfb;

    --danger: #b42318;
    --danger-soft: #fef3f2;

    --warning: #9a6700;
    --warning-soft: #fff8e7;

    --radius-sm: 7px;
    --radius: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(15, 30, 24, .04);
    --shadow: 0 8px 28px rgba(15, 30, 24, .06);

    --sidebar-width: 238px;
    --topbar-height: 68px;

    --font:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--canvas);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;

    background: var(--canvas);
    color: var(--ink);

    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

img {
    max-width: 100%;
}

::selection {
    background: rgba(11, 53, 40, .14);
}


/* =========================================================
   APP SHELL
   ========================================================= */

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    position: fixed;
    z-index: 50;

    top: 0;
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);

    background: var(--sidebar);
    border-right: 1px solid var(--line);

    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;

    padding: 22px 14px 18px;
}

.app-main {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;

    margin-left: var(--sidebar-width);

    display: flex;
    flex-direction: column;
}


/* =========================================================
   BRAND
   ========================================================= */

.sidebar-brand {
    padding: 2px 10px 24px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    display: block;

    width: 34px;
    height: 34px;

    object-fit: contain;
}

.brand-name {
    display: flex;
    flex-direction: column;

    line-height: 1;
    letter-spacing: -.02em;
}

.brand-name strong {
    font-size: 15px;
    font-weight: 750;
    color: var(--green);
    letter-spacing: -.03em;
}

.brand-name span {
    margin-top: 4px;

    font-size: 9px;
    font-weight: 650;

    color: var(--soft);
    letter-spacing: .14em;
}


/* =========================================================
   CREATE BUTTON
   ========================================================= */

.create-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    min-height: 42px;

    margin-bottom: 22px;
    padding: 0 13px;

    border-radius: 8px;

    background: var(--green);
    color: #fff;

    font-size: 13px;
    font-weight: 650;

    box-shadow: 0 4px 12px rgba(11, 53, 40, .12);

    transition:
        background .16s ease,
        transform .16s ease,
        box-shadow .16s ease;
}

.create-button:hover {
    background: var(--green-2);
    box-shadow: 0 6px 16px rgba(11, 53, 40, .16);
    transform: translateY(-1px);
}

.create-button:active {
    transform: translateY(0);
}

.create-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    font-size: 17px;
    font-weight: 400;
    line-height: 1;
}


/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 21px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-section-label {
    padding: 0 10px;
    margin-bottom: 5px;

    color: #9aa29f;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: .16em;
    line-height: 1.2;
}

.nav-item {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 36px;

    padding: 0 10px;

    border-radius: 7px;

    color: #4e5955;

    font-size: 12.5px;
    font-weight: 500;

    transition:
        background .14s ease,
        color .14s ease;
}

.nav-item:hover {
    background: #f0f4f2;
    color: var(--ink);
}

.nav-item.active,
.nav-item[aria-current="page"] {
    background: var(--green-soft);
    color: var(--green);
    font-weight: 650;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    margin-right: 5px;

    color: #89938f;

    font-size: 13px;
    line-height: 1;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    color: var(--green);
}


/* =========================================================
   SIDEBAR FOOTER
   ========================================================= */

.sidebar-footer {
    margin-top: auto;
    padding: 20px 8px 2px;
}

.workspace-label {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 10px 9px;

    border-top: 1px solid var(--line);
}

.workspace-dot {
    flex: 0 0 auto;

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #5f8b76;
}

.workspace-label > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.workspace-label strong {
    color: #4b5652;

    font-size: 10.5px;
    font-weight: 650;

    white-space: nowrap;
}

.workspace-label span:not(.workspace-dot) {
    margin-top: 1px;

    color: #a0a8a5;

    font-size: 9.5px;

    letter-spacing: .06em;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;

    height: var(--topbar-height);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);

    backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;

    color: #929b97;

    font-size: 11px;
    font-weight: 500;
}

.breadcrumb strong {
    color: #39443f;
    font-weight: 650;
}

.breadcrumb-separator {
    color: #c3cac7;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 31px;
    height: 31px;

    border-radius: 50%;

    background: var(--green);
    color: white;

    font-size: 11px;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;

    line-height: 1.15;
}

.user-info strong {
    color: #303b36;

    font-size: 11px;
    font-weight: 650;
}

.user-info span {
    margin-top: 3px;

    color: #9aa29f;

    font-size: 9.5px;
}

.signout-link {
    margin-left: 9px;

    color: #7c8682;

    font-size: 10.5px;
    font-weight: 500;
}

.signout-link:hover {
    color: var(--danger);
}

.mobile-menu {
    display: none;

    width: 34px;
    height: 34px;

    margin-right: 10px;

    border: 1px solid var(--line);
    border-radius: 7px;

    background: white;
    color: var(--ink);
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.main-content {
    flex: 1;
    width: 100%;

    padding: 34px 34px 60px;
}

.content-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;

    margin-bottom: 28px;
}

.page-header-copy {
    min-width: 0;
}

.eyebrow {
    margin-bottom: 7px;

    color: #809089;

    font-size: 9px;
    font-weight: 750;

    letter-spacing: .18em;
    text-transform: uppercase;
}

.page-header h1 {
    margin: 0;

    color: var(--ink);

    font-size: 28px;
    font-weight: 720;

    letter-spacing: -.045em;
    line-height: 1.12;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;

    flex-shrink: 0;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 38px;

    padding: 0 14px;

    border: 1px solid transparent;
    border-radius: 7px;

    font-size: 12px;
    font-weight: 650;

    white-space: nowrap;

    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease,
        transform .15s ease,
        box-shadow .15s ease;
}

.button-primary {
    background: var(--green);
    color: #fff;

    box-shadow: 0 3px 10px rgba(11, 53, 40, .10);
}

.button-primary:hover {
    background: var(--green-2);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(11, 53, 40, .14);
}

.button-secondary {
    background: #fff;
    border-color: var(--line-dark);
    color: #44504b;
}

.button-secondary:hover {
    background: #f8faf9;
    border-color: #c8d0cc;
}

.button-danger {
    background: var(--danger-soft);
    border-color: #f3c7c3;
    color: var(--danger);
}

.button-danger:hover {
    background: #fde8e6;
}


/* =========================================================
   CARDS
   ========================================================= */

.card {
    background: var(--paper);

    border: 1px solid var(--line);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 58px;

    padding: 0 20px;

    border-bottom: 1px solid var(--line);
}

.card-header h2,
.card-header h3 {
    margin: 0;

    color: var(--ink);

    font-size: 14px;
    font-weight: 680;

    letter-spacing: -.015em;
}

.card-body {
    padding: 20px;
}


/* =========================================================
   FORMS
   ========================================================= */

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

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

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

.form-group {
    min-width: 0;
}

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

label,
.form-label {
    display: block;

    margin-bottom: 7px;

    color: #4d5853;

    font-size: 11px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;

    min-height: 40px;

    padding: 9px 11px;

    border: 1px solid #dce3df;
    border-radius: 7px;

    background: #fff;
    color: var(--ink);

    font-size: 12px;

    outline: none;

    transition:
        border-color .14s ease,
        box-shadow .14s ease,
        background .14s ease;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #adb5b2;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #cbd4cf;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #8ca99d;

    box-shadow: 0 0 0 3px rgba(11, 53, 40, .07);
}

input[disabled],
select[disabled],
textarea[disabled] {
    background: #f5f7f6;
    color: #8e9894;
}


/* =========================================================
   FORM SECTIONS
   ========================================================= */

.form-section {
    margin-bottom: 24px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;

    margin-bottom: 13px;
}

.form-section-heading h2 {
    margin: 0;

    color: var(--ink);

    font-size: 14px;
    font-weight: 700;

    letter-spacing: -.015em;
}

.form-section-heading p {
    margin: 0;

    color: #929b97;

    font-size: 10.5px;
}


/* =========================================================
   TABLES
   ========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;
    border-spacing: 0;
}

thead th {
    padding: 11px 14px;

    background: #fafbfa;
    border-bottom: 1px solid var(--line);

    color: #858f8a;

    font-size: 9.5px;
    font-weight: 700;

    letter-spacing: .06em;
    text-transform: uppercase;

    text-align: left;
    white-space: nowrap;
}

tbody td {
    padding: 13px 14px;

    border-bottom: 1px solid #edf0ee;

    color: #46514c;

    font-size: 11.5px;

    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fbfcfb;
}

td strong {
    color: var(--ink);
    font-weight: 650;
}


/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    min-height: 24px;

    padding: 0 8px;

    border: 1px solid var(--line);
    border-radius: 999px;

    background: #f8faf9;

    color: #59635f;

    font-size: 9.5px;
    font-weight: 650;

    white-space: nowrap;
}

.badge-green {
    background: var(--green-soft);
    border-color: #d7e7df;
    color: var(--green);
}

.badge-warning {
    background: var(--warning-soft);
    border-color: #f1dfb1;
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-soft);
    border-color: #f0cbc7;
    color: var(--danger);
}


/* =========================================================
   EMPTY STATES
   ========================================================= */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 230px;

    padding: 35px 25px;

    text-align: center;
}

.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    margin-bottom: 13px;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: #fafcfb;

    color: #87918c;

    font-size: 16px;
}

.empty-state h3 {
    margin: 0 0 5px;

    color: var(--ink);

    font-size: 14px;
    font-weight: 680;
}

.empty-state p {
    max-width: 400px;

    margin: 0;

    color: #8a9490;

    font-size: 11px;
    line-height: 1.6;
}


/* =========================================================
   DASHBOARD HERO
   ========================================================= */

.hero {
    position: relative;

    overflow: hidden;

    padding: 30px 32px;

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 14px;

    box-shadow: var(--shadow-sm);
}

.hero::after {
    content: "";

    position: absolute;

    width: 240px;
    height: 240px;

    right: -95px;
    top: -120px;

    border: 1px solid #e1ebe6;
    border-radius: 50%;

    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 1;

    max-width: 720px;
}

.hero-kicker {
    margin-bottom: 8px;

    color: #71837b;

    font-size: 9px;
    font-weight: 750;

    letter-spacing: .18em;
    text-transform: uppercase;
}

.hero h2 {
    margin: 0;

    color: var(--ink);

    font-size: 28px;
    font-weight: 720;

    letter-spacing: -.045em;
    line-height: 1.15;
}

.hero p {
    max-width: 650px;

    margin: 10px 0 20px;

    color: #69746f;

    font-size: 12px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* =========================================================
   DOCUMENT TYPE SELECTOR
   ========================================================= */

.document-types {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.document-type {
    display: block;

    min-height: 108px;

    padding: 17px;

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 10px;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.document-type:hover {
    border-color: #cbd8d2;

    box-shadow: 0 7px 20px rgba(15, 30, 24, .06);

    transform: translateY(-1px);
}

.document-type-code {
    display: block;

    margin-bottom: 10px;

    color: #9aa39f;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: .12em;
}

.document-type h3 {
    margin: 0 0 3px;

    color: var(--ink);

    font-size: 15px;
    font-weight: 700;

    letter-spacing: -.025em;
}

.document-type p {
    margin: 0;

    color: #89928e;

    font-size: 10.5px;
}


/* =========================================================
   QUICK STATS
   ========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.stat {
    padding: 17px 18px;

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 10px;
}

.stat-label {
    color: #929b97;

    font-size: 9.5px;
    font-weight: 650;

    text-transform: uppercase;
    letter-spacing: .08em;
}

.stat-value {
    margin-top: 7px;

    color: var(--ink);

    font-size: 23px;
    font-weight: 700;

    letter-spacing: -.035em;
    line-height: 1;
}

.stat-note {
    margin-top: 6px;

    color: #9aa29f;

    font-size: 9.5px;
}


/* =========================================================
   LIST / DOCUMENT ROWS
   ========================================================= */

.document-list {
    display: flex;
    flex-direction: column;
}

.document-row {
    display: grid;

    grid-template-columns:
        minmax(150px, 1.4fr)
        minmax(130px, 1fr)
        minmax(90px, .7fr)
        auto;

    align-items: center;
    gap: 20px;

    min-height: 64px;

    padding: 10px 18px;

    border-bottom: 1px solid #edf0ee;
}

.document-row:last-child {
    border-bottom: 0;
}

.document-row:hover {
    background: #fbfcfb;
}

.document-number {
    color: var(--ink);

    font-size: 11.5px;
    font-weight: 680;
}

.document-meta {
    margin-top: 2px;

    color: #929b97;

    font-size: 9.5px;
}

.document-type-name {
    color: #5c6762;

    font-size: 10.5px;
}

.document-date {
    color: #7f8985;

    font-size: 10px;
}

.document-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}


/* =========================================================
   ACTION LINK
   ========================================================= */

.action-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: var(--green);

    font-size: 10.5px;
    font-weight: 650;
}

.action-link:hover {
    text-decoration: underline;
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    padding: 11px 13px;

    margin-bottom: 18px;

    border: 1px solid var(--line);
    border-radius: 8px;

    font-size: 11px;
}

.alert-success {
    background: var(--green-soft);
    border-color: #d6e7de;
    color: var(--green);
}

.alert-error {
    background: var(--danger-soft);
    border-color: #efcbc7;
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-soft);
    border-color: #efdfb8;
    color: var(--warning);
}


/* =========================================================
   TOOLBAR
   ========================================================= */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    width: 240px;
}


/* =========================================================
   MODAL
   ========================================================= */

.modal-backdrop {
    position: fixed;
    z-index: 100;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(15, 27, 22, .38);

    backdrop-filter: blur(3px);
}

.modal {
    width: 100%;
    max-width: 540px;

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 13px;

    box-shadow: 0 25px 80px rgba(10, 30, 21, .18);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 20px;

    border-bottom: 1px solid var(--line);
}

.modal-header h2 {
    margin: 0;

    font-size: 15px;
    font-weight: 700;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    padding: 15px 20px;

    border-top: 1px solid var(--line);
}


/* =========================================================
   DOCUMENT BUILDER
   ========================================================= */

.document-builder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

.builder-main,
.builder-sidebar {
    min-width: 0;
}

.builder-sidebar {
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
}

.builder-summary {
    padding: 18px;

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 11px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 8px 0;

    color: #737d78;

    font-size: 10.5px;

    border-bottom: 1px solid #edf0ee;
}

.summary-row:last-child {
    border-bottom: 0;
}

.summary-row strong {
    color: var(--ink);

    font-size: 11.5px;
    font-weight: 680;
}

.summary-total {
    padding-top: 13px;
    margin-top: 6px;

    border-top: 1px solid var(--line);
}

.summary-total strong {
    color: var(--green);

    font-size: 17px;
}


/* =========================================================
   LINE ITEMS
   ========================================================= */

.line-items {
    width: 100%;
    overflow-x: auto;
}

.line-items table {
    min-width: 760px;
}

.line-items input,
.line-items select {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 11px;
}

.remove-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    border: 0;
    border-radius: 6px;

    background: #f7f8f7;
    color: #9aa39f;

    font-size: 13px;
}

.remove-line:hover {
    background: var(--danger-soft);
    color: var(--danger);
}


/* =========================================================
   TABS
   ========================================================= */

.tabs {
    display: flex;
    align-items: center;
    gap: 2px;

    padding: 4px;

    margin-bottom: 20px;

    background: #f1f4f2;

    border: 1px solid var(--line);
    border-radius: 9px;
}

.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;

    padding: 0 12px;

    border-radius: 6px;

    color: #737e79;

    font-size: 10.5px;
    font-weight: 600;
}

.tab:hover {
    color: var(--ink);
}

.tab.active {
    background: #fff;

    color: var(--green);

    box-shadow: 0 1px 3px rgba(15, 30, 24, .07);
}


/* =========================================================
   DOCUMENT PREVIEW
   ========================================================= */

.document-preview {
    max-width: 900px;

    margin: 0 auto;

    padding: 42px;

    background: #fff;

    border: 1px solid #dfe5e2;

    box-shadow: 0 15px 45px rgba(15, 30, 24, .08);
}

.document-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 30px;

    padding-bottom: 24px;

    border-bottom: 2px solid var(--green);
}

.document-preview-logo {
    width: 130px;
    height: auto;
    object-fit: contain;
}

.document-preview-title {
    text-align: right;
}

.document-preview-title h1 {
    margin: 0;

    font-size: 23px;
    font-weight: 750;

    letter-spacing: -.035em;
}

.document-preview-title p {
    margin: 5px 0 0;

    color: #7c8681;

    font-size: 10px;
}

.document-preview-section {
    margin-top: 25px;
}

.document-preview-section-title {
    margin-bottom: 9px;

    color: #7c8782;

    font-size: 8.5px;
    font-weight: 750;

    letter-spacing: .12em;
    text-transform: uppercase;
}

.document-preview table th {
    background: #f5f7f6;
    color: #65716c;
}

.document-preview table td {
    font-size: 10px;
}


/* =========================================================
   PRINT CONTROLS
   ========================================================= */

.print-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    margin-bottom: 18px;
}


/* =========================================================
   SETTINGS
   ========================================================= */

.settings-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.settings-nav {
    position: sticky;
    top: calc(var(--topbar-height) + 20px);

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-nav a {
    padding: 9px 11px;

    border-radius: 7px;

    color: #68736e;

    font-size: 11px;
    font-weight: 550;
}

.settings-nav a:hover {
    background: #f0f4f2;
    color: var(--ink);
}

.settings-nav a.active {
    background: var(--green-soft);
    color: var(--green);
    font-weight: 650;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    background:
        linear-gradient(
            180deg,
            #f8faf9 0%,
            #f3f6f4 100%
        );
}

.login-shell {
    width: 100%;
    max-width: 400px;
}

.login-brand {
    display: flex;
    justify-content: center;

    margin-bottom: 25px;
}

.login-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.login-card {
    padding: 30px;

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 14px;

    box-shadow: 0 18px 50px rgba(15, 30, 24, .07);
}

.login-card h1 {
    margin: 0;

    color: var(--ink);

    font-size: 22px;
    font-weight: 720;

    letter-spacing: -.04em;
}

.login-card > p {
    margin: 7px 0 23px;

    color: #89928e;

    font-size: 11px;
}

.login-card .button {
    width: 100%;
    margin-top: 5px;
}

.login-footer {
    margin-top: 15px;

    text-align: center;

    color: #a0a8a5;

    font-size: 9.5px;
}


/* =========================================================
   LABELS
   ========================================================= */

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

.label-card {
    padding: 18px;

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 10px;
}

.label-card h3 {
    margin: 0 0 4px;

    font-size: 13px;
    font-weight: 680;
}

.label-card p {
    margin: 0 0 15px;

    color: #8b9490;

    font-size: 10.5px;
}


/* =========================================================
   UTILITY CLASSES
   ========================================================= */

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
}

.items-center {
    align-items: center;
}

.gap-1 {
    gap: 6px;
}

.gap-2 {
    gap: 10px;
}

.gap-3 {
    gap: 16px;
}

.mt-1 {
    margin-top: 6px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 6px;
}

.mb-2 {
    margin-bottom: 10px;
}

.mb-3 {
    margin-bottom: 16px;
}

.mb-4 {
    margin-bottom: 24px;
}

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

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1050px) {

    :root {
        --sidebar-width: 215px;
    }

    .main-content {
        padding: 28px 24px 50px;
    }

    .document-builder {
        grid-template-columns: 1fr;
    }

    .builder-sidebar {
        position: static;
    }

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

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

}


@media (max-width: 760px) {

    :root {
        --sidebar-width: 238px;
    }

    .sidebar {
        transform: translateX(-100%);

        transition: transform .2s ease;

        box-shadow: none;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);

        box-shadow: 15px 0 40px rgba(15, 30, 24, .12);
    }

    .app-main {
        width: 100%;
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        height: 60px;
        padding: 0 15px;
    }

    .user-info,
    .signout-link {
        display: none;
    }

    .main-content {
        padding: 22px 15px 40px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .button {
        width: 100%;
    }

    .hero {
        padding: 23px 21px;
    }

    .hero h2 {
        font-size: 23px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .button {
        width: 100%;
    }

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

    .document-types {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .document-row {
        grid-template-columns: 1fr auto;
        gap: 7px;
        padding: 12px 14px;
    }

    .document-row > :nth-child(2),
    .document-row > :nth-child(3) {
        grid-column: 1;
    }

    .document-row > :last-child {
        grid-column: 2;
        grid-row: 1 / span 3;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-nav {
        position: static;

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

    .label-grid {
        grid-template-columns: 1fr;
    }

    .document-preview {
        padding: 24px;
    }

}


@media (max-width: 480px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .breadcrumb span:first-child,
    .breadcrumb-separator {
        display: none;
    }

    .card-header {
        padding: 0 15px;
    }

    .card-body {
        padding: 15px;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

}


/* =========================================================
   PRINT
   ========================================================= */

@media print {

    @page {
        margin: 10mm;
    }

    html,
    body {
        background: #fff !important;
    }

    .sidebar,
    .topbar,
    .page-header,
    .print-toolbar,
    .button,
    .mobile-menu {
        display: none !important;
    }

    .app-shell,
    .app-main {
        display: block !important;

        width: 100% !important;
        margin: 0 !important;
    }

    .main-content {
        padding: 0 !important;
    }

    .content-container {
        max-width: none !important;
    }

    .document-preview {
        width: 100% !important;
        max-width: none !important;

        margin: 0 !important;
        padding: 0 !important;

        border: 0 !important;
        box-shadow: none !important;
    }

    .card {
        border: 0 !important;
        box-shadow: none !important;
    }
    /* ==========================================================
   TAGE OFFICE — CURRENT LAYOUT COMPATIBILITY FIX
   This overrides legacy layout rules.
   ========================================================== */


/* ---------- APP SHELL ---------- */

.app-shell {
    display: flex !important;
    width: 100% !important;
    min-height: 100vh !important;
    background: var(--bg) !important;
}


/* ---------- SIDEBAR ---------- */

.app-shell .sidebar {
    position: fixed !important;

    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;

    width: 238px !important;
    min-width: 238px !important;

    height: 100vh !important;

    display: block !important;

    padding: 0 !important;

    background: #fbfcfb !important;

    border-right: 1px solid var(--border) !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    z-index: 1000 !important;
}


/* ---------- SIDEBAR INNER ---------- */

.app-shell .sidebar-inner {
    width: 100% !important;
    min-height: 100vh !important;

    display: flex !important;
    flex-direction: column !important;

    padding: 22px 14px 18px !important;
}


/* ---------- BRAND ---------- */

.app-shell .sidebar-brand {
    padding: 2px 10px 24px !important;
}

.app-shell .brand-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;

    text-decoration: none !important;
}

.app-shell .brand-logo {
    width: 36px !important;
    height: 36px !important;

    max-width: 36px !important;

    object-fit: contain !important;
}

.app-shell .brand-name {
    display: flex !important;
    flex-direction: column !important;

    line-height: 1 !important;
}

.app-shell .brand-name strong {
    color: var(--green) !important;

    font-size: 15px !important;
    font-weight: 750 !important;

    letter-spacing: -.03em !important;
}

.app-shell .brand-name span {
    padding: 0 !important;
    margin-top: 4px !important;

    border: 0 !important;

    color: #9aa39f !important;

    font-size: 9px !important;
    font-weight: 650 !important;

    letter-spacing: .14em !important;
}


/* ---------- CREATE BUTTON ---------- */

.app-shell .create-button {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    min-height: 42px !important;

    margin: 0 0 22px !important;
    padding: 0 13px !important;

    border: 0 !important;
    border-radius: 8px !important;

    background: var(--green) !important;
    color: #fff !important;

    font-size: 12px !important;
    font-weight: 650 !important;

    text-decoration: none !important;

    box-shadow: 0 4px 12px rgba(11,53,40,.12) !important;
}

.app-shell .create-button:hover {
    background: var(--green-2) !important;
    color: #fff !important;
}


/* ---------- NAV ---------- */

.app-shell .sidebar-nav {
    display: flex !important;

    flex-direction: column !important;

    gap: 20px !important;
}

.app-shell .nav-section {
    display: flex !important;

    flex-direction: column !important;

    gap: 2px !important;
}

.app-shell .nav-section-label {
    padding: 0 10px 6px !important;
    margin: 0 !important;

    color: #9aa39f !important;

    font-size: 9px !important;
    font-weight: 750 !important;

    line-height: 1.2 !important;

    letter-spacing: .16em !important;
}

.app-shell .nav-item {
    display: flex !important;

    align-items: center !important;

    width: 100% !important;
    min-height: 36px !important;

    margin: 0 !important;
    padding: 0 10px !important;

    border: 0 !important;
    border-radius: 7px !important;

    background: transparent !important;

    color: #4e5955 !important;

    font-size: 12px !important;
    font-weight: 500 !important;

    text-decoration: none !important;
}

.app-shell .nav-item:hover {
    background: #f0f4f2 !important;
    color: var(--black) !important;
}

.app-shell .nav-icon {
    display: inline-flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 22px !important;
    margin-right: 5px !important;

    color: #89938f !important;

    font-size: 12px !important;
}

.app-shell .nav-item:hover .nav-icon {
    color: var(--green) !important;
}


/* ---------- SIDEBAR FOOTER ---------- */

.app-shell .sidebar-footer {
    margin-top: auto !important;

    padding: 20px 8px 2px !important;
}

.app-shell .workspace-label {
    display: flex !important;

    align-items: center !important;

    gap: 9px !important;

    padding: 12px 9px !important;

    border-top: 1px solid var(--border) !important;
}

.app-shell .workspace-label strong {
    display: block !important;

    color: #4b5652 !important;

    font-size: 10.5px !important;
}

.app-shell .workspace-label span:not(.workspace-dot) {
    display: block !important;

    margin-top: 2px !important;

    color: #a0a8a5 !important;

    font-size: 9.5px !important;
}


/* ---------- MAIN AREA ---------- */

.app-shell .app-main {
    width: calc(100% - 238px) !important;
    min-height: 100vh !important;

    margin-left: 238px !important;

    display: flex !important;
    flex-direction: column !important;
}


/* ---------- TOPBAR ---------- */

.app-shell .topbar {
    position: sticky !important;

    top: 0 !important;

    z-index: 900 !important;

    width: 100% !important;
    height: 66px !important;
    min-height: 66px !important;

    display: flex !important;

    align-items: center !important;
    justify-content: space-between !important;

    margin: 0 !important;
    padding: 0 28px !important;

    background: #fff !important;
    color: var(--text) !important;

    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;

    box-shadow: none !important;
}

.app-shell .topbar-left,
.app-shell .topbar-right {
    display: flex !important;

    align-items: center !important;
}


/* ---------- BREADCRUMB ---------- */

.app-shell .breadcrumb {
    display: flex !important;

    align-items: center !important;

    gap: 8px !important;

    color: #9aa29f !important;

    font-size: 11px !important;
}

.app-shell .breadcrumb strong {
    color: #39443f !important;

    font-weight: 650 !important;
}

.app-shell .breadcrumb-separator {
    color: #c5ccc8 !important;
}


/* ---------- USER ---------- */

.app-shell .user-menu {
    display: flex !important;

    align-items: center !important;

    gap: 9px !important;
}

.app-shell .user-avatar {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 31px !important;
    height: 31px !important;

    border-radius: 50% !important;

    background: var(--green) !important;
    color: #fff !important;

    font-size: 11px !important;
    font-weight: 700 !important;
}

.app-shell .user-info {
    display: flex !important;

    flex-direction: column !important;

    line-height: 1.15 !important;
}

.app-shell .user-info strong {
    color: #303b36 !important;

    font-size: 11px !important;
}

.app-shell .user-info span {
    color: #9aa29f !important;

    font-size: 9px !important;
}

.app-shell .signout-link {
    margin-left: 8px !important;

    padding: 0 !important;

    border: 0 !important;

    color: #7c8682 !important;

    font-size: 10px !important;
}

.app-shell .signout-link:hover {
    background: transparent !important;
    color: var(--red) !important;
}


/* ---------- MAIN CONTENT ---------- */

.app-shell .main-content {
    flex: 1 !important;

    width: 100% !important;

    padding: 32px 34px 60px !important;

    background: var(--bg) !important;
}

.app-shell .content-container {
    width: 100% !important;

    max-width: 1280px !important;

    margin: 0 auto !important;
}


/* ---------- PAGE HEADER ---------- */

.app-shell .page-header {
    display: flex !important;

    align-items: flex-end !important;
    justify-content: space-between !important;

    gap: 25px !important;

    margin-bottom: 28px !important;
}

.app-shell .page-header h1 {
    margin: 0 !important;

    color: var(--black) !important;

    font-size: 28px !important;
    font-weight: 720 !important;

    letter-spacing: -.045em !important;
}

.app-shell .page-header .eyebrow {
    margin-bottom: 7px !important;
}


/* ---------- SECTION HEADING ---------- */

.section-heading {
    display: flex !important;

    align-items: flex-end !important;
    justify-content: space-between !important;

    gap: 20px !important;

    margin-bottom: 12px !important;
}

.section-heading h2 {
    margin: 0 !important;

    color: var(--black) !important;

    font-size: 16px !important;
    font-weight: 700 !important;

    letter-spacing: -.025em !important;
}


/* ---------- MOBILE ---------- */

@media (max-width: 760px) {

    .app-shell .sidebar {
        transform: translateX(-100%) !important;

        transition: transform .2s ease !important;
    }

    body.sidebar-open .app-shell .sidebar {
        transform: translateX(0) !important;

        box-shadow: 15px 0 40px rgba(15,30,24,.12) !important;
    }

    .app-shell .app-main {
        width: 100% !important;

        margin-left: 0 !important;
    }

    .app-shell .mobile-menu {
        display: inline-flex !important;

        align-items: center !important;
        justify-content: center !important;

        width: 34px !important;
        height: 34px !important;

        margin-right: 10px !important;

        border: 1px solid var(--border) !important;
        border-radius: 7px !important;

        background: #fff !important;
        color: var(--black) !important;
    }

    .app-shell .topbar {
        height: 60px !important;
        min-height: 60px !important;

        padding: 0 15px !important;
    }

    .app-shell .main-content {
        padding: 22px 15px 40px !important;
    }

    .app-shell .page-header {
        align-items: flex-start !important;

        flex-direction: column !important;
    }

    .app-shell .user-info,
    .app-shell .signout-link {
        display: none !important;
    }
}
}