@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

/* SM-Offer — app styling */

:root {
    /* Brand: green (primary), blue (UI/links), black (text) */
    --brand-green: #059669;
    --brand-green-hover: #047857;
    --brand-green-soft: rgba(5, 150, 105, 0.12);
    --brand-blue: #2563eb;
    --brand-blue-hover: #1d4ed8;
    --primary-color: #2563eb;
    --primary-hover: #1e40af;
    --secondary-color: #475569;
    --success-color: #059669;
    --danger-color: #ef4444;
    --text-color: #0f172a;
    --text-light: #64748b;
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --bg-muted: #ecfdf5;
    --border-color: #e2e8f0;
    --shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --font-sans: "DM Sans", "Segoe UI", Tahoma, sans-serif;
    --font-display: "Space Grotesk", "Segoe UI", Tahoma, sans-serif;
    --card-border: rgba(148, 163, 184, 0.25);
}

* {
    box-sizing: border-box;
}

/* Proposal / template section text: plain paragraphs + markdown-style lists */
.proposal-rich-body {
    line-height: 1.55;
}
.proposal-rich-body .proposal-rich-text {
    margin: 0 0 0.75rem 0;
}
.proposal-rich-body .proposal-rich-list {
    margin: 0 0 0.75rem 0;
    padding-left: 1.35rem;
}
.proposal-rich-body ul.proposal-rich-list {
    list-style-type: disc;
}
.proposal-rich-body ol.proposal-rich-list {
    list-style-type: decimal;
}
.proposal-rich-body .proposal-rich-list li {
    margin: 0.25rem 0;
}
.proposal-rich-body .proposal-rich-text:last-child,
.proposal-rich-body .proposal-rich-list:last-child {
    margin-bottom: 0;
}

/* Sanitized HTML from TinyMCE (offers, PDF, public views) */
.proposal-rich-html {
    line-height: 1.55;
    font-size: inherit;
    color: inherit;
}
.proposal-rich-html p {
    margin: 0 0 0.75rem 0;
}
.proposal-rich-html p:last-child {
    margin-bottom: 0;
}
.proposal-rich-html ul,
.proposal-rich-html ol {
    margin: 0 0 0.75rem 0;
    padding-left: 1.35rem;
}
.proposal-rich-html li {
    margin: 0.25rem 0;
}
.proposal-rich-html a {
    color: var(--brand-blue, #2563eb);
    text-decoration: underline;
}
.proposal-rich-html table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.75rem 0;
    font-size: 0.95em;
}
.proposal-rich-html th,
.proposal-rich-html td {
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 0.45rem 0.65rem;
    vertical-align: top;
}
.proposal-rich-html h1,
.proposal-rich-html h2,
.proposal-rich-html h3,
.proposal-rich-html h4 {
    margin: 0 0 0.5rem 0;
    line-height: 1.25;
    font-weight: 600;
}
.proposal-rich-html h1 {
    font-size: 1.35rem;
}
.proposal-rich-html h2 {
    font-size: 1.2rem;
}
.proposal-rich-html h3 {
    font-size: 1.05rem;
}
.proposal-rich-html h4 {
    font-size: 1rem;
}
.proposal-rich-html blockquote {
    margin: 0.75rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--border-color, #e2e8f0);
    color: var(--text-light, #64748b);
}
.proposal-rich-html img {
    max-width: 100%;
    height: auto;
}

/* Proposal section editors: insert bullet / numbered line */
.proposal-text-field-wrap {
    width: 100%;
}
.proposal-text-field-wrap textarea {
    width: 100%;
    box-sizing: border-box;
}
.proposal-text-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.35rem;
}
.proposal-text-tools__btn {
    font-size: 0.8125rem;
    padding: 0.45rem 0.6rem;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    min-height: 2.6rem;
    /* Light chip: dark icons read clearly (avoids faint white-on-slate at tiny size) */
    background: #fff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
    transform: none !important;
    width: auto !important;
}
.proposal-text-tools__btn:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1) !important;
}
.proposal-text-tools__btn:focus-visible {
    outline: 2px solid var(--brand-green, #059669);
    outline-offset: 2px;
}
.proposal-text-tools__icon {
    display: block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

body {
    font-family: var(--font-sans);
    color: var(--text-color);
    background: #e5e7eb;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: block;
    line-height: 0;
    text-decoration: none;
}

.sidebar-logo .app-brand-logo {
    height: 40px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    display: block;
}

/* Top bar - language & logout in top right */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 2rem;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.top-bar-left {
    display: none;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-bar-right .lang-dropdown {
    position: relative;
}

.top-bar-right .lang-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
}

.top-bar-right .lang-dropdown-trigger:hover {
    background: var(--bg-muted);
    border-color: var(--secondary-color);
}

.top-bar-right .btn {
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-icon svg {
    width: 20px;
    height: 20px;
}

.sidebar-link:hover {
    background: var(--bg-muted);
    color: var(--primary-color);
}

.sidebar-link-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white !important;
    justify-content: center;
}

.sidebar-link-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-user {
    font-size: 0.85rem;
    color: var(--text-light);
}

.sidebar-footer .btn {
    margin: 0;
    width: 100%;
}

/* Layout main area */
.layout-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout-footer {
    margin-top: auto;
}

.lang-chevron {
    transition: transform 0.2s;
}

.lang-dropdown.open .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 140px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem 0;
    z-index: 100;
}

.lang-dropdown-menu.open {
    display: block;
}

.lang-dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.15s;
}

