* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background: #f5f7fa;
    color: #1d2733;
}

a {
    color: #285f98;
}

.topbar {
    min-height: 68px;

    padding:
        0
        max(24px, calc((100% - 1180px) / 2));

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

    background: #ffffff;

    border-bottom:
        1px solid #e3e7ec;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand {
    font-size: 18px;
}

.product {
    color: #77818b;
    font-size: 14px;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 18px;
}

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

    font-size: 14px;
}

.role,
.phase-badge,
.status-pill,
.coming-soon {
    display: inline-flex;

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

    border-radius: 999px;
}

.role {
    padding: 4px 8px;

    background: #eef1f5;

    color: #68727d;

    font-size: 11px;

    text-transform: uppercase;
}

.page {
    width: min(1180px, 92%);

    min-height:
        calc(100vh - 160px);

    margin:
        38px auto 60px;
}

.footer {
    padding: 22px;

    text-align: center;

    color: #87909a;

    font-size: 13px;
}

.eyebrow {
    margin-bottom: 8px;

    color: #6d7883;

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

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin:
        0 0 12px;

    font-size: clamp(
        28px,
        4vw,
        40px
    );

    line-height: 1.12;
}

h2 {
    margin-top: 0;
}

p {
    line-height: 1.65;
}

.lead {
    font-size: 18px;
}

.muted {
    color: #737d87;
}

.small {
    font-size: 12px;
}

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

    margin: 72px auto;

    padding: 38px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 16px;

    box-shadow:
        0 10px 35px
        rgba(20, 34, 48, 0.06);
}

.login-form {
    margin-top: 28px;
}

label {
    display: block;

    margin:
        18px 0 7px;

    font-weight: 650;
}

label span {
    display: block;

    margin-top: 2px;

    color: #85909a;

    font-size: 12px;
    font-weight: 400;
}

input {
    width: 100%;

    padding: 13px 14px;

    border:
        1px solid #cdd4db;

    border-radius: 8px;

    background: #ffffff;

    color: #1d2733;

    font-size: 15px;
}

input:focus {
    outline:
        3px solid
        rgba(
            57,
            114,
            170,
            0.15
        );

    border-color: #4c82b5;
}

.button {
    display: inline-flex;

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

    min-height: 44px;

    padding: 11px 19px;

    border: 0;
    border-radius: 8px;

    text-decoration: none;

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

    cursor: pointer;
}

.button.primary {
    background: #203142;
    color: #ffffff;
}

.button.secondary {
    background: #e9edf1;
    color: #26333f;
}

.button.full {
    width: 100%;
}

.link-button {
    padding: 0;

    border: 0;

    background: transparent;
    color: #285f98;

    cursor: pointer;
}

.flash {
    margin-bottom: 20px;

    padding: 13px 15px;

    border-radius: 8px;

    background: #edf1f4;
}

.flash.error {
    background: #fcecec;
    color: #8b2626;
}

.page-heading,
.workspace-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.workspace-header h1 {
    font-size: clamp(
        26px,
        3vw,
        34px
    );
}

.phase-badge {
    padding: 7px 11px;

    background: #e9edf2;

    color: #5d6873;

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

.status-pill {
    padding: 6px 10px;

    background: #edf0f3;

    color: #68727d;

    font-size: 12px;
}

.status-pill.active {
    background: #e8f5ed;
    color: #257044;
}

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(190px, 1fr)
        );

    gap: 16px;

    margin-bottom: 22px;
}

.stat-card {
    display: flex;

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

    padding: 20px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 11px;
}

.stat-card span {
    color: #737d87;

    font-size: 13px;
}

.stat-card strong {
    font-size: 24px;
}

.card {
    padding: 28px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 13px;

    box-shadow:
        0 5px 18px
        rgba(20, 34, 48, 0.035);
}

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

table {
    width: 100%;

    border-collapse: collapse;
}

th,
td {
    padding: 14px 11px;

    text-align: left;

    border-bottom:
        1px solid #e8ebee;

    vertical-align: middle;
}

th {
    color: #6a7480;

    font-size: 12px;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}

.text-link,
.back-link {
    text-decoration: none;

    font-weight: 600;
}

.back-link {
    display: inline-block;

    margin-bottom: 11px;

    font-size: 13px;
}

.workspace-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(240px, 1fr)
        );

    gap: 18px;
}

.workspace-card {
    display: flex;

    flex-direction: column;

    gap: 8px;

    padding: 25px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 12px;

    color: #1d2733;

    text-decoration: none;
}

.workspace-card:hover {
    border-color: #bdc8d3;

    box-shadow:
        0 7px 22px
        rgba(20, 34, 48, 0.06);
}

.workspace-nav {
    display: flex;

    gap: 6px;

    margin-bottom: 22px;

    padding: 5px;

    overflow-x: auto;

    background: #e9edf1;

    border-radius: 10px;
}

