﻿:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --line: #dde3ee;
    --text: #1c2431;
    --muted: #6a7485;
    --accent: #0f62fe;
    --sidebar: #0e1a2b;
    --sidebar-text: #e5ecff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--bg);
}

body.sidebar-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(560px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(15, 25, 40, 0.08);
}

.install-card {
    width: min(920px, 100%);
}

h1, h2, h3, p {
    margin: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 24px;
}

h2 {
    margin-top: 24px;
    margin-bottom: 10px;
    font-size: 18px;
}

h3 {
    margin-top: 14px;
    margin-bottom: 8px;
    font-size: 15px;
}

.muted {
    color: var(--muted);
}

.stack {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

label.inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

input,
textarea,
select {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.btn {
    border: 0;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    padding: 11px 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.mini {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
}

.mini.danger {
    border-color: #fecaca;
    color: #b91c1c;
}

.mini-muted {
    border-color: #d7deea;
    background: #f3f6fb;
    color: #5f6b7a;
}

.alert {
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 12px;
}

.alert.error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    background: var(--sidebar);
    color: var(--sidebar-text);
    padding: 18px;
}

.mobile-nav-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 120;
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid #c8d5ec;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    color: #15345f;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-nav-toggle svg {
    width: 22px;
    height: 22px;
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 109;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.brand img,
.logo-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    background: #1f3352;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.brand small {
    display: block;
    color: #adc1e8;
    margin-top: 2px;
}

.menu {
    display: grid;
    gap: 6px;
}

.menu a {
    padding: 10px 12px;
    border-radius: 8px;
    color: #d6e3ff;
}

.menu a.active,
.menu a:hover {
    background: #23406d;
}

.menu a.active {
    border-left: 3px solid #8fb5ff;
    padding-left: 9px;
}

.content {
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.userbox {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dbe8ff;
    color: #0c2450;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.userbox small {
    display: block;
    color: var(--muted);
}

.userbox .link {
    color: var(--accent);
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #d9e4f5;
    background: #ffffff;
    border-radius: 14px;
    padding: 6px 10px 6px 6px;
    cursor: pointer;
    color: var(--text);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.user-menu-toggle:hover {
    background: #f8fbff;
}

.user-menu-meta {
    display: grid;
    text-align: left;
}

.user-menu-caret {
    color: #6b7280;
    font-size: 12px;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    display: none;
    background: #ffffff;
    border: 1px solid #d8e1ef;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    padding: 8px;
    z-index: 130;
}

.userbox.open .user-menu-dropdown {
    display: grid;
}

.user-menu-dropdown a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: #1f2937;
}

.user-menu-dropdown a:hover {
    background: #f4f7fb;
}

.user-menu-dropdown a.danger-link {
    color: #b91c1c;
}

.userbox .link-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #cfe0ff;
    background: #f4f8ff;
    font-size: 16px;
    line-height: 1;
    font-weight: 600;
}

.userbox .link-icon:hover {
    background: #e3edff;
}

.userbox .link-icon svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.cards {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.cards article,
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
}

.panel.success {
    margin-top: 14px;
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.panel.warning {
    margin-top: 14px;
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.panel.error-block {
    margin-top: 14px;
    border-color: #fecaca;
    background: #fff1f2;
    color: #9f1239;
    display: grid;
    gap: 6px;
}

.cards h3 {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.cards p {
    margin-top: 8px;
    font-size: 14px;
    font-weight: normal;
    margin-left: -71px;
    display: inline-block;
    color: #a9a5a0;
}

.panel {
    margin-top: 14px;
}

.panel p {
    margin-top: 8px;
}

.quote-editor {
    margin-top: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
}

.tabs {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0 12px;
    margin-bottom: 12px;
    background: var(--card);
}

.tab {
    border: 1px solid var(--line);
    background: #f8fafc;
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
}

.tab.is-active {
    background: #e8f0ff;
    border-color: #bfd3ff;
    color: #0c3b9a;
}

.tab-panel {
    display: none;
    gap: 12px;
}

.tab-panel.is-active {
    display: grid;
}

.share-block {
    display: none;
    border: 1px dashed var(--line);
    border-radius: 10px;
    padding: 10px;
}

.share-block.show {
    display: grid;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.line-items {
    width: 100%;
    border-collapse: collapse;
}

.line-items th,
.line-items td {
    border-bottom: 1px solid var(--line);
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.line-items input {
    width: 100%;
}

#lineItemsTable thead th {
    position: sticky;
    top: 58px;
    z-index: 8;
    background: #f8fafc;
}
.line-items.compact th,
.line-items.compact td {
    font-size: 13px;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.totals {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 10px;
}

.preview-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

.preview-totals {
    margin-top: 10px;
}

.actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid2,
    .calc-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: auto;
    }
}

.install-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.install-brand img {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}

.driver-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.driver-option {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    display: grid;
    gap: 6px;
    background: #fff;
    cursor: pointer;
}

.driver-option input {
    margin: 0;
    width: auto;
}

.driver-option strong {
    font-size: 14px;
}

.driver-option small {
    color: var(--muted);
}

.driver-option.active {
    border-color: #9bb8ff;
    background: #edf3ff;
}

.driver-section {
    display: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    margin-top: 8px;
    background: #fafcff;
}

.driver-section.show {
    display: grid;
    gap: 10px;
}

@media (max-width: 900px) {
    .driver-grid {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none;
}

#basePathCustom {
    margin-top: 8px;
}

.table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-weight: 600;
    background: #f8faff;
}

.badge {
    display: inline-block;
    border: 1px solid #c7d8ff;
    background: #eef3ff;
    color: #23407a;
    border-radius: 999px;
    font-size: 16px;
    padding: 2px 8px;
}

.bulk-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.data-table .right {
    text-align: right;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    margin-left: 4px;
    text-decoration: none;
    font-size: 14px;
}

.icon-btn.edit {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.icon-btn.delete {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff1f2;
}

.menu-heading {
    margin-top: 10px;
    padding: 8px 10px 4px;
    font-size: 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.menu a.sub {
    margin-left: 10px;
}

.table-tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.table-search {
    width: min(360px, 100%);
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable.is-sorted {
    color: #1d4ed8;
}

.action-icons {
    white-space: nowrap;
}

.icon-btn.pdf {
    color: #0369a1;
    border-color: #bae6fd;
    background: #e0f2fe;
}

.icon-btn.disabled,
.menu-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.icon-btn.disabled {
    color: #64748b;
    border-color: #d7deea;
    background: #f8fafc;
}

.menu-disabled {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    color: #9fb2d5;
    background: rgba(255, 255, 255, 0.04);
}

.with-tip {
    position: relative;
    z-index: 20;
}

.with-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) translateX(-4px);
    background: rgba(10, 10, 12, 0.96);
    color: #ffffff;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 9999;
}

.with-tip::before {
    content: '';
    position: absolute;
    left: calc(100% + 1px);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: rgba(10, 10, 12, 0.96);
    opacity: 0;
    transition: opacity .18s ease;
    z-index: 10000;
}

.with-tip:hover::after,
.with-tip:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.action-icons .with-tip::after {
    left: auto;
    right: calc(100% + 12px);
    transform: translateY(-50%) translateX(4px);
}

.action-icons .with-tip::before {
    left: auto;
    right: calc(100% + 1px);
    border-right-color: transparent;
    border-left-color: rgba(10, 10, 12, 0.96);
}

.action-icons .with-tip:hover::after,
.action-icons .with-tip:hover::before {
    transform: translateY(-50%) translateX(0);
}


.menu-toggle {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 10px 12px;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
}

.menu-toggle::after {
    content: '\25BE';
    float: right;
    font-size: 30px;
    line-height: 1;
    transform: rotate(-90deg);
    transition: transform .2s ease;
}

.menu-toggle.open::after {
    transform: rotate(0deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .2s ease;
}

.submenu.open {
    max-height: 240px;
}

.icon-btn.mail {
    color: #0f766e;
    border-color: #99f6e4;
    background: #ecfeff;
}

.icon-btn.whatsapp {
    color: #15803d;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.text-action-link {
    border: 0;
    background: transparent;
    color: #0f62fe;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-right: 8px;
}

.text-action-link[disabled] {
    opacity: 0.55;
    cursor: wait;
}

/* submenu layout fix: stack items vertically */
.menu a,
.submenu a {
    display: block;
    width: 100%;
}

.submenu {
    display: grid;
    gap: 6px;
    padding-left: 8px;
}


.mail-switches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 6px;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8faff;
}

.company-pdf-name-toggle {
    align-self: end;
    min-height: 44px;
    padding: 7px 12px;
    border-radius: 8px;
}

.switch-row-wide {
    grid-column: 1 / -1;
}

.grid-span-2 {
    grid-column: 1 / -1;
}

.switch-text {
    font-size: 14px;
    color: var(--text);
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.switch-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}

.switch input:checked + .switch-slider {
    background: #0f62fe;
}

.switch input:checked + .switch-slider::before {
    transform: translateX(20px);
}

.switch input:focus-visible + .switch-slider {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.copy-mail-box,
.swal-copy-box {
    display: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #f8fbff;
}

.copy-mail-box.show,
.swal-copy-box.show {
    display: block;
}

.integration-note-panel {
    margin-top: 0;
}

.integration-settings-grid.integration-disabled {
    opacity: 0.58;
}

.integration-mode-row {
    align-items: stretch;
}

.integration-info-card {
    display: grid;
    gap: 6px;
    align-content: start;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcff;
}

.integration-manual-box {
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: #fbfcff;
}

.integration-help-ghost {
    visibility: hidden;
}

.form-actions-inline {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.switch-inline-panel {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}

.switch-row-inline {
    margin: 0;
    height: 100%;
}

.copy-mail-box-inline {
    margin: 0;
}

@media (max-width: 900px) {
    .mail-switches {
        grid-template-columns: 1fr;
    }

    .switch-row-wide {
        grid-column: auto;
    }

    .switch-inline-panel {
        grid-template-columns: 1fr;
    }
}








/* quote editor numeric alignment + compact inputs */
.quote-editor input,
.quote-editor textarea,
.quote-editor select {
    padding: 8px 10px;
}

#lineItemsTable th:nth-child(1),
#lineItemsTable td:nth-child(1) {
    width: 52%;
}

#lineItemsTable th:nth-child(2),
#lineItemsTable td:nth-child(2) {
    width: 9%;
    min-width: 84px;
}

#lineItemsTable th:nth-child(2),
#lineItemsTable th:nth-child(3),
#lineItemsTable th:nth-child(4),
#lineItemsTable td:nth-child(2),
#lineItemsTable td:nth-child(3),
#lineItemsTable td:nth-child(4) {
    text-align: right;
}

#lineItemsTable td:nth-child(2) input,
#lineItemsTable td:nth-child(3) input,
#lineItemsTable td:nth-child(4) input,
.line-items .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.totals.totals-right,
.preview-totals.totals-right {
    margin-left: auto;
    width: min(380px, 100%);
}

.totals-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
}

.totals-row strong {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    text-align: right;
}

.preview-card {
    background: #fcfdff;
}

.preview-header-box {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    line-height: 1.45;
}

.preview-header-box strong {
    display: block;
    margin-bottom: 2px;
}

.product-search {
    position: relative;
    z-index: 6;
}

.product-search-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 70;
    display: grid;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    min-width: 100%;
    border: 1px solid #cfe0ff;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14);
}

.product-search-menu[hidden] {
    display: none !important;
}

.product-search-item {
    width: 100%;
    border: 1px solid #dbe5f3;
    border-radius: 10px;
    background: #f8fbff;
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}

.product-search-item:hover {
    border-color: #bfd3ff;
    background: #eef4ff;
}

.product-search-item.empty {
    cursor: default;
    color: #64748b;
    background: #fbfdff;
}

.product-search-name {
    display: block;
    font-weight: 600;
    color: #0f172a;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-search-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.product-search-price {
    font-size: 13px;
    font-weight: 700;
    color: #0f62fe;
    white-space: nowrap;
    text-align: right;
}

.product-search-meta {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-items,
.line-items td,
.line-items th,
.tab-panel,
.quote-editor {
    overflow: visible;
}

.pdf-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 80;
}

.pdf-modal.show {
    display: block;
}

.pdf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.pdf-modal-card {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100vw - 32px));
    height: min(88vh, 900px);
    margin: 16px auto;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    display: grid;
    grid-template-rows: auto 1fr;
}

