@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #eef3f8;
    color: #1f2937;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

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

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.08);
}

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

.sidebar-brand {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 0.3px;
}

.sidebar-profile-row {
    display: flex;
    gap: 10px;
    margin: 0 0 14px;
}

.sidebar-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, transform 0.2s ease;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-icon-link:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateX(2px);
    color: white;
}

.sidebar-icon-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.sidebar-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
    margin: 18px 10px 10px;
}

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

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.92);
    padding: 12px 14px;
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.2s ease;
    font-weight: 500;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
    color: white;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.content-area {
    flex: 1;
    min-width: 0;
    padding: 32px;
}

.page {
    max-width: 1200px;
}

.page-narrow {
    max-width: 900px;
}

.page-small {
    max-width: 700px;
}

.page-wide {
    max-width: 1400px;
}

.card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    margin-bottom: 24px;
}

h1, h2 {
    margin-top: 0;
    color: #111827;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.btn,
button {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: white;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}

.btn:hover,
button:hover {
    opacity: 0.95;
}

.btn-secondary {
    background: white;
    color: #2563eb;
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.btn-create {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
}

.btn-create:hover {
    opacity: 0.95;
}

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

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

.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.table-pagination-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-pagination-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.table-pagination-select {
    min-width: 88px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
}

.table-pagination-summary {
    font-size: 13px;
    color: #6b7280;
}

.table-pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.table-pagination-page,
.table-pagination-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.table-pagination-page.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.table-pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: #64748b;
    font-weight: 700;
}

.table-pagination-nav:disabled {
    opacity: 0.45;
    cursor: default;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

th {
    background: #eef4ff;
    color: #1f2937;
    font-weight: bold;
    white-space: nowrap;
}

th, td {
    border: 1px solid #dbe3ef;
    padding: 12px 14px;
    text-align: left;
    vertical-align: middle;
}

td.number {
    text-align: right;
    white-space: nowrap;
}

.actions-cell {
    white-space: nowrap;
}

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

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

.form-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

label {
    font-weight: bold;
    color: #374151;
}

input, select, textarea {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    font-family: Arial, sans-serif;
}

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

.error-box {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

.warning-box {
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

.info-box {
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

.back-link {
    display: inline-block;
    margin-top: 8px;
    color: #2563eb;
    text-decoration: none;
    font-weight: bold;
}

.meta-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    row-gap: 14px;
    column-gap: 16px;
    align-items: center;
}

.meta-label {
    font-weight: bold;
    color: #4b5563;
}

.section-title {
    margin-bottom: 8px;
}

.section-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.summary-card {
    max-width: 420px;
    margin-top: 20px;
}

.summary-table td:first-child {
    font-weight: bold;
    width: 60%;
}

.summary-total td {
    font-size: 18px;
    font-weight: bold;
    background: #f8fbff;
}

.offer-line {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 8px;
}

.offer-number {
    font-weight: bold;
}

.notes-cell {
    min-width: 220px;
    white-space: pre-wrap;
}

.price-info {
    margin-top: 4px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f8ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 12px;
    color: #1e3a8a;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.autocomplete-input-wrap {
    position: relative;
    width: 100%;
}

.autocomplete-input-wrap input {
    width: 100%;
    padding-right: 42px;
}

.autocomplete-clear {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    box-shadow: none;
    text-decoration: none;
    opacity: 1;
    cursor: pointer;
}

.autocomplete-clear:hover {
    background: #e5edf7;
    color: #1f2937;
}

.date-picker-wrap {
    position: relative;
    width: 100%;
}

.date-picker-wrap input[type="text"] {
    width: 100%;
    padding-right: 42px;
}

.date-picker-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    font-size: 16px;
    box-shadow: none;
}

.date-picker-trigger:hover {
    background: #e5edf7;
    color: #1f2937;
}

.date-picker-native {
    position: absolute;
    inset: auto;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    padding: 0;
}

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

.offer-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    padding: 28px;
    margin-bottom: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #60a5fa 100%);
    color: white;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.22);
}

.offer-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.offer-hero-title {
    margin: 0 0 10px 0;
    font-size: 34px;
    line-height: 1.1;
    color: white;
}

.offer-hero-subtitle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: rgba(255, 255, 255, 0.92);
    font-size: 15px;
}

