:root {
    --paktum-bg: #f5f3ee;
    --paktum-sidebar: #173f35;
    --paktum-sidebar-light: #1f5548;
    --paktum-accent: #d6a85f;
    --paktum-text: #17211d;
    --paktum-muted: #6f766f;
    --paktum-card: #ffffff;
    --paktum-border: #e4dfd5;
    --paktum-shadow: 0 18px 45px rgba(23, 63, 53, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--paktum-text);
    background: var(--paktum-bg);
}

a {
    text-decoration: none;
}

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

.app-sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--paktum-sidebar), #102d26);
    color: #fff;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 38px;
}

.app-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--paktum-accent);
    color: #17211d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.app-brand-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.app-brand-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.68);
    margin-top: 2px;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.76);
    font-weight: 600;
    transition: 0.18s ease;
}

.app-nav-item:hover,
.app-nav-item.active {
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
}

.app-nav-item.active {
    box-shadow: inset 3px 0 0 var(--paktum-accent);
}

.app-nav-icon {
    width: 24px;
    text-align: center;
}

.app-user-box {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 14px;
    display: flex;
    gap: 12px;
}

.app-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(214, 168, 95, 0.95);
    color: #17211d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.app-user-info {
    min-width: 0;
}

.app-user-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-user-email {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-logout-btn {
    margin-top: 10px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--paktum-accent);
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}

.app-main {
    flex: 1;
    margin-left: 280px;
    min-width: 0;
}

.app-main.guest-layout {
    margin-left: 0;
}

.app-topbar {
    min-height: 112px;
    padding: 30px 42px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-page-kicker {
    color: var(--paktum-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.app-page-title {
    margin: 5px 0 0;
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.app-topbar-actions {
    display: flex;
    gap: 10px;
}

.app-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--paktum-border);
    background: #fff;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(23, 63, 53, 0.07);
    display: none;
}

.app-content {
    padding: 0 42px 42px;
}

.app-breadcrumbs {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    display: flex;
    gap: 8px;
    color: var(--paktum-muted);
    font-size: 13px;
}

.app-card {
    background: var(--paktum-card);
    border: 1px solid var(--paktum-border);
    border-radius: 28px;
    padding: 28px;
    box-shadow: var(--paktum-shadow);
}

.app-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.app-card-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
}

.app-card-subtitle {
    margin-top: 6px;
    color: var(--paktum-muted);
}

.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 14px;
    font-weight: 700;
    border: 0;
    cursor: pointer;
}

.app-btn-primary {
    background: var(--paktum-sidebar);
    color: #fff;
}

.app-btn-primary:hover {
    background: var(--paktum-sidebar-light);
    color: #fff;
}

.app-btn-light {
    background: #fff;
    color: var(--paktum-sidebar);
    border: 1px solid var(--paktum-border);
}

.app-btn-light:hover {
    background: #fbfaf7;
    color: var(--paktum-sidebar);
}

.app-empty-state {
    border: 1px dashed #d7cec0;
    border-radius: 22px;
    padding: 34px;
    background: #fbfaf7;
    text-align: center;
}

.app-empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.app-empty-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
}

.app-empty-text {
    color: var(--paktum-muted);
    margin-bottom: 18px;
}

.login-layout {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: 1px solid var(--paktum-border);
    border-radius: 32px;
    padding: 36px;
    box-shadow: var(--paktum-shadow);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}

.login-logo-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: var(--paktum-sidebar);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
}

.login-logo-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.login-logo-subtitle {
    color: var(--paktum-muted);
    font-size: 13px;
    margin-top: 2px;
}