.workspace-nav a {
    flex: 0 0 auto;

    padding: 10px 15px;

    border-radius: 7px;

    color: #5d6873;

    text-decoration: none;

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

.workspace-nav a.active {
    background: #ffffff;

    color: #1d2733;

    box-shadow:
        0 1px 4px
        rgba(20, 34, 48, 0.08);
}

.welcome-card {
    display: grid;

    grid-template-columns:
        58px 1fr;

    gap: 22px;

    padding: 30px;

    background: #ffffff;

    border:
        1px solid #e1e6eb;

    border-radius: 14px;

    box-shadow:
        0 5px 18px
        rgba(20, 34, 48, 0.035);
}

.welcome-mark {
    width: 52px;
    height: 52px;

    display: flex;

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

    border-radius: 13px;

    background: #203142;
    color: #ffffff;

    font-weight: 750;
}

.notice {
    margin: 22px 0;

    padding: 16px 18px;

    background: #f4f6f8;

    border-left:
        3px solid #60758a;

    border-radius: 6px;

    line-height: 1.6;
}

.section-empty {
    min-height: 330px;

    display: flex;

    flex-direction: column;

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

    text-align: center;
}

.section-empty p {
    max-width: 560px;
}

.section-icon {
    width: 54px;
    height: 54px;

    margin-bottom: 14px;

    display: flex;

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

    border-radius: 14px;

    background: #eff2f5;

    font-size: 24px;
}

.coming-soon {
    margin-top: 14px;

    padding: 6px 10px;

    background: #edf0f3;

    color: #68727d;

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

.details {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(180px, 1fr)
        );

    gap: 16px;

    margin-bottom: 0;
}

.details div {
    padding: 15px;

    background: #f7f8fa;

    border-radius: 8px;
}

.details dt {
    margin-bottom: 6px;

    color: #727d88;

    font-size: 12px;
}

.details dd {
    margin: 0;

    font-weight: 650;
}


@media (
    max-width: 720px
) {

    .topbar {
        padding: 15px 18px;

        align-items: flex-start;

        flex-direction: column;

        gap: 13px;
    }

    .user-area {
        width: 100%;

        justify-content: space-between;
    }

    .page {
        width: min(
            94%,
            1180px
        );

        margin-top: 25px;
    }

    .auth-card {
        margin-top: 30px;

        padding: 26px;
    }

    .page-heading,
    .workspace-header {
        flex-direction: column;
    }

    .welcome-card {
        grid-template-columns: 1fr;
    }

    .workspace-nav {
        white-space: nowrap;
    }

    .card {
        padding: 21px;
    }
}


/* ====================================================================
   PHASE 4 CONVERSATION UI
   ==================================================================== */

.conversation-card {
    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 13px;

    overflow: hidden;

    box-shadow:
        0 5px 18px
        rgba(20, 34, 48, 0.035);
}

.conversation-heading {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 26px 28px;

    border-bottom:
        1px solid #e8ebee;
}

.conversation-heading h2 {
    margin-bottom: 6px;
}

.phase-notice {
    margin: 22px 28px 0;

    padding: 15px 17px;

    background: #f4f6f8;

    border-left:
        3px solid #60758a;

    border-radius: 6px;

    line-height: 1.6;
}

.message-list {
    display: flex;

    flex-direction: column;

    gap: 16px;

    padding: 28px;
}

.message-row {
    max-width: 78%;

    padding: 15px 17px;

    border-radius: 12px;
}

.user-message {
    align-self: flex-end;

    background: #eaf1f7;
}

.assistant-message {
    align-self: flex-start;

    background: #f2f4f6;
}

.message-meta {
    display: flex;

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

    gap: 20px;

    margin-bottom: 8px;

    color: #697580;

    font-size: 12px;
}

.message-content {
    white-space: pre-wrap;

    overflow-wrap: anywhere;

    line-height: 1.65;
}

.message-status {
    margin-top: 9px;

    color: #85909a;

    font-size: 11px;

    text-transform: uppercase;
}

.empty-transcript {
    padding: 45px 20px;

    text-align: center;

    color: #727d88;
}

.empty-transcript h3 {
    color: #273542;
}

.message-form {
    padding: 26px 28px;

    border-top:
        1px solid #e8ebee;

    background: #fafbfc;
}

.message-form label {
    margin-top: 0;
}

.message-form textarea {
    width: 100%;

    min-height: 125px;

    padding: 13px 14px;

    resize: vertical;

    border:
        1px solid #cdd4db;

    border-radius: 8px;

    background: #ffffff;

    color: #1d2733;

    font-family: inherit;

    font-size: 15px;

    line-height: 1.55;
}

.message-form textarea:focus {
    outline:
        3px solid
        rgba(57, 114, 170, 0.15);

    border-color: #4c82b5;
}

.message-form-footer {
    display: flex;

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

    gap: 18px;

    margin-top: 13px;
}


@media (max-width: 720px) {

    .conversation-heading {
        padding: 21px;

        flex-direction: column;
    }

    .phase-notice {
        margin:
            18px
            20px
            0;
    }

    .message-list {
        padding: 20px;
    }

    .message-row {
        max-width: 94%;
    }

    .message-meta {
        align-items: flex-start;

        flex-direction: column;

        gap: 3px;
    }

    .message-form {
        padding: 21px;
    }

    .message-form-footer {
        align-items: stretch;

        flex-direction: column;
    }
}



/* ====================================================================
   PHASE 5 AI STATES
   ==================================================================== */

.ai-state {
    margin-top: 10px;

    color: #667788;

    font-size: 12px;
    font-style: italic;
}

.ai-error {
    margin-top: 12px;

    padding: 12px;

    background: #fff1f1;

    border:
        1px solid #efd2d2;

    border-radius: 8px;

    color: #842f2f;

    font-size: 13px;

    line-height: 1.5;
}

.retry-button {
    margin-top: 10px;

    padding: 7px 12px;

    border:
        1px solid #c88f8f;

    border-radius: 6px;

    background: #ffffff;

    color: #7d2929;

    font-weight: 650;

    cursor: pointer;
}

.retry-button:hover {
    background: #fff8f8;
}



/* ====================================================================
   PHASE 6 SUMMARY VERSION UI
   ==================================================================== */

.summary-page {
    display: flex;

    flex-direction: column;

    gap: 22px;
}

.summary-toolbar {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;

    padding: 26px 28px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 13px;
}

.summary-toolbar h2 {
    margin-bottom: 7px;
}

.summary-change-notice {
    padding: 15px 18px;

    background: #fff8e8;

    border:
        1px solid #ead8a7;

    border-radius: 9px;

    color: #725b22;

    line-height: 1.6;
}

.summary-change-notice strong {
    display: block;

    margin-bottom: 4px;
}

.summary-card {
    padding: 28px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 13px;

    box-shadow:
        0 5px 18px
        rgba(20, 34, 48, 0.035);
}

.summary-card-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.summary-version-label {
    margin-bottom: 5px;

    color: #75808b;

    font-size: 12px;

    font-weight: 700;

    text-transform: uppercase;
}

.summary-card h3 {
    margin: 0;
}

.summary-status {
    display: inline-flex;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 750;

    text-transform: uppercase;
}

.summary-status.draft {
    background: #eef1f4;

    color: #64707c;
}

.summary-status.confirmed {
    background: #e6f5eb;

    color: #246c42;
}

.summary-content,
.historical-summary-content {
    white-space: pre-wrap;

    overflow-wrap: anywhere;

    line-height: 1.7;
}

.summary-content {
    font-size: 15px;
}

.summary-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 18px;

    margin-top: 25px;

    padding-top: 16px;

    border-top:
        1px solid #e8ebee;

    color: #7a8590;

    font-size: 12px;
}

