/* ═══════════════════════════════════════════
   MARKQORA INVOICE GENERATOR — STYLE SHEET
   ═══════════════════════════════════════════ */

:root {
    --bg:         #0d1117;
    --surface:    #161b22;
    --surface2:   #21262d;
    --border:     #30363d;
    --accent:     #2563eb;
    --accent-h:   #1d4ed8;
    --accent-s:   rgba(37,99,235,0.12);
    --green:      #16a34a;
    --red:        #dc2626;
    --yellow:     #d97706;
    --text:       #e6edf3;
    --text-2:     #8b949e;
    --text-3:     #6e7681;
    --topbar-h:   52px;
    --sidebar-w:  380px;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
}

/* ─── HIDDEN STATE ─── */
.app-hidden { display: none !important; }

/* ══════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════ */
.login-screen {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 60% 30%, #1a2a4a 0%, #0d1117 70%);
    z-index: 1000;
    animation: fadeIn .3s ease;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 44px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
    text-align: center;
}

.login-logo {
    width: 72px; height: 72px;
    background: var(--accent-s);
    border: 1px solid rgba(37,99,235,.3);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent);
}

.login-title { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.login-sub { color: var(--text-2); font-size: 13px; margin-top: 4px; margin-bottom: 32px; }

.login-form { text-align: left; }
.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }

.login-form input {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-s);
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.toggle-pw {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-3); cursor: pointer; padding: 4px;
    transition: color .2s;
}
.toggle-pw:hover { color: var(--text); }

.login-error {
    background: rgba(220,38,38,.1);
    border: 1px solid rgba(220,38,38,.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fca5a5;
    font-size: 13px;
    margin-bottom: 16px;
    animation: shake .3s ease;
}

.btn-login {
    width: 100%; padding: 13px;
    background: var(--accent);
    color: #fff; border: none;
    border-radius: 8px;
    font-family: inherit; font-size: 15px; font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s;
    letter-spacing: .02em;
}
.btn-login:hover { background: var(--accent-h); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

/* ══════════════════════════════════
   TOP BAR
══════════════════════════════════ */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    position: sticky; top: 0; z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 24px; }

.topbar-logo {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 15px; color: var(--text);
    white-space: nowrap;
}

.tab-nav { display: flex; gap: 4px; }
.tab-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 14px;
    border: none; background: none; border-radius: 7px;
    color: var(--text-2); font-family: inherit; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all .2s;
}
.tab-btn:hover { background: var(--surface2); color: var(--text); }
.tab-btn.active { background: var(--accent-s); color: #60a5fa; }

.badge {
    background: var(--accent);
    color: #fff;
    border-radius: 100px;
    font-size: 10px; font-weight: 700;
    padding: 1px 6px;
    min-width: 18px; text-align: center;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.user-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 12px 5px 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px; color: var(--text-2);
}

.user-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.btn-logout {
    display: flex; align-items: center;
    background: none; border: 1px solid var(--border);
    border-radius: 7px; padding: 7px 10px;
    color: var(--text-3); cursor: pointer; transition: all .2s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); background: rgba(220,38,38,.07); }

/* ─── SERVER INDICATOR ─── */
.server-indicator {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    letter-spacing: .02em;
    transition: all .3s;
}
.server-indicator.online {
    background: rgba(22,163,74,.15);
    border: 1px solid rgba(22,163,74,.3);
    color: #4ade80;
}
.server-indicator.offline {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-3);
}

/* ══════════════════════════════════
   PANELS
══════════════════════════════════ */
.panel { display: none; height: calc(100vh - var(--topbar-h)); overflow: hidden; }
.panel.active { display: flex; flex-direction: column; }

#panel-editor.active { display: flex; flex-direction: row; }

/* ══════════════════════════════════
   EDITOR PANEL
══════════════════════════════════ */
.app-container { display: flex; width: 100%; height: 100%; overflow: hidden; }

/* ─── SIDEBAR ─── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    flex-shrink: 0;
}

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 20px 18px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ─── FORM SECTIONS ─── */
.form-section { margin-bottom: 28px; }

.section-header {
    display: flex; align-items: center; gap: 7px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-3);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: 12px; }
.form-row { display: flex; gap: 10px; }
.form-col { flex: 1; min-width: 0; }

label {
    display: block;
    font-size: 11.5px; font-weight: 500;
    color: var(--text-2);
    margin-bottom: 5px;
}

