:root {
    --bg-body: #f4f7fb;
    --bg-card: rgba(255,255,255,.94);
    --bg-input: #f7f9fc;
    --text-main: #142238;
    --text-muted: #6b7a90;
    --border-color: #e4eaf2;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #06b6d4;
    --success: #059669;
    --whatsapp: #25D366;
    --danger: #e11d48;
    --shadow-sm: 0 2px 8px rgba(22,34,58,.045);
    --shadow-md: 0 12px 30px rgba(22,34,58,.075);
    --shadow-lg: 0 24px 60px rgba(22,34,58,.12);
    --radius: 18px;
}

[data-theme="dark"] {
    --bg-body: #0b1120;
    --bg-card: #111c30;
    --bg-input: #0b1527;
    --text-main: #e8eef9;
    --text-muted: #9baac0;
    --border-color: #26354d;
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --accent: #22d3ee;
    --success: #34d399;
    --danger: #fb7185;
    --shadow-sm: 0 2px 8px rgba(0,0,0,.18);
    --shadow-md: 0 12px 30px rgba(0,0,0,.2);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
      radial-gradient(ellipse at 8% 0%, rgba(99,102,241,.09), transparent 34rem),
      radial-gradient(ellipse at 96% 18%, rgba(6,182,212,.07), transparent 30rem),
      var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    letter-spacing: -.012em;
    transition: background-color 0.25s, color 0.25s;
    min-height: 100vh;
}

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: .85rem clamp(1rem, 3vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--text-main);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-back:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.22rem;
    letter-spacing: -.045em;
    color: var(--text-main);
}

.brand-logo i {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #fff;
    border-radius: 13px;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    box-shadow: 0 8px 18px rgba(79,70,229,.22);
    font-size: 1.2rem;
}

.user-badge {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

/* ==========================================
   BUTTONS & INPUTS
   ========================================== */
button, input, select, textarea {
    font: inherit;
}

button, .btn-primary, .btn-outline, .btn-danger-outline, .btn-whatsapp {
    cursor: pointer;
    border: none;
    border-radius: 11px;
    font-weight: 600;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-decoration: none;
}

button:hover, .btn-primary:hover, .btn-outline:hover, .btn-danger-outline:hover, .btn-whatsapp:hover {
    transform: translateY(-1px);
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(99,102,241,.28);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #ffffff;
    padding: 0.6rem 1.15rem;
    font-size: 0.9rem;
    box-shadow: 0 7px 16px rgba(79,70,229,.18);
}

.btn-primary:hover {
    box-shadow: 0 10px 22px rgba(79,70,229,.26);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.45rem 0.85rem;
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: #fff;
}

.btn-whatsapp {
    background-color: var(--whatsapp);
    color: #fff;
    padding: 0.75rem 1.2rem;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    background-color: #1ebe5b;
}

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.82rem; }
.btn-xs { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 11px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-size: 0.9rem;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,.10);
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}

/* ==========================================
   LANDING PAGE
   ========================================== */
.landing-wrapper {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
}

