:root {
    --bg: #f3f6fa;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #dbe4ee;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --dark: #0b1220;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --radius-xl: 24px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.container { width: min(1220px, calc(100% - 32px)); margin: 0 auto; }
.container.narrow { width: min(1220px, calc(100% - 64px)); }
.page-hero {
    background: linear-gradient(180deg, #eef4ff 0%, rgba(238, 244, 255, 0.55) 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 28px 0 90px;
}
.eyebrow {
    display: inline-block;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 10px;
}
.page-hero h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.08;
}
.topbar {
    margin-top: -48px;
    position: relative;
    z-index: 5;
}
.topbar-inner {
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(219, 228, 238, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    border: 1px solid #dbe6f3;
    display: grid;
    place-items: center;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
    padding: 10px;
    flex-shrink: 0;
}
.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.brand strong { display: block; font-size: 16px; }
.brand small { color: var(--muted); display: block; margin-top: 4px; }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
    appearance: none;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: .22s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-dark { background: var(--dark); color: white; }
.btn-dark:hover { background: #020617; }
.btn-light { background: white; color: var(--text); border: 1px solid var(--line); }
.btn-light:hover { border-color: #b7c6d8; }
.btn-danger { background: #fff1f2; color: var(--danger); border: 1px solid #fecdd3; }
.btn-secondary { background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe; }
.btn-full { width: 100%; }
.main-content { padding: 26px 0 44px; }
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header, .card-body, .card-footer { padding: 22px; }
.card-header { border-bottom: 1px solid #edf2f7; }
.card-title { margin: 0; font-size: 20px; }
.card-subtitle { margin: 7px 0 0; color: var(--muted); }
.stat-card { padding: 22px; }
.stat-label { color: var(--muted); font-weight: 600; margin-bottom: 10px; display: block; }
.stat-value { font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 10px; }
.stat-meta { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1120px;
}
.table th, .table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}
.table td {
    white-space: nowrap;
}
.table th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.table tr:hover td { background: #f8fbff; }
.company-cell { display: flex; align-items: center; gap: 14px; }
.company-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eef2f7;
    border: 1px solid #e2e8f0;
    display: grid;
    place-items: center;
}
.company-logo img { width: 100%; height: 100%; object-fit: contain; background: white; }
.company-logo.placeholder { font-weight: 800; color: var(--primary); font-size: 18px; }
.company-meta strong { display: block; }
.company-meta span { color: var(--muted); font-size: 14px; }
.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-neutral { background: #e2e8f0; color: #334155; }
.actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.actions-wrap { flex-wrap: wrap; }
.actions-compact .btn { padding: 8px 14px; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.single-column { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.label { font-weight: 700; font-size: 14px; }
.input, .select, .textarea {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #ced9e5;
    border-radius: 16px;
    background: white;
    color: var(--text);
    outline: 0;
    transition: .22s ease;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.textarea { min-height: 130px; resize: vertical; }
.helper { color: var(--muted); font-size: 13px; }
.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 14px;
}
.alert-success { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.summary-panel, .detail-panel { padding: 24px; }
.summary-logo {
    width: 110px;
    height: 110px;
    border-radius: 26px;
    margin-bottom: 18px;
}
.summary-placeholder {
    font-size: 34px;
    font-weight: 800;
    color: var(--primary);
}
.summary-title { margin: 0 0 8px; }
.summary-text { margin-top: 0; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.kv-item {
    background: #f8fbff;
    border: 1px solid #e6eef7;
    border-radius: 18px;
    padding: 16px;
}
.kv-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}
.kv-value { font-weight: 700; word-break: break-word; }
.note-box {
    background: #0f172a;
    color: white;
    padding: 20px;
    border-radius: 18px;
}
.note-box p { margin: 0; color: rgba(255,255,255,0.84); }
.site-footer { padding: 0 0 34px; }
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--muted);
    font-size: 14px;
}
.footer-inner a { color: var(--primary); font-weight: 700; }
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card { width: min(720px, 100%); }
.login-card .card-body { padding: 28px; }
.login-brand-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
}
.login-brand-logo {
    width: 108px;
    height: 108px;
    border-radius: 26px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    border: 1px solid #dbe6f3;
    display: grid;
    place-items: center;
    padding: 16px;
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.12);
}
.login-brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-brand-copy .eyebrow { margin-bottom: 12px; }
.login-brand-copy h1 { margin: 0; font-size: clamp(26px, 3.6vw, 32px); line-height: 1.1; }
.login-brand-copy p { color: var(--muted); margin: 10px 0 0; }
.empty-state { padding: 36px; text-align: center; color: var(--muted); }
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    width: min(100%, 640px);
}
.search-row .input {
    min-width: 0;
    flex: 1;
}
.muted { color: var(--muted); }
.logo-upload-row {
    display: flex;
    gap: 18px;
}
.logo-input-wrap { flex: 1; }
.logo-preview-box {
    width: 56px;
    height: 56px;
    border-radius: 15px;
    flex-shrink: 0;
}
.view-actions .btn { padding: 12px 16px; }
.print-card { box-shadow: none; }
.print-header {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: center;
    margin-bottom: 28px;
}
.print-brand h2 { margin: 0 0 6px; }
.print-meta-right { text-align: right; }
.print-company-logo {
    max-width: 55px;
    max-height: 55px;
    margin-left: auto;
    margin-bottom: 10px;
    object-fit: contain;
}
.print-section { margin-bottom: 24px; }
.print-section .table td:nth-child(2) { white-space: normal; }
.print-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.print-box {
    border: 1px solid #d7e2ed;
    border-radius: 16px;
    padding: 14px;
    background: #fff;
}
.print-footer-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    border-top: 1px solid #dbe4ee;
    padding-top: 18px;
    margin-top: 26px;
    color: #334155;
}
@media (max-width: 1080px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .grid-2, .grid-4, .form-grid, .kv, .print-grid, .print-footer-meta { grid-template-columns: 1fr; }
    .topbar-inner, .footer-inner, .header-actions, .print-header { flex-direction: row; align-items: stretch; }
    .container.footer-inner p { margin: 0; }
    .container.footer-inner { text-align: center; }
    .page-hero { padding-bottom: 76px; }
    .container.narrow { width: min(1220px, calc(100% - 32px)); }
    .search-row, .actions { flex-wrap: nowrap; }
    .logo-upload-row, .login-brand-row { grid-template-columns: 1fr; display: grid; }
    .login-brand-logo { width: 92px; height: 92px; }
    .brand-logo { width: 56px; height: 56px; }
    .print-meta-right { text-align: left; }
    .print-company-logo { margin-left: 0; }
}
@media (max-width: 810px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (max-width: 446px) {
    .topbar-inner, .footer-inner, .header-actions, .print-header { flex-direction: column; }
}
@media (max-width: 768px) {
    .container.topbar-inner .topbar-actions {
        gap: 8px;
    }
    .container.topbar-inner .topbar-actions a {
        padding: 10px 14px;
        font-size: 14px;
        flex-grow: 1;
    }
}
@media print {
    body { background: #fff; }
    .page-hero, .topbar, .site-footer, .no-print { display: none !important; }
    .card, .kv-item, .print-box { box-shadow: none !important; }
    .main-content { padding: 0; }
    .print-card { border: 0; }
    .print-footer-meta { break-inside: avoid; }
}
.backup-filename {
    font-weight: 700;
    word-break: break-all;
}
.alert.alert-success {
    margin-bottom: 5px;
}

.search-row {
    position: relative;
}

.search-clear-icon {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: none;
}
.table {min-width:980px;}
.invoice-items{display:grid;gap:14px}.invoice-item-row{display:grid;grid-template-columns:56px 1fr 220px 120px;gap:12px;align-items:end;padding:16px;background:#f8fbff;border:1px solid #e6eef7;border-radius:18px}.item-no{height:52px;display:grid;place-items:center;border-radius:16px;background:white;border:1px solid var(--line);font-weight:800;color:var(--primary)}.summary-layout{display:grid;grid-template-columns:1.15fr 420px;gap:20px;align-items:start}.invoice-summary-box{background:#f8fbff;border:1px solid #e6eef7;border-radius:18px;padding:18px}.summary-note{font-size:14px;color:var(--muted);margin-bottom:18px}.summary-line{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid #e6eef7}.summary-line.total{padding-top:16px;border-bottom:0;font-size:18px}.invoice-parties{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:20px}.invoice-party-box{background:#f8fbff;border:1px solid #e6eef7;border-radius:18px;padding:16px;display:grid;gap:6px}.invoice-party-box h3{margin-top:0;margin-bottom:12px;font-size:19px}.invoice-lower-grid{display:grid;grid-template-columns:1fr 380px;gap:20px;margin-top:20px}.invoice-detail-grid{grid-template-columns:300px 1fr}.invoice-preview-header{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:20px}.invoice-preview-total{font-size:28px;font-weight:800;color:var(--primary);white-space:nowrap}@media(max-width:1080px){.summary-layout,.invoice-lower-grid,.invoice-detail-grid,.invoice-parties{grid-template-columns:1fr}}@media(max-width:860px){.invoice-item-row{grid-template-columns:1fr}.item-no{width:56px}}

.summary-cards {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.mini-summary-card {
    padding: 18px;
    border: 1px solid #e5edf5;
    border-radius: 18px;
    background: #f8fbff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.mini-summary-label {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.mini-summary-card strong {
    display: block;
    font-size: 24px;
    line-height: 1.2;
    color: var(--text);
    font-weight: 800;
}

@media (max-width: 780px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    .btn {
        font-size: 14px;
        padding: 10px 14px;
    }
}

.actions-wrap a.btn { font-size: 15px; }

.card-header.header-actions .actions-wrap {
    flex-wrap: nowrap;
}

.toast-container {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 9999;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
}

.toast {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 16px 46px 16px 18px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
    animation: toastIn 0.28s ease forwards;
    overflow: hidden;
}

.toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
}

.toast strong {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.toast span {
    font-size: 14px;
    line-height: 1.5;
    color: #475569;
}

.toast-success::before {
    background: #16a34a;
}

.toast-error::before {
    background: #dc2626;
}

.toast-success {
    border-color: #bbf7d0;
}

.toast-error {
    border-color: #fecaca;
}

.toast-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: grid;
    place-items: center;
}

.toast-close:hover {
    background: #e2e8f0;
}

.toast.toast-hide {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-12px) translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) translateX(16px);
    }
}

@media (max-width: 780px) {
    .toast-container {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }
}
.form-section-title {
    margin: 4px 0 0;
    font-size: 18px;
    color: var(--text);
    border-top: 1px solid #e6eef7;
    padding-top: 18px;
}
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #dbe4ee;
    border-radius: 16px;
    background: #f8fbff;
    font-weight: 700;
}
.check-row input { width: 18px; height: 18px; }
.qr-preview {
    margin-top: 18px;
    width: 180px;
    padding: 14px;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    background: #fff;
}
.qr-preview img { width: 100%; height: auto; object-fit: contain; }
.final-print-card { padding: 38px; }
.final-print-cover {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #dbe4ee;
    margin-bottom: 26px;
}
.final-print-cover h1 {
    margin: 0 0 14px;
    font-size: 34px;
    line-height: 1.12;
}
.final-print-cover p { margin: 0; color: #475569; line-height: 1.65; font-size: 16px; }
.final-print-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid #dbe4ee;
    border-radius: 24px;
    padding: 14px;
    background: #fff;
}
.final-print-section { margin-bottom: 26px; break-inside: avoid; }
.final-print-section h2 { margin: 0 0 12px; font-size: 20px; }
.print-box { display: grid; gap: 7px; }
.print-box strong { font-size: 13px; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.print-box span { font-weight: 500; word-break: break-word; line-height: 1.1; font-size: 15px; }
.final-google-grid { display: grid; grid-template-columns: 1fr 180px; gap: 16px; align-items: start; }
.final-qr-box {
    border: 1px solid #d7e2ed;
    border-radius: 16px;
    padding: 14px;
    background: #fff;
    display: grid;
    gap: 10px;
    text-align: center;
    font-weight: 800;
}
.final-qr-box img { width: 100%; height: auto; object-fit: contain; }
.final-message {
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: 18px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-weight: 700;
    line-height: 1.6;
}
.final-nisi-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid #dbe4ee;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    color: #334155;
}
.final-nisi-footer div { display: grid; gap: 4px; }
.final-nisi-footer span { color: #64748b; }
@media (max-width: 780px) {
    .final-print-cover, .final-nisi-footer { flex-direction: column; }
    .final-google-grid { grid-template-columns: 1fr; }
    .final-print-card { padding: 22px; }
    .final-print-cover h1 { font-size: 28px; }
}
@media print {
    @page { margin: 14mm; }
    .final-print-card { padding: 0; border: 0; }
    .final-print-cover h1 { font-size: 28px; }
    .final-message { background: #fff; border-color: #dbe4ee; color: #0f172a; }
    .print-box, .final-qr-box { background: #fff !important; }
}

/* WP Webat - filtrimi, lista dhe printimi */
.wp-filter-panel {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border: 1px solid #e5edf5;
    border-radius: 22px;
    padding: 16px;
}
.wp-filter-top {
    display: grid;
    grid-template-columns: 280px minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
}
.wp-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.wp-sites-results-table .table,
.wp-sites-table {
    min-width: 920px;
}
.wp-sites-table th:nth-child(1),
.wp-sites-table td:nth-child(1) { width: 22%; }
.wp-sites-table th:nth-child(2),
.wp-sites-table td:nth-child(2) { width: 18%; }
.wp-sites-table th:nth-child(3),
.wp-sites-table td:nth-child(3) { width: 25%; }
.wp-sites-table th:nth-child(4),
.wp-sites-table td:nth-child(4) { width: 13%; }
.wp-sites-table th:nth-child(5),
.wp-sites-table td:nth-child(5) { width: 13%; }
.wp-sites-table th:nth-child(6),
.wp-sites-table td:nth-child(6) { width: 9%; }

.wp-print-clean {
    padding: 34px;
    border-radius: 28px;
}
.wp-print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid #dbe4ee;
}
.wp-print-header h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.1;
}
.wp-print-header p {
    margin: 0;
    color: #64748b;
}
.wp-print-total {
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    padding: 14px 18px;
    background: #f8fbff;
    color: #334155;
    font-weight: 700;
    white-space: nowrap;
}
.wp-print-list-clean {
    display: grid;
    gap: 16px;
}
.wp-print-item-clean {
    border: 1px solid #dbe4ee;
    border-radius: 20px;
    padding: 18px;
    background: #fff;
    break-inside: avoid;
}
.wp-print-title-clean {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.wp-print-title-clean span {
    color: #2563eb;
    font-weight: 900;
    letter-spacing: .02em;
}
.wp-print-title-clean h2 {
    margin: 0;
    font-size: 20px;
}
.wp-print-three-grid {
    display: grid;
    grid-template-columns: 1.35fr .85fr .85fr;
    gap: 12px;
}
.print-box strong {
    display: block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 7px;
}
.print-box span {
    display: block;
    font-weight: 500;
    color: #0f172a;
    word-break: break-word;
    font-size: 15px;
}
.print-box small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-weight: 700;
    word-break: break-word;
}
@media (max-width: 980px) {
    .wp-filter-top { grid-template-columns: 1fr; }
    .wp-filter-actions { justify-content: flex-start; }
}
@media (max-width: 780px) {
    .wp-print-header { flex-direction: column; }
    .wp-print-three-grid { grid-template-columns: 1fr; }
}
@media print {
    @page { margin: 13mm; }
    .wp-print-clean {
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }
    .wp-print-header h1 { font-size: 26px; }
    .wp-print-total, .wp-print-item-clean, .print-box {
        background: #fff !important;
        box-shadow: none !important;
    }
    .wp-print-three-grid {
        grid-template-columns: 1.35fr .85fr .85fr !important;
    }
}

header.page-hero div.container.narrow {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

header.page-hero div.container.narrow .topbar-actions a.btn svg {
    width: 20px;
    height: 20px;
}

header.page-hero div.container.narrow .topbar-actions a.btn.btn-dark svg * {
    fill: #fff;
}

/* Notes module */
.notes-stats .notes-small-stat {
    font-size: 30px;
    line-height: 1.2;
    white-space: nowrap;
}
.notes-card {
    overflow: hidden;
}
.notes-search-row {
    padding: 18px 22px;
    border-bottom: 1px solid #edf2f7;
    background: #fbfdff;
}
.notes-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    min-height: 620px;
}
.notes-sidebar {
    border-right: 1px solid #edf2f7;
    background: #f8fbff;
    min-width: 0;
}
.notes-list {
    height: 620px;
    overflow-y: auto;
    padding: 14px;
    display: grid;
    align-content: start;
    gap: 10px;
}
.notes-nav-item {
    width: 100%;
    min-width: 0;
    text-align: left;
    border: 1px solid #e1eaf5;
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    cursor: pointer;
    transition: .18s ease;
}
.notes-nav-item:hover {
    border-color: #b7c6d8;
    transform: translateY(-1px);
}
.notes-nav-item.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}
.notes-nav-item span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    color: var(--text);
}
.notes-nav-item small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 600;
}
.notes-editor {
    min-width: 0;
    background: #fff;
}
.notes-editor-inner {
    height: 620px;
    display: grid;
    grid-template-rows: auto 1fr auto;
}
.notes-title-input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #edf2f7;
    padding: 22px;
    outline: none;
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1.1;
    font-weight: 800;
    color: var(--text);
}
.notes-title-input:focus {
    background: #fbfdff;
}
.notes-content-input {
    width: 100%;
    min-height: 0;
    border: 0;
    resize: none;
    outline: none;
    padding: 22px;
    font-size: 16px;
    line-height: 1.75;
    color: #1e293b;
    overflow-y: auto;
}
.notes-editor-footer {
    border-top: 1px solid #edf2f7;
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    background: #fbfdff;
}
.notes-placeholder {
    height: 620px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    padding: 32px;
    color: var(--muted);
}
.notes-placeholder h3 {
    margin: 0 0 8px;
    color: var(--text);
}
.notes-placeholder p {
    margin: 0;
}
.notes-mobile-top {
    display: none;
    padding: 14px;
    border-bottom: 1px solid #edf2f7;
    background: #fbfdff;
}
.notes-empty {
    background: transparent;
    border: 0;
}
[data-note-status][data-state="saving"],
[data-note-status][data-state="dirty"] {
    color: #d97706;
}
[data-note-status][data-state="saved"] {
    color: #166534;
}
[data-note-status][data-state="error"] {
    color: #dc2626;
}