input[type="text"],
input[type="date"],
input[type="number"],
textarea {
    width: 100%;
    padding: 9px 11px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-s);
}

.input-mono { font-family: 'SF Mono', 'Consolas', monospace; letter-spacing: .03em; }

textarea { resize: vertical; line-height: 1.5; }

/* ─── CURRENCY SELECT ─── */
.currency-select {
    width: 100%;
    padding: 9px 11px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.currency-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-s);
}

/* ─── TAX GRID ─── */
.tax-grid { display: flex; gap: 10px; }
.tax-item { flex: 1; }

/* ─── INVOICE-LEVEL DISCOUNT ─── */
.invoice-discount-wrap {
    margin-top: 14px;
    background: rgba(220,38,38,.06);
    border: 1px dashed rgba(220,38,38,.25);
    border-radius: 8px;
    padding: 10px 12px;
}
.invoice-discount-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600;
    color: #fca5a5;
    margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: .04em;
}
.invoice-discount-row {
    display: flex; align-items: center; gap: 10px;
}
.invoice-discount-row input {
    flex: 1;
    background: var(--surface);
    border: 1px solid rgba(220,38,38,.3);
    color: var(--text);
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 14px; font-weight: 700;
    text-align: center;
}
.invoice-discount-row input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}
.discount-unit {
    font-size: 12px; font-weight: 500;
    color: #fca5a5;
    white-space: nowrap;
}