.hero-section {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-content h1 span {
    color: var(--primary);
}

.hero-content p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.hero-features-mini {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.hero-features-mini i {
    color: var(--success);
}

/* ==========================================
   DESAIN KERTAS KUITANSI & LOGO ADAPTIF
   ========================================== */
.receipt-preview-wrapper {
    overflow-x: auto;
    padding: clamp(.5rem, 2vw, 1.5rem);
}

.receipt-paper {
    background-color: #ffffff !important;
    color: #1e293b !important;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    box-shadow: 0 22px 55px rgba(15,23,42,.13);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.receipt-header {
    background-color: #235789;
    color: #ffffff;
    padding: 1.5rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.receipt-header-brand {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    min-width: 0;
    flex: 1;
}

/* Wadah Logo Anti-Nabrak Warna Tema */
.receipt-logo-box {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s ease;
}

.receipt-logo-box.style-card {
    background-color: #ffffff !important;
    padding: 6px 8px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    max-width: 78px;
    height: 54px;
}

.receipt-logo-box.style-circle {
    background-color: #ffffff !important;
    padding: 6px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    width: 54px;
    height: 54px;
}

.receipt-logo-box.style-transparent {
    background: transparent !important;
    padding: 0;
    max-width: 82px;
    height: 54px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
}

.receipt-logo-box img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.receipt-header-left {
    min-width: 0;
}

.receipt-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
    line-height: 1.15;
    color: #ffffff;
}

.receipt-header p {
    font-size: 0.82rem;
    opacity: 0.92;
    font-weight: 400;
    color: #ffffff;
    line-height: 1.35;
}

.receipt-header, .receipt-header h1, .receipt-header p, .receipt-header .inv-number-badge {
    color: var(--receipt-header-text, #fff) !important;
}

.inv-number-badge {
    background: rgba(255, 255, 255, 0.18);
    padding: 0.3rem 0.65rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.receipt-body {
    padding: 1.5rem 1.75rem 2rem;
}

.receipt-meta {
    margin-bottom: 1.15rem;
}

.meta-client {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.meta-detail {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
}

.receipt-table thead tr {
    background-color: #3b3b3b;
    color: #ffffff;
}

.receipt-table th {
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: left;
}

.receipt-table td {
    padding: 0.75rem 0.75rem;
    font-size: 0.82rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.receipt-table .col-qty {
    text-align: center;
    color: #64748b;
    white-space: nowrap;
}

.receipt-table th.col-qty {
    color: #ffffff;
}

.receipt-table .col-total {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.receipt-summary-box {
    background-color: #e6f0fa;
    padding: 0.75rem 0.85rem;
    border-radius: 3px;
    margin-bottom: 1.15rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #475569;
    padding-bottom: 0.45rem;
    margin-bottom: 0.45rem;
    border-bottom: 1.5px solid #235789;
}

.discount-line {
    color: #dc2626;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 0.88rem;
    color: #1e293b;
}

.summary-total .total-amount {
    font-size: 1.15rem;
    color: #235789;
    font-weight: 800;
}

.amount-in-words {
    margin-top: 10px;
    padding: 10px 12px;
    border-left: 3px solid var(--primary, #235789);
    border-radius: 0 8px 8px 0;
    background: #f3f6fa;
    color: #263449;
    font-size: 12px;
    line-height: 1.6;
    font-style: italic;
    overflow-wrap: anywhere;
}

.receipt-notes {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 2.25rem;
}

.receipt-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 1.5rem;
}

.qr-validation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.qr-validation span {
    font-size: 0.62rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signature-box {
    text-align: left;
    min-width: 155px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.4rem;
}

.signature-box .greeting {
    font-size: 0.75rem;
    color: #475569;
    margin-bottom: 0.25rem;
}

.sig-image {
    max-height: 55px;
    display: block;
    margin: 0.2rem 0;
}

.sig-spacer {
    height: 40px;
}

.signer-name {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
}

.signer-role {
    font-size: 0.72rem;
    font-style: italic;
    color: #64748b;
}

/* Stempel Watermark */
.receipt-Context-stamp {
    position: absolute;
    top: 145px;
    right: 32px;
    padding: 0.25rem 0.85rem;
    font-size: 1.05rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 3px solid;
    border-radius: 6px;
    transform: rotate(-14deg);
    opacity: 0.22;
    pointer-events: none;
}

.stamp-lunas { color: #16a34a; border-color: #16a34a; }
.stamp-dp---termin { color: #d97706; border-color: #d97706; }
.stamp-belum-bayar { color: #dc2626; border-color: #dc2626; }

/* ==========================================
   DASHBOARD & GENERATOR WORKSPACE
   ========================================== */
.dashboard-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 1.25rem;
}

.dash-tabs {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.dash-tab {
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 0.65rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
}

.dash-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    align-items: start;
}

.card, .auth-card, .history-panel, .form-panel, .preview-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.35rem;
    box-shadow: var(--shadow-md);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1.1rem;
    letter-spacing: -.035em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin: 1.25rem 0 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group { margin-bottom: 0.85rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1.2fr 0.7fr; gap: 0.85rem; }

/* Card Upload Logo di Form Editor */
.logo-uploader-card {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1rem;
    align-items: center;
    background: var(--bg-input);
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.95rem;
}

.logo-uploader-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-thumb-preview {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.logo-thumb-preview.is-empty {
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1.35rem;
}

.logo-thumb-preview img {
    max-width: 88%;
    max-height: 88%;
    object-fit: contain;
}

.logo-title-label {
    color: var(--text-main);
    font-size: 0.83rem;
    margin-bottom: 0.1rem;
}

.logo-helper-text {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.logo-btn-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.input-with-btn {
    display: flex;
    gap: 0.35rem;
}

.input-with-btn button {
    padding: 0 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.color-picker {
    height: 38px;
    padding: 3px;
    cursor: pointer;
}

.item-row {
    display: grid;
    grid-template-columns: 1.8fr 0.6fr 1fr auto;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    align-items: center;
}

.btn-remove-item {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    width: 36px;
    height: 36px;
}

.btn-remove-item:hover {
    background: var(--danger);
    color: #fff;
}

.sig-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-text-danger {
    background: none;
    color: var(--danger);
    font-size: 0.78rem;
    padding: 0.2rem;
}

.sig-pad {
    border: 1px dashed var(--border-color);
    background: #ffffff;
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
}

.form-actions-bar {
    display: flex;
    gap: 0.65rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.wa-interactive-card {
    margin-top: 1.25rem;
    background: rgba(37, 211, 102, 0.08);
    border: 1px solid rgba(37, 211, 102, 0.35);
    border-radius: 10px;
    padding: 1rem;
}

.wa-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.wa-header i {
    font-size: 1.75rem;
    color: var(--whatsapp);
}

.wa-header h4 { font-size: 0.95rem; margin-bottom: 0.1rem; }
.wa-header p { font-size: 0.78rem; color: var(--text-muted); }

.wa-style-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.radio-pill {
    cursor: pointer;
    margin: 0;
}

.radio-pill input { display: none; }

.radio-pill span {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.radio-pill input:checked + span {
    background: var(--whatsapp);
    color: #fff;
    border-color: var(--whatsapp);
}

.wa-textarea {
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
}

.sticky-preview {
    position: sticky;
    top: 76px;
}

.preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-unsaved {
    background: #fef3c7;
    color: #d97706;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.badge-saved {
    background: #dcfce7;
    color: #16a34a;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

/* ==========================================
   MODAL AUTH, PASSWORD EYE ICON & SWEETALERT MINI
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 410px;
    border-radius: 18px;
    padding: 1.5rem;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-input);
    padding: 0.3rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
}

.auth-tab {
    background: transparent;
    color: var(--text-muted);
    padding: 0.55rem;
    font-size: 0.88rem;
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon i.icon-left {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-icon input {
    padding-left: 2.35rem !important;
}

.password-wrapper input {
    padding-right: 2.6rem !important;
}

.btn-toggle-pass {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%) !important;
    background: transparent;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.btn-toggle-pass:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-50%) !important;
}

.recaptcha-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.alert-box {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    background: #fee2e2;
    color: #b91c1c;
}

/* SweetAlert2 Mini Custom Styling */
.swal-mini-modal {
    border-radius: 18px !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
    font-family: 'Inter', sans-serif !important;
}

.swal-mini-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
}

.swal-mini-text {
    font-size: 0.86rem !important;
    color: var(--text-muted) !important;
}

.swal-mini-btn {
    font-size: 0.84rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
}

.swal-mini-toast {
    border-radius: 14px !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-md) !important;
    font-size: 0.85rem !important;
}

/* History Table */
.table-responsive { overflow-x: auto; }

.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.history-table thead th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.history-table th, .history-table td {
    padding: .9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.history-table tbody tr:hover {
    background: color-mix(in srgb, var(--primary) 5%, var(--bg-card));
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input { padding-left: 2rem !important; }

/* Public View Container */
.public-container {
    max-width: 680px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.public-action-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.15rem;
    border-radius: 14px;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.public-status-info {
    font-weight: 600;
    font-size: 0.9rem;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Toast Fallback */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #1e293b;
    color: #fff;
    padding: 0.75rem 1.15rem;
    border-radius: 14px;
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================
   RESPONSIVE MOBILE & PRINT MEDIA
   ========================================== */
@media (max-width: 960px) {
    .hero-section, .workspace-grid {
        grid-template-columns: 1fr;
    }
    .hero-content h1 { font-size: 1.9rem; }
    .sticky-preview { position: static; }
}

@media (max-width: 768px) {
    .nav-container { padding: .65rem .85rem; gap: .5rem; }
    .nav-left, .nav-right { gap: .45rem; }
    .brand-logo { font-size: 1rem; gap: .4rem; }
    .brand-logo i { width: 34px; height: 34px; font-size: 1rem; border-radius: 11px; }
    .btn-back { padding: .45rem .65rem; }
    .btn-back span { display: none; }
    .user-badge { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .card, .auth-card, .history-panel, .form-panel, .preview-panel { border-radius: 15px; }
    .panel-header { align-items: stretch; flex-wrap: wrap; }
    .search-box { width: 100%; }
    .search-box input { width: 100%; min-width: 0; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .history-table { min-width: 760px; }
    .form-actions-bar { flex-wrap: wrap; }
    .form-actions-bar button { flex: 1 1 145px; }
    .sticky-preview { position: static !important; }
    .logo-uploader-card { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
    .item-row { grid-template-columns: 1fr 70px 110px auto; }
    .hide-mobile { display: none; }
    .receipt-header, .receipt-body { padding: 1.15rem; }
    .receipt-logo-box.style-card, .receipt-logo-box.style-circle, .receipt-logo-box.style-transparent {
        height: 46px;
    }
    .search-box { width: 100%; margin-top: 0.5rem; }
    .panel-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

@media print {
    body { background: #fff !important; }
    .navbar, .dash-tabs, .editor-panel, .preview-toolbar, .public-action-bar, .toast-container {
        display: none !important;
    }
    .dashboard-container, .workspace-grid, .public-container {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .receipt-paper {
        box-shadow: none !important;
        max-width: 100% !important;
    }
}