.version-history {
    padding: 25px 28px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 13px;
}

.version-history h3 {
    margin-top: 0;
}

.version-item {
    border-top:
        1px solid #e8ebee;
}

.version-item summary {
    display: flex;

    align-items: center;

    gap: 14px;

    padding: 15px 0;

    cursor: pointer;

    list-style: none;
}

.version-item summary::-webkit-details-marker {
    display: none;
}

.historical-summary-content {
    padding:
        0
        0
        22px;

    color: #3a4651;

    font-size: 14px;
}


@media (max-width: 720px) {

    .summary-toolbar {
        flex-direction: column;

        padding: 21px;
    }

    .summary-toolbar form,
    .summary-toolbar .button {
        width: 100%;
    }

    .summary-card {
        padding: 21px;
    }

    .summary-card-header {
        flex-direction: column;
    }

    .version-history {
        padding: 21px;
    }

    .version-item summary {
        align-items: flex-start;

        flex-direction: column;

        gap: 7px;
    }
}



/* ====================================================================
   PHASE 7 CORRECTION CONFIRMATION UI
   ==================================================================== */

.summary-action-card {
    padding: 28px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 13px;
}

.summary-action-card h3 {
    margin-top: 0;
}

.summary-action-card textarea {
    width: 100%;

    padding: 13px 14px;

    resize: vertical;

    border:
        1px solid #cdd4db;

    border-radius: 8px;

    font-family: inherit;

    font-size: 14px;

    line-height: 1.6;
}

.summary-action-card textarea:focus {
    outline:
        3px solid
        rgba(57, 114, 170, 0.15);

    border-color: #4c82b5;
}

.confirm-card {
    border-color: #cfe3d5;

    background: #fbfefc;
}