.login-title {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.login-subtitle {
    margin-top: 8px;
    margin-bottom: 30px;
    color: var(--paktum-muted);
}

.login-form .form-group {
    margin-bottom: 22px;
}

.login-form label {
    font-weight: 700;
    margin-bottom: 8px;
}

.login-input {
    height: 52px;
    border-radius: 16px;
    border: 1px solid #d8dcd7;
    box-shadow: none;
    padding: 12px 16px;
    font-size: 15px;
}

.login-input:focus {
    border-color: var(--paktum-sidebar);
    box-shadow: 0 0 0 4px rgba(23, 63, 53, 0.08);
}

.login-remember {
    margin-top: -6px;
    margin-bottom: 24px;
}

.login-submit-btn {
    width: 100%;
    height: 52px;
    border-radius: 16px;
    font-size: 15px;
}

.guest-content {
    padding-top: 0;
}

/* CASE PAGE START */
.case-page {
    width: 100%;
}

.case-hero {
    background:
            radial-gradient(circle at top right, rgba(214, 168, 95, 0.18), transparent 34%),
            linear-gradient(135deg, #ffffff, #fbfaf7);
    border: 1px solid var(--paktum-border);
    border-radius: 30px;
    padding: 28px;
    box-shadow: var(--paktum-shadow);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.case-kicker {
    color: var(--paktum-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

.case-hero h1 {
    margin: 8px 0 10px;
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--paktum-muted);
    font-size: 14px;
}

.case-meta span {
    background: #fff;
    border: 1px solid var(--paktum-border);
    border-radius: 999px;
    padding: 7px 12px;
}

.case-hero-actions {
    display: flex;
    align-items: flex-start;
}

.case-workspace {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
}

.case-step-card,
.case-content-card {
    background: var(--paktum-card);
    border: 1px solid var(--paktum-border);
    border-radius: 28px;
    box-shadow: var(--paktum-shadow);
}

.case-step-card {
    padding: 18px;
    align-self: start;
    position: sticky;
    top: 24px;
}

.case-step-title {
    font-weight: 800;
    margin: 4px 6px 18px;
    color: var(--paktum-sidebar);
    font-size: 15px;
}

.case-tabs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.case-tab-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 14px 16px;
    border-radius: 22px;
    border: 1px solid rgba(214, 168, 95, 0.12);
    background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
    color: var(--paktum-sidebar);
    text-decoration: none;
    transition: 0.18s ease;
    overflow: hidden;
    box-shadow:
            0 2px 4px rgba(15, 23, 42, 0.02),
            0 8px 24px rgba(15, 23, 42, 0.04);
}

.case-tab-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(214, 168, 95, 0.18), transparent 45%);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.case-tab-card:hover {
    transform: translateY(-2px);
    border-color: rgba(214, 168, 95, 0.35);
    box-shadow:
            0 10px 20px rgba(15, 23, 42, 0.06),
            0 20px 40px rgba(15, 23, 42, 0.08);
    color: var(--paktum-sidebar);
    text-decoration: none;
}

.case-tab-card:hover::before {
    opacity: 1;
}

.case-tab-card.active {
    background: linear-gradient(135deg, var(--paktum-sidebar) 0%, #204d43 100%);
    border-color: transparent;
    color: #fff;
    box-shadow:
            0 12px 28px rgba(23, 63, 53, 0.22),
            0 24px 48px rgba(23, 63, 53, 0.18);
}

.case-tab-card.active::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 100px;
    height: 100px;
    background: rgba(214, 168, 95, 0.15);
    border-radius: 50%;
}

.case-tab-card-icon {
    position: relative;
    z-index: 1;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 14px;
    background: rgba(23, 63, 53, 0.08);
    color: var(--paktum-sidebar);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.case-tab-card.active .case-tab-card-icon {
    background: var(--paktum-accent);
    color: #1e2b28;
    box-shadow: 0 8px 18px rgba(214, 168, 95, 0.28);
}

.case-tab-card-text {
    position: relative;
    z-index: 1;
}

.case-tab-card-label {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.case-content-card {
    min-width: 0;
    overflow: hidden;
}

.case-content-body {
    padding: 28px;
    background: #fbfaf7;
}

.party-tab {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.party-intro-card {
    background: #fff;
    border: 1px solid var(--paktum-border);
    border-radius: 24px;
    padding: 22px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.party-intro-card h3 {
    margin: 0 0 6px;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.party-intro-card p {
    margin: 0;
    color: var(--paktum-muted);
    max-width: 620px;
}

.party-empty-card {
    border: 1px dashed #d7cec0;
    background: #fff;
    border-radius: 24px;
    padding: 26px;
    display: flex;
    gap: 18px;
    align-items: center;
}

.party-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(214, 168, 95, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.party-empty-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 17px;
}

.party-empty-card p {
    margin: 0;
    color: var(--paktum-muted);
}

.party-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.party-card {
    background: #fff;
    border: 1px solid var(--paktum-border);
    border-radius: 22px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.party-avatar {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--paktum-sidebar);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.party-card-main {
    min-width: 0;
    flex: 1;
}

.party-name {
    font-weight: 800;
}

.party-details {
    color: var(--paktum-muted);
    font-size: 14px;
    margin-top: 2px;
}

.party-badge {
    border-radius: 999px;
    background: rgba(214, 168, 95, 0.18);
    color: var(--paktum-sidebar);
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 1000px) {
    .case-workspace {
        grid-template-columns: 1fr;
    }

    .case-step-card {
        position: static;
    }

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

    .case-tab-card {
        min-width: 0;
        width: 100%;
        white-space: normal;
    }

    .case-tab-card-label {
        white-space: normal;
        line-height: 1.25;
    }
}

@media (max-width: 700px) {
    .case-hero,
    .party-intro-card {
        flex-direction: column;
        align-items: stretch;
    }

    .case-hero h1 {
        font-size: 28px;
    }

    .case-content-body {
        padding: 18px;
    }

    .party-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .party-card-main {
        flex: 1 1 calc(100% - 64px);
        min-width: 0;
    }

    .party-details {
        overflow-wrap: anywhere;
    }

    .party-badge {
        margin-left: 60px;
    }

    .party-card .app-btn,
    .party-card .app-btn-sm {
        width: 100%;
    }

    .project-row-actions,
    .party-card-actions,
    .project-party-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 560px) {
    .case-tabs {
        grid-template-columns: 1fr;
    }
}

/* CASE PAGE END */

/* PROJECT PAGE START */
.project-tabs {
    display: inline-flex;
    gap: 6px;
    background: #fbfaf7;
    border: 1px solid var(--paktum-border);
    border-radius: 18px;
    padding: 6px;
    margin: 22px 0;
}

.project-tab {
    padding: 10px 18px;
    border-radius: 14px;
    color: var(--paktum-muted);
    font-weight: 800;
    text-decoration: none;
}

.project-tab:hover {
    color: var(--paktum-sidebar);
    text-decoration: none;
}

.project-tab.active {
    background: var(--paktum-sidebar);
    color: #fff;
    box-shadow: 0 10px 24px rgba(23, 63, 53, 0.18);
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-row-card {
    background: #fff;
    border: 1px solid var(--paktum-border);
    border-radius: 22px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--paktum-sidebar);
    text-decoration: none;
    transition: 0.18s ease;
}

.project-row-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    color: var(--paktum-sidebar);
    text-decoration: none;
}

.project-row-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: rgba(214, 168, 95, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.project-row-main {
    flex: 1;
    min-width: 0;
}

.project-row-title {
    font-weight: 800;
    font-size: 16px;
}

.project-row-meta {
    color: var(--paktum-muted);
    font-size: 14px;
    margin-top: 3px;
}

.project-row-status {
    background: rgba(23, 63, 53, 0.09);
    color: var(--paktum-sidebar);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
}

.project-row-status.archived {
    background: #f1f1f1;
    color: var(--paktum-muted);
}

.project-pagination {
    display: flex;
    gap: 6px;
    padding: 0;
    margin: 22px 0 0;
    list-style: none;
}

.project-pagination li a,
.project-pagination li span {
    display: inline-flex;
    min-width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--paktum-border);
    background: #fff;
    color: var(--paktum-sidebar);
    text-decoration: none;
    font-weight: 700;
}

.project-pagination li.active a,
.project-pagination li.active span {
    background: var(--paktum-sidebar);
    color: #fff;
    border-color: var(--paktum-sidebar);
}

.project-pagination li.disabled span {
    opacity: 0.45;
}

.case-hero-actions {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.case-rename-form {
    display: flex;
    gap: 8px;
}

.case-rename-input {
    height: 42px;
    min-width: 240px;
    border: 1px solid var(--paktum-border);
    border-radius: 14px;
    padding: 0 14px;
    font-weight: 700;
    color: var(--paktum-sidebar);
    background: #fff;
}

.case-rename-input:focus {
    outline: none;
    border-color: var(--paktum-accent);
    box-shadow: 0 0 0 4px rgba(214, 168, 95, 0.16);
}

.app-btn-danger-soft {
    background: #fff4f2;
    color: #9f2f24;
    border: 1px solid #ffd8d2;
}

.app-btn-danger-soft:hover {
    background: #ffe8e3;
    color: #84251d;
}

.case-archived-notice {
    background: #fff4f2;
    color: #9f2f24;
    border: 1px solid #ffd8d2;
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 700;
}

.project-row-card-static {
    cursor: default;
}

.project-row-card-static:hover {
    transform: none;
}

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

.app-btn-sm {
    padding: 8px 12px;
    font-size: 13px;
    min-height: auto;
}
/* PROJECT PAGE END */

/* BUYER PAGES START */
.buyer-create-page,
.buyer-edit-page {
    width: 100%;
}

.buyer-create-header,
.buyer-edit-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.buyer-create-kicker,
.buyer-edit-kicker {
    color: var(--paktum-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

.buyer-create-header h1,
.buyer-edit-header h1 {
    margin: 8px 0 10px;
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.buyer-create-header p {
    max-width: 700px;
    color: var(--paktum-muted);
}

.buyer-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.buyer-type-card-form {
    margin: 0;
}

.buyer-type-card {
    width: 100%;
    border: 1px solid var(--paktum-border);
    background: #fff;
    border-radius: 28px;
    padding: 28px;
    text-align: left;
    transition: 0.18s ease;
    cursor: pointer;
    box-shadow: var(--paktum-shadow);
}

.buyer-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.buyer-type-card.disabled {
    opacity: 0.65;
    cursor: default;
}

.buyer-type-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: rgba(214, 168, 95, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 18px;
}

.buyer-type-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.buyer-type-description {
    color: var(--paktum-muted);
    line-height: 1.5;
}

.buyer-type-action,
.buyer-type-soon {
    margin-top: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
}

.buyer-type-action {
    background: var(--paktum-sidebar);
    color: #fff;
}

.buyer-type-soon {
    background: #f3f4f6;
    color: var(--paktum-muted);
}

.buyer-create-footer {
    margin-top: 28px;
}

/* Legacy create/edit layout support */
.buyer-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
}

.buyer-form-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Current buyer edit layout */
.buyer-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 540px;
    gap: 20px;
    align-items: start;
}

.buyer-edit-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.buyer-edit-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-self: start;
    position: sticky;
    top: 24px;
}

.buyer-section-card,
.buyer-sidebar-card {
    background: #fff;
    border: 1px solid var(--paktum-border);
    border-radius: 28px;
    padding: 24px;
    box-shadow: var(--paktum-shadow);
}

.buyer-section-header {
    margin-bottom: 20px;
}

.buyer-section-header h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.03em;
}

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

.buyer-form .form-group {
    margin-bottom: 0;
}

.buyer-form label {
    font-weight: 700;
    margin-bottom: 8px;
}

.buyer-form input[type="text"],
.buyer-form input[type="email"],
.buyer-form input[type="tel"] {
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--paktum-border);
    padding: 0 14px;
    font-weight: 600;
}

.buyer-form input:focus {
    border-color: var(--paktum-accent);
    box-shadow: 0 0 0 4px rgba(214, 168, 95, 0.14);
}

.buyer-checkbox-row {
    margin-bottom: 20px;
}

.buyer-poa-fields {
    display: none;
}

.buyer-form-sidebar {
    align-self: start;
    position: sticky;
    top: 24px;
}

.buyer-sidebar-title {
    font-weight: 800;
    margin-bottom: 18px;
}

.buyer-save-btn,
.buyer-send-btn {
    width: 100%;
}

.buyer-send-btn {
    margin-top: 10px;
}

.buyer-documents-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.buyer-document-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.buyer-document-list-sidebar {
    gap: 10px;
    margin-top: 0;
}

.buyer-document-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

.buyer-document-card-sidebar {
    align-items: flex-start;
}

.buyer-document-card-compact {
    margin-top: 12px;
}

.buyer-document-preview {
    width: 64px;
    height: 46px;
    flex: 0 0 64px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}

.buyer-document-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.buyer-document-preview-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
}

.buyer-document-preview-pdf .buyer-document-preview-empty {
    color: #b91c1c;
    background: #fef2f2;
}

.buyer-document-left {
    flex: 1;
    min-width: 0;
}

.buyer-document-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 5px;
}

.buyer-document-existing,
.buyer-document-missing {
    font-size: 13px;
    color: #6b7280;
}

.buyer-document-link {
    display: inline-block;
    max-width: 185px;
    margin-left: 6px;
    color: #2563eb;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.buyer-document-link:hover {
    text-decoration: underline;
}

.buyer-document-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
}

.buyer-document-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.buyer-document-actions-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 9px;
}

.buyer-document-file-input {
    display: none;
}

.buyer-document-selected-file {
    max-width: 220px;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buyer-doc-placeholder {
    border: 1px dashed #d7cec0;
    border-radius: 20px;
    padding: 22px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.buyer-doc-placeholder-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(214, 168, 95, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.buyer-doc-placeholder strong {
    display: block;
    margin-bottom: 4px;
}

.buyer-doc-placeholder p {
    margin: 0;
    color: var(--paktum-muted);
}

.scan-phone-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .55);
}

.scan-phone-modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    border-radius: 18px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
}

.scan-phone-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.scan-phone-warning {
    padding: 12px;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
}

#scan-phone-qr {
    display: flex;
    justify-content: center;
    margin: 18px 0;
}

#scan-phone-link {
    display: block;
    color: #2563eb;
    font-size: 13px;
    word-break: break-all;
}