.offer-hero-subtitle a {
    color: white;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.offer-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.offer-hero .btn-secondary {
    background: rgba(255, 255, 255, 0.16);
    color: white;
    border-color: rgba(255, 255, 255, 0.26);
}

.offer-hero .btn-danger {
    background: rgba(220, 38, 38, 0.95);
    border-color: rgba(220, 38, 38, 0.95);
}

.offer-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
    gap: 24px;
    margin-bottom: 24px;
}

.offer-meta-card,
.offer-summary-panel,
.modern-form-card {
    margin-bottom: 0;
}

.offer-summary-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.summary-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #e5edf7;
    gap: 12px;
}

.summary-metric:last-child {
    border-bottom: none;
}

.summary-metric span {
    color: #4b5563;
    font-weight: 600;
}

.summary-metric strong {
    font-size: 18px;
    color: #111827;
}

.summary-metric-total {
    margin-top: 8px;
    padding-top: 18px;
}

.summary-metric-total strong {
    font-size: 28px;
    color: #2563eb;
}

.selection-preview {
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe3ef;
}

.selection-preview-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 8px;
}

.selection-preview-text {
    color: #111827;
    font-weight: 500;
    line-height: 1.5;
}

.list-header-block {
    margin-bottom: 0;
}

.muted-text {
    color: #6b7280;
}

.document-section-card {
    margin-bottom: 24px;
}

.document-title {
    margin: 0;
}

.document-client-link {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 18px;
    font-weight: 600;
}

.document-meta-stack {
    display: grid;
    gap: 16px;
}

.document-card-header {
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 0;
    margin-bottom: 12px;
}

.document-actions-inline {
    display: flex;
    align-items: end;
    gap: 10px;
    margin: 0;
}

.document-actions-inline .form-field {
    min-width: 220px;
    gap: 4px;
}

.document-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stock-shortage-popover {
    position: relative;
}

.stock-shortage-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #fdba74;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
}

.stock-shortage-summary::-webkit-details-marker {
    display: none;
}

.stock-shortage-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 20;
    width: min(420px, calc(100vw - 64px));
    padding: 14px;
    border: 1px solid #fdba74;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

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