/* Discount row in invoice preview table */
.discount-label-cell { color: #b91c1c !important; font-weight: 600 !important; }
.discount-val-cell   { color: #b91c1c !important; font-weight: 600 !important; }

/* ─── THEME SWATCHES ─── */
.theme-swatches {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.swatch {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-2); font-size: 12px; font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    flex: 1; min-width: 0;
    justify-content: center;
}
.swatch span {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.swatch:hover { border-color: #555; color: var(--text); }
.swatch.active {
    border-color: var(--accent);
    background: var(--accent-s);
    color: #60a5fa;
}

/* ─── ITEM ENTRIES ─── */
.item-entry {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    position: relative;
    transition: border-color .15s;
}
.item-entry:hover { border-color: #444c56; }
.item-entry .remove-item {
    position: absolute; top: -7px; right: -7px;
    background: var(--red); color: #fff;
    border: 2px solid var(--surface);
    border-radius: 50%; width: 22px; height: 22px;
    font-size: 13px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s;
}
.item-entry .remove-item:hover { transform: scale(1.15); }

/* ─── SAVED CLIENTS ROW ─── */
.saved-clients-row {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 12px;
}
.saved-client-select {
    flex: 1;
    font-size: 12px !important;
    padding: 7px 28px 7px 9px !important;
}
.btn-save-client {
    display: flex; align-items: center; gap: 5px;
    padding: 7px 12px;
    background: var(--accent);
    color: #fff; border: none;
    border-radius: 7px;
    font-size: 12px; font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s, transform .15s;
}
.btn-save-client:hover { background: var(--accent-h); transform: translateY(-1px); }
.btn-delete-client {
    display: flex; align-items: center;
    padding: 7px 9px;
    background: rgba(220,38,38,.1);
    border: 1px solid rgba(220,38,38,.3);
    color: #fca5a5;
    border-radius: 7px;
    flex-shrink: 0;
    transition: all .2s;
}
.btn-delete-client:hover { background: rgba(220,38,38,.22); }

.btn-add-item {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 7px;
    color: var(--text-3); font-family: inherit; font-size: 13px;
    cursor: pointer; transition: all .2s;
}
.btn-add-item:hover { border-color: var(--accent); color: #60a5fa; background: var(--accent-s); }

/* ─── SIDEBAR FOOTER ─── */
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 8px;
    background: var(--surface);
}

button { cursor: pointer; font-family: inherit; border-radius: 7px; transition: all .2s; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 500; border: none; }

.btn-save {
    padding: 11px;
    background: var(--accent);
    color: #fff;
    width: 100%;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 0 16px rgba(37,99,235,.3);
}
.btn-save:hover { background: var(--accent-h); transform: translateY(-1px); }

.btn-download {
    padding: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    width: 100%;
}
.btn-download:hover { border-color: #60a5fa; color: #60a5fa; }

.btn-clear {
    padding: 9px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-3);
    width: 100%;
    font-size: 12px;
}
.btn-clear:hover { border-color: var(--yellow); color: var(--yellow); }

/* ══════════════════════════════════
   PREVIEW AREA
══════════════════════════════════ */
.preview-area {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
    background: #1a1f28;
}

.preview-toolbar {
    height: 44px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.zoom-controls { display: flex; align-items: center; gap: 4px; }
.zoom-controls button {
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text); width: 28px; height: 28px;
    border-radius: 6px; font-size: 14px;
}
.zoom-controls button:hover { border-color: var(--accent); color: #60a5fa; }
#zoom-fit { width: auto; padding: 0 10px; font-size: 11px; }
#zoom-level { font-size: 12px; color: var(--text-2); min-width: 40px; text-align: center; }

.creator-badge {
    font-size: 12px; color: var(--text-2);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 3px 12px;
}

.invoice-wrapper-outer {
    flex: 1; overflow: auto;
    padding: 32px;
    display: flex; justify-content: center; align-items: flex-start;
}

.invoice-wrapper {
    background: #fff;
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
    transform-origin: top center;
    transition: transform .2s;
    flex-shrink: 0;
}

/* ══════════════════════════════════
   INVOICE TABLE (PRINT CONTENT)
══════════════════════════════════ */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10.5px;
    color: #000;
    border: 1.5px solid #000;
}
.invoice-table td, .invoice-table th {
    border: 1px solid #000;
    padding: 4px 6px;
    line-height: 1.45;
    vertical-align: top;
}
.invoice-title {
    font-size: 15px; font-weight: bold;
    text-align: center; padding: 7px !important;
    background: #f5f5f5;
}
.items-hdr td { background: #f0f0f0; padding: 6px !important; }

/* Invoice cell shorthand classes */
.vt { vertical-align: top !important; }
.vm { vertical-align: middle !important; }
.tc { text-align: center !important; }
.tr { text-align: right !important; }
.fb { font-weight: bold !important; }
.fl { font-size: 9.5px !important; color: #555 !important; }
.fa { font-size: 10.5px; white-space: pre-wrap; }
.hw { width: 48% !important; }
.mt2 { margin-top: 4px !important; }
.mb2 { margin-bottom: 3px !important; }
.mb4 { margin-bottom: 16px !important; }
.no-bt { border-top: none !important; }
.no-bb { border-bottom: none !important; }
.no-br { border-right: none !important; }
.tr-totals td { padding: 3px 6px !important; }
.total-cell { font-size: 13px !important; background: #f9f9f9; }
.sign-cell { text-align: right !important; padding-right: 20px !important; }

/* Signature image in invoice */
.sign-img {
    max-height: 52px;
    max-width: 140px;
    object-fit: contain;
    display: block;
    margin-left: auto;   /* right-align inside the sign-cell */
    margin-top: 4px;
}
.decl-cell { padding: 10px 8px !important; }

/* ══════════════════════════════════
   HISTORY TAB
══════════════════════════════════ */
#panel-history.active { display: block; overflow-y: auto; }
.history-container { max-width: 1000px; margin: 0 auto; padding: 32px 24px; }

.history-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.history-title-wrap h2 { font-size: 22px; font-weight: 700; }
.history-title-wrap p  { font-size: 13px; color: var(--text-2); margin-top: 3px; }

.history-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.export-group { display: flex; align-items: center; gap: 8px; }
.export-group label { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.export-group select {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 7px;
    padding: 8px 12px;
    font-family: inherit; font-size: 13px; cursor: pointer;
}
.btn-export {
    padding: 8px 16px;
    border: none;
    border-radius: 7px;
    font-size: 13px; font-weight: 600;
}
.btn-export.csv  { background: #065f46; color: #6ee7b7; }
.btn-export.csv:hover { background: #047857; }
.btn-export.xlsx { background: #1e3a5f; color: #93c5fd; }
.btn-export.xlsx:hover { background: #1d4ed8; }

.history-search-wrap {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    margin-bottom: 20px;
    color: var(--text-3);
}
#history-search {
    flex: 1; padding: 11px 0;
    background: none; border: none; color: var(--text);
    font-family: inherit; font-size: 14px;
}
#history-search:focus { outline: none; }

/* History List */
.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex; align-items: center; gap: 16px;
    cursor: pointer;
    transition: all .2s;
    animation: slideIn .2s ease;
}
.history-card:hover { border-color: var(--accent); background: #1a2035; transform: translateX(3px); }

.hc-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--accent-s);
    border: 1px solid rgba(37,99,235,.2);
    display: flex; align-items: center; justify-content: center;
    color: #60a5fa; flex-shrink: 0;
}

.hc-body { flex: 1; min-width: 0; }
.hc-invno { font-weight: 700; font-size: 15px; }
.hc-client { font-size: 13px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hc-meta { text-align: right; flex-shrink: 0; }
.hc-amount { font-weight: 700; font-size: 15px; color: #4ade80; }
.hc-date   { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.hc-creator { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Sync badge on history cards */
.sync-badge {
    display: inline-block;
    font-size: 10px; font-weight: 600;
    background: rgba(22,163,74,.15);
    border: 1px solid rgba(22,163,74,.25);
    color: #4ade80;
    border-radius: 100px;
    padding: 1px 7px;
    vertical-align: middle;
    margin-left: 4px;
}

/* Discount badge in invoice preview rows */
.discount-badge {
    font-size: 9px; font-weight: 700;
    background: #fef3c7;
    color: #92400e;
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.history-empty {
    text-align: center; padding: 80px 24px;
    color: var(--text-3);
}
.history-empty svg { margin: 0 auto 16px; display: block; }
.history-empty p { font-size: 15px; line-height: 1.7; }

/* ══════════════════════════════════
   MODAL
══════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
    animation: fadeIn .2s ease;
}
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%; max-width: 560px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    animation: slideUp .25s ease;
    overflow: hidden;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { background: var(--surface2); border: 1px solid var(--border); color: var(--text-2); width: 32px; height: 32px; border-radius: 8px; }
.modal-close:hover { color: var(--text); border-color: #444; }

.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-detail-row {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 9px 0; border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.modal-detail-row:last-child { border-bottom: none; }
.modal-detail-row .key { color: var(--text-2); flex-shrink: 0; }
.modal-detail-row .val { font-weight: 500; text-align: right; max-width: 60%; word-break: break-word; }
.modal-items-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 16px 0 8px; }
.modal-item {
    background: var(--surface2); border-radius: 8px; padding: 10px 14px;
    margin-bottom: 7px; font-size: 13px;
}
.modal-item .mi-desc { font-weight: 600; margin-bottom: 4px; }
.modal-item .mi-meta { color: var(--text-2); font-size: 12px; }

.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    display: flex; gap: 8px; flex-wrap: wrap;
}
.btn-modal-load   { flex: 1; padding: 10px; background: var(--accent); color: #fff; font-weight: 600; }
.btn-modal-load:hover   { background: var(--accent-h); }
.btn-modal-pdf    { flex: 1; padding: 10px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
.btn-modal-pdf:hover    { border-color: #60a5fa; color: #60a5fa; }
.btn-modal-duplicate { padding: 10px 14px; background: rgba(124,58,237,.12); border: 1px solid rgba(124,58,237,.3); color: #c4b5fd; }
.btn-modal-duplicate:hover { background: rgba(124,58,237,.22); }
.btn-modal-delete { padding: 10px 16px; background: rgba(220,38,38,.1); border: 1px solid rgba(220,38,38,.3); color: #fca5a5; }
.btn-modal-delete:hover { background: rgba(220,38,38,.2); }

/* ══════════════════════════════════
   TOAST
══════════════════════════════════ */
.toast {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
    background: #1a2a1a;
    border: 1px solid #16a34a;
    color: #86efac;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px; font-weight: 500;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    animation: fadeInUp .3s ease;
    white-space: nowrap;
}
.toast.error {
    background: #2a1a1a;
    border-color: #dc2626;
    color: #fca5a5;
}

/* ══════════════════════════════════
   ANIMATIONS
══════════════════════════════════ */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shake   { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ══════════════════════════════════
   PRINT
══════════════════════════════════ */
@media print {
    body { background: #fff; overflow: auto; height: auto; }
    .no-print { display: none !important; }
    .app-container { display: block; }
    .preview-area { background: transparent; display: block; overflow: visible; }
    .invoice-wrapper-outer { padding: 0; display: block; overflow: visible; }
    .invoice-wrapper { box-shadow: none; width: 100%; min-height: 0; padding: 0; transform: scale(1) !important; }
}