.confirmation-banner {
    display: flex;

    gap: 15px;

    padding: 18px;

    background: #eaf7ee;

    border:
        1px solid #c9e5d2;

    border-radius: 10px;

    color: #285e3c;
}

.confirmation-banner p {
    margin-bottom: 0;
}

.confirmation-icon {
    width: 34px;
    height: 34px;

    flex: 0 0 auto;

    display: flex;

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

    border-radius: 50%;

    background: #3b8a5b;

    color: #ffffff;

    font-weight: 800;
}

.confirmation-check {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    padding: 14px;

    background: #f4f8f5;

    border-radius: 8px;

    cursor: pointer;
}

.confirmation-check input {
    width: auto;

    margin-top: 3px;
}

.confirmation-check span {
    margin: 0;

    color: #2d4436;

    font-size: 14px;

    font-weight: 500;
}

.confirm-button {
    margin-top: 16px;

    background: #347a50;

    color: #ffffff;
}

.correction-note {
    margin-top: 20px;

    padding: 13px 15px;

    background: #f4f6f8;

    border-radius: 8px;

    color: #596570;

    line-height: 1.6;
}

.correction-note strong {
    display: block;

    margin-bottom: 5px;
}

.revision-pill {
    display: inline-flex;

    padding: 5px 8px;

    border-radius: 999px;

    font-size: 10px;

    font-weight: 750;

    text-transform: uppercase;
}

.revision-pill.corrected {
    background: #eef0fa;

    color: #4f5791;
}

.revision-pill.ai {
    background: #eef1f4;

    color: #66717c;
}


@media (max-width: 720px) {

    .summary-action-card {
        padding: 21px;
    }

    .confirmation-banner {
        align-items: flex-start;
    }

}



/* ====================================================================
   PHASE 8 DOCUMENT SHARING UI
   ==================================================================== */

.documents-page {
    display: flex;

    flex-direction: column;

    gap: 22px;
}

.documents-heading h2 {
    margin-bottom: 7px;
}

.document-upload-card,
.document-list-card {
    padding: 28px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 13px;

    box-shadow:
        0 5px 18px
        rgba(20, 34, 48, 0.035);
}

.document-upload-card h3 {
    margin-top: 0;
}

.document-upload-card input[
    type="file"
] {
    padding: 10px;

    background: #f8fafb;
}

.document-upload-help {
    margin-top: 9px;

    color: #7b8691;

    font-size: 12px;
}

.document-list-heading {
    display: flex;

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

    gap: 18px;

    margin-bottom: 18px;
}

.document-list-heading h3 {
    margin: 0;
}

.document-count {
    min-width: 30px;
    height: 30px;

    display: inline-flex;

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

    padding: 0 9px;

    border-radius: 999px;

    background: #eef1f4;

    color: #68737e;

    font-size: 12px;

    font-weight: 700;
}

.document-filename {
    max-width: 280px;

    overflow-wrap: anywhere;

    color: #697580;
}

.document-download {
    display: inline-flex;

    align-items: center;

    padding: 7px 11px;

    border:
        1px solid #cdd5dc;

    border-radius: 7px;

    color: #285f98;

    text-decoration: none;

    font-size: 13px;

    font-weight: 650;
}

.document-download:hover {
    background: #f5f7f9;
}

.document-empty {
    min-height: 250px;

    display: flex;

    flex-direction: column;

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

    text-align: center;

    color: #707b86;
}

.document-empty h3 {
    color: #273542;
}


@media (max-width: 720px) {

    .document-upload-card,
    .document-list-card {
        padding: 21px;
    }

}



/* ====================================================================
   PHASE 9 EXPORT UI
   ==================================================================== */

.exports-page {
    display: flex;

    flex-direction: column;

    gap: 22px;
}

.export-intro,
.export-card {
    padding: 27px 28px;

    background: #ffffff;

    border:
        1px solid #e2e6eb;

    border-radius: 13px;

    box-shadow:
        0 5px 18px
        rgba(20, 34, 48, 0.035);
}

.export-intro h2,
.export-card h3 {
    margin-top: 0;
}

.export-card {
    display: flex;

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

    gap: 24px;
}

.summary-export-card {
    align-items: stretch;

    flex-direction: column;
}

.export-version-list {
    border-top:
        1px solid #e8ebee;
}

.export-version-row {
    display: flex;

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

    gap: 20px;

    padding: 16px 0;

    border-bottom:
        1px solid #e8ebee;
}

.export-version-row strong {
    margin-right: 10px;
}

.export-empty {
    padding: 25px;

    background: #f7f8fa;

    border-radius: 8px;

    color: #737e89;

    text-align: center;
}

.export-security-note {
    padding: 16px 18px;

    background: #f4f6f8;

    border-left:
        3px solid #60758a;

    border-radius: 7px;

    color: #596570;

    line-height: 1.6;
}