.lang-dropdown-item:hover {
    background: var(--bg-light);
}

.lang-dropdown-item.active {
    background: var(--brand-green-soft);
    color: var(--brand-green);
    font-weight: 600;
}

/* Main Container */
.main {
    flex: 1;
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem 1.75rem;
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(115deg, #ffffff 0%, #f1f5ff 45%, #e2e8ff 100%);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: "";
    position: absolute;
    inset: -30% 55% auto auto;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25), transparent 70%);
    filter: blur(2px);
}

.page-header::after {
    content: "";
    position: absolute;
    inset: auto auto -60% -10%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18), transparent 65%);
}

.page-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.page-subtitle {
    margin: 0.25rem 0 0 0;
    color: var(--text-light);
    font-size: 0.95rem;
    max-width: 520px;
    position: relative;
    z-index: 1;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-padding {
    padding: 2rem;
}

.card-compact {
    padding: 1.25rem;
}

.filter-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 70%, #ecfdf5 100%);
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    margin-bottom: 1.5rem;
}

.offers-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.offers-filters__top {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

.offers-filters__form {
    display: grid;
    grid-template-columns: minmax(220px, 320px) max-content;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

/* Clients index: search + type + country + actions */
.clients-filters__form {
    grid-template-columns: minmax(200px, 1fr) minmax(120px, 160px) minmax(140px, 220px) auto;
}

.offers-filters__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.offers-filters__actions .btn {
    width: auto;
    min-width: 90px;
}

.offers-filters__field select,
.offers-filters__field input {
    width: 100%;
}

.offers-filters__field label {
    font-size: 0.9rem;
    color: #475569;
}

.offers-filters__field select,
.offers-filters__field input {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.offers-filters__meta {
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    justify-content: flex-end;
}

.offers-count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.status-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
}

.status-tab:hover {
    color: var(--brand-blue);
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

.status-tab.is-active {
    background: var(--brand-blue);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.table-card.offers-table {
    padding: 0.5rem 0.75rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.status-tab--accepted.is-active {
    background: var(--success-color);
}

.status-tab--rejected.is-active {
    background: var(--danger-color);
}

.status-tab--draft.is-active {
    background: #64748b;
}

.status-tab--sent.is-active {
    background: var(--brand-blue);
}

.table-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.empty-state {
    background: var(--bg-color);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.company-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.company-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pill-success {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.pill-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.pill-neutral {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
}

.pill-info {
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
}

/* Auth Forms */
.auth-container {
    max-width: 450px;
    margin: 4rem auto;
    background: var(--bg-color);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.auth-container h1 {
    margin-top: 0;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-color);
    font-size: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* Buttons */
.btn,
button[type="submit"],
input[type="submit"] {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid rgba(5, 150, 105, 0.45);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    width: 100%;
    box-shadow: 0 12px 22px rgba(5, 150, 105, 0.22);
}

.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(5, 150, 105, 0.28);
}

.btn-secondary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-color: rgba(71, 85, 105, 0.35);
    box-shadow: 0 10px 20px rgba(51, 65, 85, 0.2);
}

.btn-secondary:hover {
    background-color: #334155;
    box-shadow: 0 12px 24px rgba(51, 65, 85, 0.25);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.26);
}

/* Flash Messages */
.message {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.message.success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.message.info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Full-page auth layout (login) */
.auth-body {
    margin: 0;
    min-height: 100vh;
    background: #fff;
}

.auth-lang-bar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding: 0.85rem 1.25rem;
    font-size: 0.8125rem;
}

.auth-lang-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
}

.auth-lang-link:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.auth-lang-link.active {
    color: var(--brand-green);
    font-weight: 600;
}

.auth-split {
    display: flex;
    min-height: 100vh;
}

.auth-split-brand {
    flex: 0 0 40%;
    max-width: 540px;
    min-width: 260px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
    border-right: 1px solid var(--border-color);
}

.auth-split-brand-inner {
    text-align: center;
    width: 100%;
}

.auth-split-logo-img {
    max-width: min(300px, 85%);
    height: auto;
    display: block;
    margin: 0 auto;
}

.auth-split-wordmark {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.auth-split-tagline {
    margin: 1rem 0 0;
    font-size: 0.95rem;
    color: var(--text-light);
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.45;
}

.auth-split-form-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 4vw, 3rem);
    background: #fff;
}

.auth-split-form-inner {
    width: 100%;
    max-width: 400px;
}

.auth-split-form-inner--register {
    max-width: 440px;
}

.auth-help-text {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.45;
}

.auth-split-header {
    margin-bottom: 2rem;
}

.auth-brand-inline {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.75rem;
}

.auth-split-title {
    margin: 0 0 0.5rem;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.auth-split-sub {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.auth-split-sub a {
    color: #0d9488;
    text-decoration: none;
    font-weight: 500;
}

.auth-split-sub a:hover {
    text-decoration: underline;
}

.auth-split-form-inner .form-group {
    margin-bottom: 1.25rem;
}

.auth-split-form-inner input[type="text"]:focus,
.auth-split-form-inner input[type="email"]:focus,
.auth-split-form-inner input[type="password"]:focus {
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}

.auth-split-form-inner .auth-footer-split {
    text-align: left;
    margin-top: 1.75rem;
    font-size: 0.9375rem;
}

.auth-split-form-inner .auth-footer-split a {
    color: #0d9488;
    font-weight: 500;
}

.auth-login-submit.auth-login-submit {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
    border: 1px solid rgba(13, 148, 136, 0.45);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 24px rgba(13, 148, 136, 0.22);
    color: #fff;
    font-weight: 600;
}

.auth-login-submit.auth-login-submit:hover {
    background: #0f766e;
    box-shadow: 0 12px 28px rgba(13, 148, 136, 0.28);
}

@media (max-width: 768px) {
    .auth-split {
        flex-direction: column;
    }

    .auth-split-brand {
        flex: none;
        max-width: none;
        min-height: 140px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 2rem 1.5rem;
    }

    .auth-split-tagline {
        display: none;
    }

    .auth-split-form-wrap {
        padding: 2rem 1.25rem 3rem;
        align-items: flex-start;
    }
}

/* Dashboard */
.dashboard-header {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.dashboard-hero {
    color: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-hero h1 {
    margin: 0;
    font-size: 2.2rem;
}

.dashboard-hero p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
}

.dashboard-actions .btn {
    width: auto;
}

.stat-card .stat-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-card .stat-meta span {
    font-size: 1rem;
}

.dashboard-panel {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dashboard-charts {
    margin-bottom: 2rem;
}

.dashboard-charts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.chart-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chart-canvas {
    height: 260px;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.accepted {
    background: var(--brand-green);
}

.legend-dot.pending {
    background: #f59e0b;
}

.dashboard-header h1 {
    margin: 0 0 0.5rem 0;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-green);
}

/* Tables */
table {
    width: 100%;
    background: var(--bg-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.offers-table table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    box-shadow: none;
    background: transparent;
    overflow: visible;
    width: 100%;
    table-layout: fixed;
}

.offers-table thead {
    background: transparent;
}

.offers-table th {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
    border-bottom: none;
    font-weight: 700;
    padding: 0.55rem 0.4rem 0.5rem;
    background: rgba(226, 232, 240, 0.6);
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    text-align: center;
    white-space: normal;
    line-height: 1.25;
    vertical-align: bottom;
    word-wrap: break-word;
    hyphens: auto;
}

.offers-table th .table-head-link,
.offers-table th .table-head-label {
    display: inline;
    padding: 0 0 0.2rem;
    background: transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
    color: #475569;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 auto;
    white-space: normal;
}

.offers-table th .table-head-sort {
    display: inline-block;
    border-bottom: none;
    text-decoration: none !important;
    color: #475569 !important;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.4rem;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    cursor: default;
    white-space: normal;
    line-height: 1.2;
    max-width: 100%;
    text-align: center;
    vertical-align: bottom;
    font-weight: 700;
    text-transform: uppercase;
}

.offers-table th .table-head-sort:hover {
    color: #475569 !important;
    border-bottom-color: transparent;
    border-color: rgba(148, 163, 184, 0.55);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.offers-table th .table-head-sort:visited,
.offers-table th .table-head-sort:focus,
.offers-table th .table-head-sort:active {
    color: #475569 !important;
    text-decoration: none !important;
}

.offers-table th .table-head-link:hover {
    color: #1d4ed8;
    border-bottom-color: rgba(29, 78, 216, 0.6);
}

.offers-table th a {
    color: #475569 !important;
    text-decoration: none !important;
}

.offers-table th:not(.actions),
.offers-table td:not(.actions) {
    min-width: 0;
}

.offers-table td {
    border-bottom: none;
    padding: 0.65rem 0.45rem;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.offers-table tbody tr {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.offers-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.offers-table tbody tr td:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.offers-table tbody tr td:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.offers-table th.actions {
    width: auto;
    min-width: 12rem;
    max-width: none;
    text-align: right;
}

.offers-table th.actions .table-head-label {
    display: inline-block;
    width: 100%;
    text-align: right;
}

.offers-table td.actions {
    text-align: right;
    vertical-align: middle;
    width: auto;
    min-width: 12rem;
    max-width: none;
    padding: 0.65rem 0.75rem;
}

.offers-table td.actions .offer-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.offers-table td.actions .offer-actions form {
    display: inline-flex;
    margin: 0;
    align-items: center;
}

/* Table row actions: clear targets, distinct roles, keyboard focus */
.offers-table td.actions .offer-actions a.btn-small,
.offers-table td.actions .offer-actions button.btn-small,
.offers-table td.actions .offer-actions input[type="submit"].btn-small {
    text-decoration: none;
    width: auto;
    min-height: 2.5rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 8px;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    cursor: pointer;
    transform: none;
}

.offers-table td.actions .offer-actions .btn-view {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.offers-table td.actions .offer-actions .btn-view:hover {
    background: #e2e8f0;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.offers-table td.actions .offer-actions .btn-edit {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.offers-table td.actions .offer-actions .btn-edit:hover {
    background: #dbeafe;
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.offers-table td.actions .offer-actions .btn-delete,
.offers-table td.actions .offer-actions input[type="submit"].btn-delete {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.offers-table td.actions .offer-actions .btn-delete:hover,
.offers-table td.actions .offer-actions input[type="submit"].btn-delete:hover {
    background: #fee2e2;
    color: #991b1b;
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.12);
}

.offers-table td.actions .offer-actions .btn-clone {
    background: #f5f3ff;
    color: #5b21b6;
    border-color: #ddd6fe;
}

.offers-table td.actions .offer-actions .btn-clone:hover {
    background: #ede9fe;
    color: #4c1d95;
    box-shadow: 0 2px 8px rgba(91, 33, 182, 0.12);
}

.offers-table td.actions .offer-actions a.btn-small:focus-visible,
.offers-table td.actions .offer-actions button.btn-small:focus-visible,
.offers-table td.actions .offer-actions input[type="submit"].btn-small:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

.offers-table td.actions .offer-actions .btn-delete:focus-visible,
.offers-table td.actions .offer-actions input[type="submit"].btn-delete:focus-visible {
    outline-color: #dc2626;
}

.offer-number {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-color);
    letter-spacing: 0.01em;
}

.offer-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

.offer-client {
    font-weight: 600;
}

.offer-total {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.05rem;
}

/* Page-level action groups (headers, etc.): keep default .btn look */
.offer-actions {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.offer-actions form {
    display: inline-flex;
    margin: 0;
    align-items: center;
}

@media (max-width: 900px) {
    .offers-filters__top {
        grid-template-columns: 1fr;
    }

    .offers-filters__meta {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .offers-filters__form {
        grid-template-columns: 1fr;
    }

    .offers-filters__actions {
        justify-content: flex-start;
    }
}

thead {
    background-color: var(--bg-light);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: var(--bg-muted);
}

/* Footer */
footer {
    background: #0f172a;
    border-top: 1px solid #1e293b;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: -1;
    }

    .top-bar {
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }

    .top-bar-left {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .top-bar .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        background: var(--bg-light);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        cursor: pointer;
        color: var(--text-color);
    }

    .top-bar .sidebar-toggle:hover {
        background: var(--bg-muted);
    }

    .top-bar-logo {
        display: flex;
        align-items: center;
        line-height: 0;
        text-decoration: none;
    }

    .top-bar-logo .app-brand-logo {
        height: 32px;
        width: auto;
        max-width: 200px;
        object-fit: contain;
        display: block;
    }

    .layout-main {
        margin-left: 0;
    }

    .auth-container {
        margin: 2rem 1rem;
        padding: 2rem 1.5rem;
    }

    .container {
        padding: 0 1rem;
    }
}

/* —— Pagination: grouped controls, current page highlighted —— */
.pagination-wrapper {
    margin-top: 2rem;
    text-align: center;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    width: 100%;
}

.pagination-bar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    list-style: none;
    margin: 0 0 0.85rem 0;
    padding: 0;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.pagination-bar > li {
    display: flex;
    margin: 0;
}

.pagination-bar > li + li {
    border-left: 1px solid rgba(148, 163, 184, 0.4);
}

.pagination-bar > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.5rem 0.95rem;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pagination-bar > li > a:hover {
    background: #f1f5f9;
    color: var(--brand-blue);
}

.pagination-bar > li > a:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: -2px;
    z-index: 1;
}

/* Current page */
.pagination-bar li.active > a {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    cursor: default;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.pagination-bar li.active > a:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
}

/* Disabled prev/next */
.pagination-bar li.disabled > a {
    color: #94a3b8;
    background: #f8fafc;
    pointer-events: none;
    cursor: not-allowed;
}

.pagination-bar li.disabled > a:hover {
    color: #94a3b8;
    background: #f8fafc;
}

.pagination-bar li.ellipsis {
    display: inline-flex;
    align-items: center;
    padding: 0 0.65rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.875rem;
    user-select: none;
}

.pagination-meta {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

@media (max-width: 520px) {
    .pagination-bar > li > a {
        padding: 0.5rem 0.65rem;
        font-size: 0.8125rem;
    }
}