@media (max-width: 980px) {
    .notes-layout {
        grid-template-columns: 1fr;
        min-height: 620px;
    }
    .notes-sidebar {
        border-right: 0;
    }
    .notes-list {
        height: 620px;
    }
    .notes-editor {
        display: none;
    }
    .notes-editor.is-open {
        display: block;
    }
    .notes-sidebar.is-hidden-mobile {
        display: none;
    }
    .notes-mobile-top {
        display: block;
    }
    .notes-editor-inner,
    .notes-placeholder {
        height: 590px;
    }
}

@media (max-width: 780px) {
    .notes-stats.grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .notes-search-row {
        padding: 14px;
    }
    .notes-editor-footer {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Final global stat value size */
.stat-value { font-size: 30px; }
@media (max-width: 780px) {
    .stat-value { font-size: 25px; }
    .notes-stats .stat-value,
    .notes-stats .notes-small-stat { font-size: 25px !important; }
}

/* WP Sites pagination */
.wp-pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px 22px;
    border-top: 1px solid #e8eef6;
    flex-wrap: wrap;
}
.wp-pagination-meta {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}
.wp-pagination {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.page-btn,
.page-dots {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    font-weight: 800;
    text-decoration: none;
}
.page-btn {
    border: 1px solid #d8e4f1;
    color: var(--text);
    background: #fff;
    transition: .18s ease;
}
.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}
.page-btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.page-btn.is-disabled {
    opacity: .45;
    pointer-events: none;
}
.page-dots {
    color: var(--muted);
}

/* Dashboard latest WP list tighter when showing 7 items */
.dashboard-latest-grid .card:first-child .card-body {
    padding-bottom: 18px;
}
.dashboard-latest-grid .card:first-child .grid {
    gap: 10px;
}
.dashboard-latest-grid .card:first-child .kv-item {
    padding: 13px 16px;
    border-radius: 16px;
}
.dashboard-latest-grid .card:first-child .kv-label {
    margin-bottom: 4px;
}
.dashboard-latest-grid .card:first-child .dashboard-url {
    margin-top: 4px;
}

@media (max-width: 780px) {
    .wp-pagination-wrap {
        align-items: stretch;
    }
    .wp-pagination,
    .wp-pagination-meta {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .page-btn,
    .page-dots {
        min-width: 36px;
        height: 36px;
        border-radius: 12px;
    }
}

/* Pagination responsive fix */
.app-pagination-wrap .wp-pagination,
.wp-pagination-wrap .wp-pagination {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.app-pagination-wrap .page-btn,
.wp-pagination-wrap .page-btn,
.app-pagination-wrap .page-dots,
.wp-pagination-wrap .page-dots {
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .app-pagination-wrap,
  .wp-pagination-wrap {
    align-items: flex-start;
  }
  .app-pagination-wrap .wp-pagination,
  .wp-pagination-wrap .wp-pagination {
    width: 100%;
    justify-content: flex-start;
  }
}

.offer-description {
  min-height: 110px;
}
.offer-item-row {
  grid-template-columns: 44px minmax(170px, 1fr) minmax(240px, 1.6fr) 150px 92px;
}
@media (max-width: 980px) {
  .offer-item-row {
    grid-template-columns: 36px 1fr;
  }
}

/* Modern select controls */
select.input,
select.select,
.modern-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%230f172a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding-right: 46px;
    cursor: pointer;
}
select.input:hover,
select.select:hover,
.modern-select:hover {
    border-color: #b8c8dc;
}
.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}
.wp-create-form.is-create-mode .wp-form-rest {
    display: none;
}
.wp-create-form.is-create-mode.has-collaborator .wp-form-rest,
.wp-create-form:not(.is-create-mode) .wp-form-rest {
    display: contents;
}
.wp-collaborator-first {
    padding: 18px;
    border: 1px solid #e4edf7;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.wp-create-form.is-create-mode.has-collaborator .wp-collaborator-first {
    background: #f8fbff;
}
@media (max-width: 780px) {
    .btn-icon { width: 42px; height: 42px; }
}

/* Final refinements: compact topbar, pagination, selects, offers */
@media (min-width: 981px) {
  .topbar-actions { gap: 8px; flex-wrap: nowrap; }
  .topbar-actions .btn { padding: 10px 15px; font-size: 14px; border-radius: 13px; white-space: nowrap; }
  .brand small { max-width: 220px; line-height: 1.35; }
}

@media (max-width: 640px) {
  .app-pagination-wrap .wp-pagination,
  .wp-pagination-wrap .wp-pagination {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: visible;
    gap: 5px;
    padding-bottom: 0;
  }
  .app-pagination-wrap .page-btn,
  .wp-pagination-wrap .page-btn,
  .app-pagination-wrap .page-dots,
  .wp-pagination-wrap .page-dots {
    min-width: 32px;
    height: 34px;
    padding: 0 9px;
    border-radius: 11px;
    font-size: 14px;
  }
  .wp-pagination-wrap { padding-left: 12px; padding-right: 12px; }
}

.custom-select-wrap { position: relative; width: 100%; }
.custom-select-wrap > select { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; }
.custom-select-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid #ced9e5;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  color: var(--text);
  cursor: pointer;
  transition: .2s ease;
  text-align: left;
  font-weight: 600;
}
.custom-select-trigger:hover { border-color: #b8c8dc; }
.custom-select-wrap.is-open .custom-select-trigger,
.custom-select-trigger:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); outline: none; }
.custom-select-trigger svg { flex: 0 0 auto; transition: .2s ease; }
.custom-select-wrap.is-open .custom-select-trigger svg { transform: rotate(180deg); }
.custom-select-menu {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dbe6f3;
  border-radius: 16px;
  box-shadow: 0 22px 50px rgba(15, 23, 42, .16);
  padding: 6px;
  display: none;
}
.custom-select-wrap.is-open .custom-select-menu { display: block; }
.custom-select-option {
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}
.custom-select-option:hover,
.custom-select-option.is-selected { background: #eff6ff; color: var(--primary); }

.offer-items-clean { display: grid; gap: 14px; }
.offer-item-clean { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: start; padding: 16px; background: #f8fbff; border: 1px solid #e6eef7; border-radius: 18px; }
.offer-item-number { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: #fff; border: 1px solid #dbe6f3; color: var(--primary); font-weight: 900; font-size: 18px; }
.offer-item-fields { display: grid; gap: 12px; }
.offer-intro-text { min-height: 160px; }
.offer-summary-layout { align-items: end; }
.offer-total-edit-box { align-self: end; }
.offer-total-input { margin: 6px 0 12px; font-weight: 900; font-size: 20px; }
.offer-total-preview-row { align-items: center; }
@media (max-width: 860px) {
  .offer-item-clean { grid-template-columns: 1fr; }
  .offer-item-number { width: 44px; height: 44px; }
  .offer-item-remove { justify-self: start; }
}

/* Final fixes requested 2026-04-27 */
.card:has(.custom-select-wrap.is-open) { overflow: visible; position: relative; z-index: 40; }
.custom-select-menu {
  max-height: min(320px, 44vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.custom-select-option:first-child { color: var(--primary); background: #eff6ff; }

.toast {
  border-radius: 20px;
  border: 1px solid #cfe0f4;
  box-shadow: 0 18px 46px rgba(37, 99, 235, .13), 0 8px 20px rgba(15, 23, 42, .08);
}
.toast::before { display: none; }
.toast-success { border-color: #bfdbfe; background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.toast-success strong { color: #0f2f67; }
.toast-error { border-color: #fecaca; background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%); }
.toast-close { background: #eef4fb; color: #334155; }
.toast-close:hover { background: #dbeafe; color: var(--primary); }

.offer-item-clean { align-items: stretch; }
.offer-item-remove { align-self: end; }
.offer-summary-layout { grid-template-columns: 1fr 420px; align-items: end; }
.offer-summary-layout .field { width: 100%; }
.offer-total-edit-box { display: grid; grid-template-columns: auto minmax(180px, 1fr); gap: 10px 16px; align-items: center; }
.offer-total-edit-box .summary-note { grid-column: 1 / -1; }
.offer-total-edit-box .label { margin: 0; }
.offer-total-input { margin: 0; text-align: right; }
.offer-total-preview-row { display: none !important; }
@media (max-width: 860px) {
  .offer-summary-layout { grid-template-columns: 1fr; }
  .offer-total-edit-box { grid-template-columns: 1fr; }
  .offer-total-input { text-align: left; }
}

/* Custom delete confirmation modal */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .18s ease;
}
.confirm-overlay.is-visible { opacity: 1; }
.confirm-overlay.is-leaving { opacity: 0; }
.confirm-modal {
  position: relative;
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid #dbe6f3;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 30px 80px rgba(15, 23, 42, .24);
  transform: translateY(10px) scale(.98);
  transition: transform .18s ease;
}
.confirm-overlay.is-visible .confirm-modal { transform: translateY(0) scale(1); }
.confirm-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #ef4444;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}
.confirm-content h3 {
  margin: 2px 34px 6px 0;
  font-size: 20px;
  line-height: 1.2;
  color: var(--text);
}
.confirm-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.confirm-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: #eef4fb;
  color: #64748b;
  cursor: pointer;
}
.confirm-close:hover { background: #e2eaf4; color: var(--text); }
.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
@media (max-width: 520px) {
  .confirm-modal { grid-template-columns: 1fr; padding: 20px; }
  .confirm-actions { justify-content: stretch; }
  .confirm-actions .btn { flex: 1; }
}

/* Final UX polish: toast, plus-only add buttons, fixed custom select */
.btn-icon-only {
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
}
.btn-icon-only svg { width: 20px; height: 20px; }
.toast {
  border: 1px solid #bfdbfe !important;
  border-left: 1px solid #bfdbfe !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 20px 50px rgba(37, 99, 235, .13), 0 8px 20px rgba(15, 23, 42, .08) !important;
}
.toast::before { display: none !important; }
.toast-success strong,
.toast-error strong { color: #0f2f67 !important; }
.toast-error { border-color: #fecaca !important; background: linear-gradient(180deg, #fff 0%, #fff7f7 100%) !important; }
.toast-close { border-radius: 12px !important; }
.custom-select-menu {
  position: fixed !important;
  z-index: 9998 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}
@media (max-width: 760px) {
  .btn-icon-only { width: 44px; height: 44px; min-width: 44px; }
}