.export-security-note strong {
    display: block;

    margin-bottom: 4px;
}


@media (max-width: 720px) {

    .export-card,
    .export-version-row {
        align-items: stretch;

        flex-direction: column;
    }

    .export-card .button,
    .export-version-row .document-download {
        width: 100%;

        justify-content: center;
    }

}



/* ==================================================================
   PHASE 11 ADMIN CLIENT MANAGEMENT
   ================================================================== */

.admin-client-heading {
    align-items: center;
}

.admin-heading-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-list-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 18px;
}

.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.admin-inline-form {
    display: inline;
    margin: 0;
}

.admin-action-button {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.admin-action-button.danger {
    font-weight: 700;
}

.admin-client-form-card {
    max-width: 760px;
}

.admin-client-form {
    display: grid;
    gap: 22px;
}

.admin-form-field {
    display: grid;
    gap: 8px;
}

.admin-form-field label {
    font-weight: 700;
}

.admin-form-field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(120, 130, 150, 0.35);
    border-radius: 8px;
    background: inherit;
    color: inherit;
    font: inherit;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.admin-credential-card {
    max-width: 760px;
}

.admin-credential-warning {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid rgba(120, 130, 150, 0.35);
    border-radius: 10px;
}

.admin-credential-warning p {
    margin-bottom: 0;
}

.admin-credential-row {
    display: grid;
    gap: 7px;
    margin: 0 0 18px;
}

.admin-credential-row > span {
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-credential-row input {
    width: 100%;
}

.admin-empty-state {
    padding: 28px;
    text-align: center;
}

@media (max-width: 760px) {

    .admin-client-heading {
        align-items: flex-start;
    }

    .admin-heading-actions {
        width: 100%;
    }

    .admin-heading-actions .button {
        width: 100%;
        text-align: center;
    }

    .admin-list-toolbar {
        justify-content: flex-start;
    }

    .admin-row-actions {
        align-items: flex-start;
        flex-direction: column;
    }

}


/* ==================================================================
   PHASE 12 CLASSIC UI
   EcomCloud.ai Client Workspace
   ================================================================== */


/* ------------------------------------------------------------------
   DESIGN TOKENS
   ------------------------------------------------------------------ */

:root {
    --classic-navy: #17314b;
    --classic-navy-strong: #102a43;
    --classic-navy-hover: #0d243a;

    --classic-text: #1f2d3d;
    --classic-muted: #718096;
    --classic-soft-text: #8a98aa;

    --classic-page: #f7f9fc;
    --classic-surface: #ffffff;
    --classic-soft: #f0f4f8;
    --classic-soft-blue: #edf4fb;

    --classic-border: #dfe6ee;
    --classic-border-strong: #ccd6e2;

    --classic-green: #2d8a59;
    --classic-green-soft: #eaf7ef;

    --classic-radius: 14px;
    --classic-radius-large: 18px;

    --classic-shadow:
        0 14px 38px rgba(19, 43, 67, 0.07);

    --classic-shadow-soft:
        0 5px 18px rgba(19, 43, 67, 0.055);
}


/* ------------------------------------------------------------------
   GLOBAL
   ------------------------------------------------------------------ */

html {
    background: var(--classic-page);
}

body {
    margin: 0;

    min-height: 100vh;

    color: var(--classic-text);

    font-family:
        "Segoe UI",
        "Noto Sans Georgian",
        Arial,
        sans-serif;

    line-height: 1.55;

    background:
        radial-gradient(
            circle at -6% 8%,
            rgba(222, 233, 245, 0.65) 0,
            rgba(232, 240, 248, 0.42) 180px,
            transparent 340px
        ),
        radial-gradient(
            circle at 106% 88%,
            rgba(224, 234, 245, 0.60) 0,
            rgba(235, 241, 248, 0.38) 200px,
            transparent 390px
        ),
        var(--classic-page);

    background-attachment: fixed;

    overflow-x: hidden;

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


a {
    transition:
        color 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}


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


/* ------------------------------------------------------------------
   TOP BAR
   ------------------------------------------------------------------ */

.topbar {
    min-height: 72px;

    padding:
        0
        max(
            30px,
            calc((100vw - 1180px) / 2)
        );

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

    background: rgba(255, 255, 255, 0.90);

    border-bottom:
        1px solid
        rgba(211, 220, 230, 0.85);

    box-shadow:
        0 1px 0
        rgba(255, 255, 255, 0.85);

    backdrop-filter: blur(12px);

    position: relative;
    z-index: 20;
}


.brand-area {
    display: flex;
    align-items: center;
    gap: 14px;
}


.brand {
    color: var(--classic-navy-strong);

    font-size: 1.28rem;
    font-weight: 750;

    letter-spacing: -0.035em;
}


.product {
    color: var(--classic-muted);

    font-size: 0.95rem;

    padding-left: 14px;

    border-left:
        1px solid
        var(--classic-border-strong);
}


.user-area {
    display: flex;
    align-items: center;
    gap: 14px;
}


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


.user-meta strong {
    color: var(--classic-text);
}


.role {
    color: var(--classic-muted);

    font-size: 0.79rem;
}


.link-button {
    color: var(--classic-muted);

    font-weight: 600;

    border-radius: 9px;

    padding: 8px 11px;

    transition:
        background-color 160ms ease,
        color 160ms ease;
}


.link-button:hover {
    color: var(--classic-navy);

    background:
        var(--classic-soft);
}


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

.page {
    width: min(
        calc(100% - 44px),
        1180px
    );

    margin:
        0
        auto;

    padding:
        34px
        0
        54px;
}


.page-heading {
    margin-bottom: 24px;
}


.page-heading h1 {
    margin:
        5px
        0
        7px;

    color:
        var(--classic-text);

    font-size:
        clamp(
            2rem,
            4vw,
            2.65rem
        );

    line-height: 1.1;

    letter-spacing: -0.045em;
}


.eyebrow {
    color: var(--classic-muted);

    font-size: 0.78rem;
    font-weight: 700;

    letter-spacing: 0.09em;

    text-transform: uppercase;
}


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


.small {
    font-size: 0.82rem;
}


/* ------------------------------------------------------------------
   CARDS
   ------------------------------------------------------------------ */

.card,
.auth-card,
.workspace-card,
.welcome-card,
.summary-card,
.document-upload-card,
.document-list-card,
.export-card {

    background:
        rgba(255, 255, 255, 0.96);

    border:
        1px solid
        var(--classic-border);

    border-radius:
        var(--classic-radius-large);

    box-shadow:
        var(--classic-shadow-soft);
}


.card {
    padding: 26px;
}


/* ------------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------------ */

.button,
button.button {

    min-height: 44px;

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

    gap: 8px;

    padding:
        10px
        18px;

    border-radius: 9px;

    font-weight: 650;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform 150ms ease,
        background-color 150ms ease,
        box-shadow 150ms ease,
        border-color 150ms ease;
}


.button.primary {
    color: #ffffff;

    background:
        var(--classic-navy);

    border:
        1px solid
        var(--classic-navy);

    box-shadow:
        0 4px 10px
        rgba(23, 49, 75, 0.12);
}


.button.primary:hover {
    background:
        var(--classic-navy-hover);

    border-color:
        var(--classic-navy-hover);

    transform:
        translateY(-1px);

    box-shadow:
        0 7px 16px
        rgba(23, 49, 75, 0.16);
}


.button.secondary {
    color:
        var(--classic-navy);

    background:
        #ffffff;

    border:
        1px solid
        var(--classic-border-strong);
}


.button.secondary:hover {
    background:
        var(--classic-soft);
}


/* ------------------------------------------------------------------
   INPUTS
   ------------------------------------------------------------------ */

input,
select,
textarea {

    box-sizing: border-box;

    border:
        1px solid
        var(--classic-border-strong);

    border-radius: 9px;

    color:
        var(--classic-text);

    background:
        rgba(255, 255, 255, 0.98);

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background-color 150ms ease;
}


input {
    min-height: 46px;

    padding:
        10px
        13px;
}


select {
    min-height: 46px;

    padding:
        10px
        13px;
}


textarea {
    padding:
        13px;
}


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


input:focus,
select:focus,
textarea:focus {

    outline: none;

    border-color:
        #7895b2;

    background:
        #ffffff;

    box-shadow:
        0 0 0 3px
        rgba(79, 116, 151, 0.12);
}


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

.login-page .topbar {

    min-height: auto;

    padding:
        48px
        20px
        12px;

    justify-content: center;

    background: transparent;

    border-bottom: 0;

    box-shadow: none;

    backdrop-filter: none;
}


.login-page .brand-area {

    flex-direction: column;

    gap: 2px;

    text-align: center;
}


.login-page .brand {

    font-size:
        clamp(
            1.8rem,
            4vw,
            2.25rem
        );

    font-weight: 750;
}


.login-page .product {

    padding-left: 0;

    border-left: 0;

    color:
        var(--classic-muted);

    font-size: 1rem;
}


.login-page .page {

    width:
        min(
            calc(100% - 36px),
            520px
        );

    padding:
        22px
        0
        40px;

    display: block;
}


.login-page .auth-card {

    width: 100%;

    box-sizing: border-box;

    margin:
        0
        auto;

    padding:
        40px
        40px
        36px;

    border:
        1px solid
        rgba(215, 224, 233, 0.95);

    border-radius: 18px;

    box-shadow:
        0 20px 50px
        rgba(30, 51, 72, 0.085);

    background:
        rgba(255, 255, 255, 0.97);

    position: relative;
}


/* Small classic EcomCloud mark */

.login-page .auth-card::before {

    content: "EC";

    width: 52px;
    height: 52px;

    margin:
        0
        auto
        20px;

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

    color:
        var(--classic-navy);

    background:
        var(--classic-soft-blue);

    border:
        1px solid
        #dce6f0;

    border-radius: 13px;

    font-size: 0.86rem;
    font-weight: 800;

    letter-spacing: 0.03em;
}


.login-page .auth-card h1 {

    margin:
        0
        0
        10px;

    color:
        var(--classic-text);

    text-align: center;

    font-size:
        clamp(
            2.1rem,
            8vw,
            2.75rem
        );

    line-height: 1.05;

    letter-spacing: -0.04em;
}


.login-page .auth-card .eyebrow {

    text-align: center;

    margin-bottom: 10px;

    color:
        var(--classic-muted);
}


.login-page .auth-card p {

    color:
        var(--classic-muted);

    text-align: center;

    max-width: 420px;

    margin:
        0
        auto
        12px;
}


.login-page .login-form {

    margin-top: 28px;

    display: grid;

    gap: 18px;
}


.login-page .login-form label {

    color:
        var(--classic-text);

    font-size: 0.91rem;

    font-weight: 650;
}


.login-page .login-form input {

    width: 100%;

    min-height: 50px;

    border-radius: 9px;

    padding:
        11px
        14px;
}


.login-page .login-form .button,
.login-page .login-form button[type="submit"] {

    width: 100%;

    min-height: 49px;

    margin-top: 2px;

    color: #ffffff;

    background:
        var(--classic-navy);

    border:
        1px solid
        var(--classic-navy);

    border-radius: 9px;

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 150ms ease,
        background-color 150ms ease,
        box-shadow 150ms ease;
}


.login-page .login-form .button:hover,
.login-page .login-form button[type="submit"]:hover {

    background:
        var(--classic-navy-hover);

    transform:
        translateY(-1px);

    box-shadow:
        0 7px 18px
        rgba(23, 49, 75, 0.16);
}


.login-page .footer {

    color:
        var(--classic-soft-text);

    padding:
        10px
        20px
        30px;

    text-align: center;

    font-size: 0.82rem;
}


/* ==================================================================
   CLIENT WORKSPACE
   ================================================================== */

.client-page .page,
.admin-page .page {

    width:
        min(
            calc(100% - 44px),
            1180px
        );
}


/* Workspace identity header */

.client-page .workspace-header,
.admin-page .workspace-header {

    margin:
        6px
        0
        24px;

    padding:
        20px
        20px
        10px;

    border: 0;

    background: transparent;

    box-shadow: none;
}


.client-page .workspace-header h1,
.admin-page .workspace-header h1 {

    margin:
        5px
        0
        5px;

    color:
        var(--classic-text);

    font-size:
        clamp(
            2.2rem,
            5vw,
            3rem
        );

    line-height: 1.05;

    letter-spacing: -0.05em;
}


.client-page .workspace-header p,
.admin-page .workspace-header p {

    color:
        var(--classic-muted);

    font-size: 0.98rem;
}


/* Status */

.status-pill {

    display: inline-flex;
    align-items: center;

    min-height: 26px;

    padding:
        3px
        10px;

    border-radius: 999px;

    color:
        var(--classic-muted);

    background:
        var(--classic-soft);

    border:
        1px solid
        var(--classic-border);

    font-size: 0.76rem;
    font-weight: 650;
}


.status-pill.active {

    color:
        var(--classic-green);

    background:
        var(--classic-green-soft);

    border-color:
        #d3ebdc;
}


/* ------------------------------------------------------------------
   WORKSPACE NAVIGATION
   ------------------------------------------------------------------ */

.client-page .workspace-nav,
.admin-page .workspace-nav {

    display: flex;
    align-items: center;

    gap: 5px;

    margin:
        0
        0
        22px;

    padding: 6px;

    border:
        1px solid
        var(--classic-border);

    border-radius: 13px;

    background:
        rgba(237, 242, 247, 0.90);

    box-shadow:
        inset
        0 1px 0
        rgba(255, 255, 255, 0.8);

    overflow-x: auto;
}


.client-page .workspace-nav a,
.admin-page .workspace-nav a {

    min-height: 42px;

    display: inline-flex;
    align-items: center;

    padding:
        0
        18px;

    border-radius: 9px;

    color:
        #687a8e;

    font-weight: 600;

    text-decoration: none;

    white-space: nowrap;

    border:
        1px solid
        transparent;
}


.client-page .workspace-nav a:hover,
.admin-page .workspace-nav a:hover {

    color:
        var(--classic-navy);

    background:
        rgba(255, 255, 255, 0.55);
}


.client-page .workspace-nav a.active,
.admin-page .workspace-nav a.active {

    color:
        var(--classic-navy-strong);

    background:
        #ffffff;

    border-color:
        #e4eaf0;

    box-shadow:
        0 4px 12px
        rgba(20, 47, 72, 0.07);
}


/* ------------------------------------------------------------------
   WELCOME AREA
   ------------------------------------------------------------------ */

.client-page .welcome-card,
.admin-page .welcome-card {

    margin-top: 0;

    padding:
        clamp(
            28px,
            4vw,
            42px
        );

    border:
        1px solid
        var(--classic-border);

    border-radius:
        var(--classic-radius-large);

    background:
        rgba(255, 255, 255, 0.97);

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


.client-page .welcome-card h1,
.client-page .welcome-card h2,
.client-page .welcome-card h3,
.admin-page .welcome-card h1,
.admin-page .welcome-card h2,
.admin-page .welcome-card h3 {

    color:
        var(--classic-navy-strong);

    line-height: 1.22;

    letter-spacing: -0.035em;
}


.client-page .welcome-card p,
.admin-page .welcome-card p {

    color:
        #4f6175;

    line-height: 1.72;
}


/* Make callouts inside welcome cards softer */

.client-page .welcome-card blockquote,
.admin-page .welcome-card blockquote {

    margin:
        24px
        0;

    padding:
        18px
        20px;

    color:
        #44586d;

    background:
        var(--classic-soft-blue);

    border:
        0;

    border-left:
        3px solid
        #8eb1d1;

    border-radius:
        8px;
}


/* ------------------------------------------------------------------
   GENERAL WORKSPACE CARDS
   ------------------------------------------------------------------ */

.client-page .card,
.admin-page .card {

    border:
        1px solid
        var(--classic-border);

    border-radius:
        var(--classic-radius-large);

    box-shadow:
        var(--classic-shadow-soft);
}


/* ------------------------------------------------------------------
   TABLES
   ------------------------------------------------------------------ */

table {

    width: 100%;

    border-collapse: collapse;
}


thead th {

    color:
        var(--classic-muted);

    font-size: 0.75rem;
    font-weight: 700;

    letter-spacing: 0.055em;

    text-transform: uppercase;

    background:
        #fafbfd;
}


th,
td {

    padding:
        14px
        15px;

    border-bottom:
        1px solid
        #e8edf2;

    vertical-align: middle;
}


tbody tr:hover {

    background:
        rgba(244, 247, 250, 0.7);
}


/* ------------------------------------------------------------------
   FLASH MESSAGES
   ------------------------------------------------------------------ */

.flash {

    margin-bottom: 18px;

    padding:
        13px
        15px;

    border-radius: 9px;

    border:
        1px solid
        var(--classic-border);

    box-shadow: none;
}


.flash.success {

    color:
        #276749;

    background:
        #f0fff4;

    border-color:
        #c6f6d5;
}


.flash.error {

    color:
        #9b2c2c;

    background:
        #fff5f5;

    border-color:
        #fed7d7;
}


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

.footer {

    width:
        min(
            calc(100% - 44px),
            1180px
        );

    margin:
        0
        auto;

    padding:
        10px
        0
        30px;

    color:
        var(--classic-soft-text);

    text-align: center;

    font-size:
        0.82rem;
}


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

@media (max-width: 760px) {

    .topbar {

        min-height: 64px;

        padding:
            0
            18px;
    }


    .product {

        display: none;
    }


    .user-meta {

        display: none;
    }


    .page {

        width:
            min(
                calc(100% - 28px),
                1180px
            );

        padding-top: 22px;
    }


    .login-page .topbar {

        padding:
            34px
            16px
            8px;
    }


    .login-page .page {

        width:
            min(
                calc(100% - 24px),
                520px
            );

        padding-top: 16px;
    }


    .login-page .auth-card {

        padding:
            30px
            22px
            28px;

        border-radius: 15px;
    }


    .client-page .workspace-header,
    .admin-page .workspace-header {

        padding:
            12px
            4px
            6px;
    }


    .client-page .workspace-nav,
    .admin-page .workspace-nav {

        margin-bottom: 16px;

        border-radius: 11px;
    }


    .client-page .workspace-nav a,
    .admin-page .workspace-nav a {

        padding:
            0
            14px;
    }


    .client-page .welcome-card,
    .admin-page .welcome-card {

        padding:
            24px
            20px;
    }


    .footer {

        width:
            calc(100% - 28px);
    }

}


@media (max-width: 460px) {

    .brand {

        font-size: 1.12rem;
    }


    .login-page .brand {

        font-size: 1.7rem;
    }


    .login-page .auth-card h1 {

        font-size: 2rem;
    }


    .client-page .workspace-header h1,
    .admin-page .workspace-header h1 {

        font-size: 2rem;
    }

}