.buyer-delete-btn {
    width: 100%;
    margin-top: 10px;
}

.buyer-poa-actions {
    margin-top: 16px;
}

.buyer-poa-send-btn {
    min-width: 240px;
}

@media (max-width: 1100px) {
    .buyer-edit-layout {
        grid-template-columns: 1fr;
    }

    .buyer-edit-sidebar,
    .buyer-form-sidebar {
        position: static;
    }
}

@media (max-width: 1000px) {
    .buyer-form-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .buyer-form-grid {
        grid-template-columns: 1fr;
    }

    .buyer-create-header,
    .buyer-edit-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .buyer-create-header h1,
    .buyer-edit-header h1 {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    .buyer-document-card {
        align-items: flex-start;
    }

    .buyer-document-card-compact,
    .buyer-document-card-sidebar {
        flex-direction: column;
    }

    .buyer-documents-sidebar-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .buyer-document-right,
    .buyer-document-actions-inline {
        flex-wrap: wrap;
    }

    .buyer-document-link {
        max-width: 150px;
    }

    .buyer-document-selected-file {
        max-width: 100%;
    }
}

@media (max-width: 1100px) {
    .buyer-edit-sidebar {
        display: flex;
        flex-direction: column;
    }

    .buyer-edit-sidebar .buyer-sidebar-card:first-child {
        order: 2;
    }

    .buyer-edit-sidebar .buyer-sidebar-card:last-child {
        order: 1;
    }
}
/* BUYER PAGES END */

/* ERROR PAGE START */
.error-page {
    min-height: calc(100vh - 190px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.error-card {
    width: 100%;
    max-width: 620px;
    padding: 42px;
    border: 1px solid var(--paktum-border);
    border-radius: 32px;
    background:
            radial-gradient(circle at top right, rgba(214, 168, 95, 0.16), transparent 35%),
            #fff;
    box-shadow: var(--paktum-shadow);
    text-align: center;
}

.error-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 24px;
    background: rgba(214, 168, 95, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
}

.error-kicker {
    color: var(--paktum-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

.error-card h1 {
    margin: 10px 0 12px;
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.error-card p {
    margin: 0 auto 26px;
    max-width: 460px;
    color: var(--paktum-muted);
    font-size: 15px;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .error-card {
        padding: 30px 22px;
        border-radius: 24px;
    }

    .error-card h1 {
        font-size: 28px;
    }
}
/* ERROR PAGE END */

.app-sidebar-backdrop {
    display: none;
}

@media (max-width: 600px) {
    .login-card {
        padding: 28px;
        border-radius: 24px;
    }

    .login-title {
        font-size: 28px;
    }
}

@media (max-width: 900px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: 0.22s ease;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.18);
    }

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

    body.sidebar-open .app-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 15;
        background: rgba(15, 23, 42, 0.45);
    }

    .app-main {
        margin-left: 0;
    }

    .app-icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .app-topbar,
    .app-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .app-page-title {
        font-size: 28px;
    }
}