.stock-shortage-item {
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.stock-shortage-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.stock-shortage-product {
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.stock-shortage-meta {
    display: grid;
    gap: 4px;
    color: #6b7280;
    font-size: 13px;
}

.document-date-field {
    margin-bottom: 12px;
}

.document-date-picker {
    max-width: 180px;
}

.actions-compact {
    margin-top: 0;
}

.document-pdf-stack {
    display: grid;
    gap: 16px;
}

.document-pdf-file-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.document-empty-note {
    color: #6b7280;
}

.stock-state-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid currentColor;
}

.stock-state-available {
    background: #dcfce7;
    color: #166534;
}

.stock-state-pending {
    background: #fff7ed;
    color: #9a3412;
}

.stock-state-empty {
    background: #f3f4f6;
    color: #4b5563;
}

.stock-totals-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.stock-total-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.stock-total-badge-allocated {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.stock-total-badge-available {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid currentColor;
}

.status-credit {
    background-image: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 50%, #ffffff 100%);
    color: #6d28d9;
}

.status-offer {
    background-image: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, #ffffff 100%);
    color: #1d4ed8;
}

.status-won {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    color: #166534;
}

.status-lost {
    background-image: linear-gradient(90deg, #fee2e2 0%, #fef2f2 50%, #ffffff 100%);
    color: #b91c1c;
}

.status-archived {
    background-image: linear-gradient(90deg, #f3f4f6 0%, #f9fafb 50%, #ffffff 100%);
    color: #4b5563;
}

.status-deleted {
    background-image: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 50%, #ffffff 100%);
    color: #6d28d9;
}

.status-draft {
    background-image: linear-gradient(90deg, #f3f4f6 0%, #f9fafb 50%, #ffffff 100%);
    color: #4b5563;
}

.status-sent {
    background-image: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, #ffffff 100%);
    color: #1d4ed8;
}

.status-accepted {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    color: #166534;
}

.status-paid {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    color: #166534;
}

.status-returned {
    background-image: linear-gradient(90deg, #fee2e2 0%, #fef2f2 50%, #ffffff 100%);
    color: #b91c1c;
}

.status-declined {
    background-image: linear-gradient(90deg, #fee2e2 0%, #fef2f2 50%, #ffffff 100%);
    color: #b91c1c;
}

.status-delivered {
    background-image: linear-gradient(90deg, #fef3c7 0%, #fffbeb 50%, #ffffff 100%);
    color: #b45309;
}

.project-status-card {
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.project-status-offer {
    background-image: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, #ffffff 100%);
    border-color: #bfdbfe;
}

.project-status-won {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    border-color: #bbf7d0;
}

.project-status-lost {
    background-image: linear-gradient(90deg, #fee2e2 0%, #fef2f2 50%, #ffffff 100%);
    border-color: #fecaca;
}

.project-status-archived {
    background-image: linear-gradient(90deg, #f3f4f6 0%, #f9fafb 50%, #ffffff 100%);
    border-color: #e5e7eb;
}

.project-status-deleted {
    background-image: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 50%, #ffffff 100%);
    border-color: #ddd6fe;
}

.offer-status-draft {
    background-image: linear-gradient(90deg, #f3f4f6 0%, #f9fafb 50%, #ffffff 100%);
    border-color: #e5e7eb;
}

.offer-status-sent {
    background-image: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, #ffffff 100%);
    border-color: #bfdbfe;
}

.offer-status-accepted {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    border-color: #bbf7d0;
}

.offer-status-declined {
    background-image: linear-gradient(90deg, #fee2e2 0%, #fef2f2 50%, #ffffff 100%);
    border-color: #fecaca;
}

.invoice-status-draft {
    background-image: linear-gradient(90deg, #f3f4f6 0%, #f9fafb 50%, #ffffff 100%);
    border-color: #e5e7eb;
}

.invoice-status-sent {
    background-image: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, #ffffff 100%);
    border-color: #bfdbfe;
}

.invoice-status-paid {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    border-color: #bbf7d0;
}

.invoice-status-returned {
    background-image: linear-gradient(90deg, #fee2e2 0%, #fef2f2 50%, #ffffff 100%);
    border-color: #fca5a5;
}

.purchase-status-draft {
    background-image: linear-gradient(90deg, #f3f4f6 0%, #f9fafb 50%, #ffffff 100%);
    border-color: #e5e7eb;
}

.purchase-status-sent {
    background-image: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, #ffffff 100%);
    border-color: #bfdbfe;
}

.purchase-status-paid {
    background-image: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 50%, #ffffff 100%);
    border-color: #c4b5fd;
}

.purchase-status-delivered {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    border-color: #bbf7d0;
}

.status-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-inline-form {
    margin: 0;
}

.status-select {
    min-width: 110px;
    padding: 6px 28px 6px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-align-last: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select.status-select.status-offer {
    background-image: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, #ffffff 100%);
    color: #1d4ed8;
    border-color: currentColor;
}

select.status-select.status-won {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    color: #166534;
    border-color: currentColor;
}

select.status-select.status-lost {
    background-image: linear-gradient(90deg, #fee2e2 0%, #fef2f2 50%, #ffffff 100%);
    color: #b91c1c;
    border-color: currentColor;
}

select.status-select.status-archived {
    background-image: linear-gradient(90deg, #f3f4f6 0%, #f9fafb 50%, #ffffff 100%);
    color: #4b5563;
    border-color: currentColor;
}

select.status-select.status-deleted {
    background-image: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 50%, #ffffff 100%);
    color: #6d28d9;
    border-color: currentColor;
}

select.status-select.status-draft {
    background-image: linear-gradient(90deg, #f3f4f6 0%, #f9fafb 50%, #ffffff 100%);
    color: #4b5563;
    border-color: currentColor;
}

select.status-select.status-sent {
    background-image: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, #ffffff 100%);
    color: #1d4ed8;
    border-color: currentColor;
}

select.status-select.status-accepted {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    color: #166534;
    border-color: currentColor;
}

select.status-select.status-paid {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    color: #166534;
    border-color: currentColor;
}

select.status-select.status-declined {
    background-image: linear-gradient(90deg, #fee2e2 0%, #fef2f2 50%, #ffffff 100%);
    color: #b91c1c;
    border-color: currentColor;
}

select.status-select.status-delivered {
    background-image: linear-gradient(90deg, #fef3c7 0%, #fffbeb 50%, #ffffff 100%);
    color: #b45309;
    border-color: currentColor;
}

select.status-select.purchase-status-paid {
    background-image: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 50%, #ffffff 100%);
    color: #6d28d9;
    border-color: currentColor;
}

select.status-select.purchase-status-delivered {
    background-image: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 50%, #ffffff 100%);
    color: #166534;
    border-color: currentColor;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #60a5fa 100%);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo {
    font-weight: bold;
    font-size: 20px;
    margin-bottom: 10px;
    color: #2563eb;
}

.auth-header h1 {
    margin: 0;
    font-size: 24px;
}

.auth-header p {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.full-width-btn {
    width: 100%;
    margin-top: 8px;
}

.auth-error {
    margin-top: 16px;
    padding: 12px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    text-align: center;
}

.auth-success {
    margin-top: 16px;
    padding: 12px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #065f46;
    text-align: center;
}

.section-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.quick-product-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.quick-product-modal.open {
    display: block;
}

.quick-product-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.quick-product-modal__dialog {
    position: relative;
    width: min(720px, calc(100vw - 32px));
    margin: 40px auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    padding: 24px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.quick-product-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.quick-product-modal__header h3 {
    margin: 0;
}

.quick-product-modal__form .actions {
    margin-top: 20px;
    justify-content: flex-end;
}

.client-analytics-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.client-analytics-kpi {
    padding: 16px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #f8fbff;
}

.client-analytics-kpi-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.client-analytics-kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.client-analytics-chart-legend {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.client-analytics-chart-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 6px;
}

.client-analytics-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 20px;
    padding: 18px 16px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
}

.client-analytics-chart-col {
    min-width: 0;
}

.client-analytics-chart-bars {
    height: 180px;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 6px;
}

.client-analytics-chart-bar {
    width: 16px;
    min-height: 6px;
    border-radius: 999px 999px 6px 6px;
}

.client-analytics-chart-bar-revenue {
    background: #3b82f6;
}

.client-analytics-chart-bar-profit {
    background: #22c55e;
}

.client-analytics-chart-label {
    margin-top: 8px;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}

.search-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.search-card-header h1 {
    margin: 0;
}

.search-card-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.search-card-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
}

.search-card-body {
    display: block;
}

.search-card-body.collapsed {
    display: none;
}

@media (max-width: 980px) {
    .client-analytics-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-analytics-chart {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .client-analytics-kpis {
        grid-template-columns: 1fr;
    }

    .client-analytics-chart {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 18px;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .content-area {
        padding: 20px;
    }

    .form-grid,
    .form-grid-3,
    .offer-top-grid {
        grid-template-columns: 1fr;
    }

    .document-header-left,
    .document-actions-inline {
        width: 100%;
    }

    .stock-shortage-panel {
        left: 0;
        right: auto;
        width: min(100%, calc(100vw - 64px));
    }

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

    .offer-hero {
        flex-direction: column;
        padding: 22px;
    }

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

    .offer-hero-title {
        font-size: 28px;
    }
}