.pdf-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #f8faff;
}

.pdf-modal-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#pdfPreviewFrame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #f1f5f9;
}

@media (max-width: 900px) {
    .pdf-modal-card {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        margin: 6px auto;
        border-radius: 10px;
    }
}


.dashboard-cards {
    margin-top: 18px;
}

.summary-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: start;
    gap: 14px;
    min-height: 126px;
    border: 1px solid transparent;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 16px 32px rgba(15, 25, 40, 0.08);
}

.summary-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.12;
    pointer-events: none;
}

.summary-card.draft {
    background: linear-gradient(135deg, #fff5ea 0%, #ffffff 72%);
    border-color: #f4d2b2;
}

.summary-card.draft::before {
    background: radial-gradient(circle at top right, #f1a669 0%, transparent 52%);
}

.summary-card.sent {
    background: linear-gradient(135deg, #fffbea 0%, #ffffff 72%);
    border-color: #efe3ab;
}

.summary-card.sent::before {
    background: radial-gradient(circle at top right, #d8b94e 0%, transparent 52%);
}

.summary-card.pending {
    background: linear-gradient(135deg, #f3fbe9 0%, #ffffff 72%);
    border-color: #cfe7b2;
}

.summary-card.pending::before {
    background: radial-gradient(circle at top right, #92c96e 0%, transparent 52%);
}

.summary-card.approved {
    background: linear-gradient(135deg, #eef9ee 0%, #ffffff 72%);
    border-color: #b9ddb9;
}

.summary-card.approved::before {
    background: radial-gradient(circle at top right, #5ea66f 0%, transparent 52%);
}

.summary-icon {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

.summary-card.draft .summary-icon {
    background: #fde8d5;
    color: #bc6d30;
}

.summary-card.sent .summary-icon {
    background: #f9efc9;
    color: #9e7a12;
}

.summary-card.pending .summary-icon {
    background: #e7f4d9;
    color: #669646;
}

.summary-card.approved .summary-icon {
    background: #dff0df;
    color: #418454;
}

.summary-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.summary-card h3 {
    position: relative;
    z-index: 1;
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 500;
    color: #4b5563;
}

.summary-body {
    position: relative;
    z-index: 1;
}

.summary-mine {
    margin-bottom: 4px;
}

.summary-mine span {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 39px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.summary-team {
    margin-bottom: 6px;
    color: #5b6575;
    font-size: 18px;
    font-weight: 400;
}

.summary-description {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 10px;
    line-height: 1.45;
    color: #6a7485;
    font-weight: 400;
}

.metric-tip {
    position: relative;
    display: inline-flex;
    cursor: default;
    z-index: 20;
}

.metric-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    background: rgba(12, 16, 24, 0.94);
    color: #ffffff;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
    z-index: 200;
}

.metric-tip::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(12, 16, 24, 0.94);
    opacity: 0;
    transition: opacity .18s ease;
    z-index: 201;
}

.metric-tip:hover::after,
.metric-tip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dashboard-status-panel {
    margin-top: 18px;
    border-radius: 18px;
    border: 1px solid #d7deea;
    box-shadow: 0 16px 34px rgba(15, 25, 40, 0.05);
}

.dashboard-flow-panel {
    margin-top: 18px;
    border-radius: 18px;
    border: 1px solid #d7deea;
    box-shadow: 0 16px 34px rgba(15, 25, 40, 0.05);
}

.dashboard-flow-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.dashboard-search {
    width: min(360px, 100%);
}

.dashboard-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dashboard-flow-panel .table-wrap {
    border: 1px solid #cfd8e6;
    border-radius: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.dashboard-table {
    border-collapse: separate;
    border-spacing: 0;
}

.dashboard-table th,
.dashboard-table td {
    border-bottom: 1px solid #d7deea;
}

.dashboard-table th + th,
.dashboard-table td + td {
    border-left: 1px solid #e2e8f0;
}

.dashboard-table thead th {
    background: #f4f7fb;
    box-shadow: inset 0 -1px 0 #cfd8e6;
}

.dashboard-table tbody tr:hover td {
    background: #fbfdff;
}

.dashboard-pdf-col {
    white-space: nowrap;
}

.dashboard-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.dashboard-pdf-note {
    margin-top: 14px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-head-space {
    align-items: center;
}

.user-form-panel {
    margin-bottom: 18px;
}

.user-role-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-chip,
.role-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.role-admin,
.role-badge-admin {
    background: #e8f0ff;
    color: #1e5db8;
    border: 1px solid #c8dafb;
}

.role-user,
.role-badge-user {
    background: #fff6dd;
    color: #9b6a07;
    border: 1px solid #f2deab;
}

.role-viewer,
.role-badge-viewer {
    background: #e8f7ee;
    color: #2f7650;
    border: 1px solid #c8e6d3;
}

.user-form-actions {
    justify-content: flex-end;
    gap: 8px;
}

.users-pagination {
    margin-top: 16px;
}

.roles-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.role-card {
    position: relative;
    overflow: hidden;
    min-height: 188px;
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 20px;
    border: 1px solid #d8e0ed;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 34px rgba(15, 25, 40, 0.06);
}

.role-card::before {
    content: '';
    position: absolute;
    top: -36px;
    right: -36px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    opacity: 0.16;
}

.role-card-head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 14px;
    align-items: center;
}

.role-card-meta {
    min-width: 0;
}

.role-card-meta h3 {
    margin: 0 0 6px;
    font-size: 24px;
    line-height: 1.15;
    color: #1f2937;
}

.role-count {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.role-icon {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.role-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.role-desc {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 17px;
    line-height: 1.65;
    color: #526072;
    overflow-wrap: anywhere;
}

.role-card-admin {
    border-color: #cddbf7;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.role-card-admin::before {
    background: #4f8ff7;
}

.role-card-admin .role-icon {
    background: #e3efff;
    color: #225fbe;
}

.role-card-admin .role-count {
    background: #e9f2ff;
    color: #2559a8;
}

.role-card-user {
    border-color: #f0dfb5;
    background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.role-card-user::before {
    background: #f2c24f;
}

.role-card-user .role-icon {
    background: #fff1cc;
    color: #b47c00;
}

.role-card-user .role-count {
    background: #fff4d9;
    color: #9a6a00;
}

.role-card-viewer {
    border-color: #cfe4da;
    background: linear-gradient(180deg, #ffffff 0%, #f3fbf6 100%);
}

.role-card-viewer::before {
    background: #5fb986;
}

.role-card-viewer .role-icon {
    background: #ddf4e7;
    color: #2f7c53;
}

.role-card-viewer .role-count {
    background: #e8f7ee;
    color: #2f6f50;
}

@media (max-width: 960px) {
    .dashboard-flow-head {
        flex-direction: column;
    }

    .dashboard-search {
        width: 100%;
    }

    .panel-head,
    .panel-head-space {
        flex-direction: column;
        align-items: stretch;
    }

    .roles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    body {
        overflow-x: hidden;
    }

    .mobile-nav-toggle {
        display: inline-flex;
    }

    body.sidebar-open .mobile-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(84vw, 320px);
        z-index: 110;
        overflow-y: auto;
        transform: translateX(-104%);
        transition: transform .24s ease;
        box-shadow: 24px 0 40px rgba(15, 23, 42, 0.22);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .content {
        padding: 72px 14px 16px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar h1 {
        font-size: 22px;
    }

    .userbox {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .userbox .link,
    .userbox .link-icon {
        margin-left: auto;
    }

    .panel,
    .quote-editor,
    .auth-card {
        padding: 14px;
        border-radius: 14px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .summary-card {
        grid-template-columns: 48px 1fr;
        min-height: 0;
        padding: 15px;
    }

    .summary-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .summary-icon svg {
        width: 24px;
        height: 24px;
    }

    .summary-card h3 {
        font-size: 18px;
    }

    .summary-mine span {
        font-size: 30px;
    }

    .summary-team {
        font-size: 15px;
    }

    .summary-description {
        font-size: 11px;
    }

    .install-card {
        width: 100%;
    }

    .driver-grid,
    .grid2,
    .calc-grid,
    .mail-switches,
    .roles-grid {
        grid-template-columns: 1fr;
    }

    .panel-head,
    .panel-head-space,
    .dashboard-flow-head {
        flex-direction: column;
        align-items: stretch;
    }

    .table-tools,
    .bulk-bar,
    .actions,
    .pdf-modal-head,
    .pdf-modal-actions {
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .bulk-bar > *,
    .actions > *,
    .pdf-modal-actions > * {
        width: 100%;
    }

    .btn,
    .mini,
    .table-search,
    .dashboard-search {
        width: 100%;
    }

    .tabs {
        position: static;
        padding-top: 0;
        margin-top: 4px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .tab {
        white-space: nowrap;
    }

    .table-wrap {
        margin: 0 -4px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap.is-scrollable::after {
        content: 'Sağa sola kaydırarak detaylara bakabilirsiniz';
        display: block;
        margin-top: 8px;
        padding-right: 4px;
        text-align: right;
        font-size: 10pt;
        line-height: 1.3;
        color: #6a7485;
        animation: tableHintPulse 1.8s ease-in-out 2;
    }

    .table-wrap.is-scrollable.has-scrolled::after {
        display: none;
    }

    .data-table {
        width: max-content;
        min-width: 980px;
    }

    .dashboard-table {
        width: max-content;
        min-width: 1040px;
    }

    .dashboard-table th,
    .dashboard-table td {
        white-space: nowrap;
    }

    .line-items {
        width: max-content;
        min-width: 760px;
    }

    .dashboard-pagination,
    .users-pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .dashboard-table .dashboard-pdf-col {
        position: sticky;
        right: 0;
        z-index: 3;
        background: #ffffff;
        box-shadow: -8px 0 14px rgba(15, 23, 42, 0.06);
    }

    .dashboard-table thead .dashboard-pdf-col {
        background: #f4f7fb;
        z-index: 4;
    }

    .dashboard-table tbody tr:hover .dashboard-pdf-col {
        background: #fbfdff;
    }

    .with-tip::after {
        left: auto;
        right: 0;
        top: calc(100% + 10px);
        transform: translateY(-4px);
        white-space: normal;
        width: min(220px, 70vw);
    }

    .with-tip::before {
        left: auto;
        right: 12px;
        top: calc(100% + 1px);
        transform: none;
        border-right-color: transparent;
        border-bottom-color: rgba(10, 10, 12, 0.96);
    }

    .with-tip:hover::after,
    .with-tip:hover::before {
        transform: translateY(0);
    }

    .pdf-modal-card {
        width: calc(100vw - 10px);
        height: calc(100vh - 10px);
        margin: 5px auto;
        border-radius: 10px;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 17px;
    }

    .auth-body {
        padding: 14px;
    }

    .brand {
        padding-right: 28px;
    }

    .avatar {
        width: 34px;
        height: 34px;
    }

    .quote-editor input,
    .quote-editor textarea,
    .quote-editor select,
    input,
    textarea,
    select {
        font-size: 16px;
    }

    .chips,
    .user-role-notes {
        gap: 6px;
    }

    .chip,
    .role-chip,
    .role-badge,
    .badge {
        font-size: 12px;
    }

    .totals.totals-right,
    .preview-totals.totals-right {
        width: 100%;
    }

    .totals-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    #lineItemsTable th:nth-child(1),
    #lineItemsTable td:nth-child(1) {
        width: 44%;
    }
}

@keyframes tableHintPulse {
    0%, 100% {
        opacity: 0.45;
        transform: translateX(0);
    }
    35% {
        opacity: 1;
        transform: translateX(-8px);
    }
    70% {
        opacity: 0.85;
        transform: translateX(8px);
    }
}

.swal2-popup.swal-mail-popup {
    width: min(560px, calc(100vw - 26px));
    padding: 1.1rem 1rem 1rem;
    border-radius: 18px;
}

.swal-mail-popup .swal2-title {
    margin-bottom: 0.4rem;
}

.swal-mail-popup .swal2-html-container.swal-mail-html {
    margin: 0.35rem 0 0;
    padding: 0;
}

.swal-mail-popup .swal2-input,
.swal-mail-popup .swal2-textarea {
    width: 100%;
    margin: 0 0 10px;
    font-size: 17px;
    line-height: 1.45;
    border-radius: 10px;
}

.swal-mail-popup .swal2-input {
    height: 54px;
    padding: 0 14px;
}

.swal-mail-popup .swal2-textarea {
    min-height: 180px;
    padding: 14px;
}

.swal-mail-label {
    display: block;
    margin: 4px 2px 6px;
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    text-align: left;
}

.swal-mail-copy-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 10px;
    padding: 12px 14px;
    border: 1px solid #d9e4f5;
    border-radius: 12px;
    background: #f8fbff;
}

.swal-mail-popup .swal-copy-box {
    margin-top: 2px;
    padding: 12px;
}

.swal-mail-popup .swal2-actions {
    margin-top: 0.5rem;
}

@media (max-width: 640px) {
    .swal2-popup.swal-mail-popup {
        width: calc(100vw - 18px);
        padding: 0.95rem 0.8rem 0.85rem;
    }

    .swal-mail-popup .swal2-input,
    .swal-mail-popup .swal2-textarea {
        font-size: 16px;
    }

    .swal-mail-popup .swal2-textarea {
        min-height: 160px;
    }
}
