/* ===================================================
   Creative ALT Media Group - Ultra-Premium Studio Invoice
   Typography: Roxborough CF, Garet, Lexend Exa, Beautifully Delicious Script
   =================================================== */

/* ===================================================
   Font Declarations
   =================================================== */

/* 1. Roxborough CF (Luxury Serif Headings & Branding) */
@font-face {
    font-family: 'Roxborough CF';
    src: local('Roxborough CF'), local('RoxboroughCF'),
         url('fonts/Roxborough%20CF.ttf') format('truetype'),
         url('fonts/Roxborough CF.ttf') format('truetype');
    font-weight: 300 500;
    font-style: normal;
    font-display: swap;
}

/* 2. Garet (Primary Body & Interface Sans) */
@font-face {
    font-family: 'Garet';
    src: local('Garet'), local('Garet-Book'), local('Garet Book'),
         url('fonts/Garet-Book.woff2') format('woff2'),
         url('fonts/Garet-Book.woff') format('woff'),
         url('fonts/Garet-Book.otf') format('opentype'),
         url('fonts/Garet-Book.ttf') format('truetype');
    font-weight: 300 600;
    font-style: normal;
    font-display: swap;
}

/* 3. Lexend Exa (Technical Metadata & Numbers) */
@font-face {
    font-family: 'Lexend Exa';
    src: local('Lexend Exa Light'), local('LexendExa-Light'),
         url('fonts/LexendExa-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lexend Exa';
    src: local('Lexend Exa'), local('LexendExa-Regular'),
         url('fonts/LexendExa-Regular.ttf') format('truetype'),
         url('fonts/LexendExa.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lexend Exa';
    src: local('Lexend Exa Medium'), local('LexendExa-Medium'),
         url('fonts/LexendExa-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* 4. Beautifully Delicious Script (Handwritten Signature) */
@font-face {
    font-family: 'Beautifully Delicious Script';
    src: local('Beautifully Delicious Script'), local('Beautifully Delicious'), local('BeautifullyDelicious'),
         url('fonts/BeautifullyDelicious.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ===================================================
   Design System Variables (Crisp White Palette)
   =================================================== */
:root {
    /* Color Palette - Clean Crisp White */
    --outer-bg: #F3F4F6;
    --canvas-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --card-hover: #FAFAFA;
    
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;

    --brand-dark: #111827;
    --brand-accent: #0F172A;
    --border-main: #E5E7EB;
    --border-light: #F3F4F6;
    --border-dark: #111827;

    --badge-bg: #F3F4F6;
    --badge-text: #1F2937;
    --status-green: #10B981;
    --status-green-bg: #ECFDF5;

    /* Typography Stacks */
    --font-serif: 'Roxborough CF', 'Instrument Serif', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', 'Garet', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Lexend Exa', 'Space Grotesk', monospace, sans-serif;
    --font-script: 'Caveat', cursive;

    /* Spacing & Flat Geometry (0px radius) */
    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;
    --radius-pill: 0px;
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ===================================================
   Reset & Base Styles
   =================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

body {
    background-color: var(--outer-bg);
    background-image: 
        linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px 60px 16px;
}

/* ===================================================
   Floating Top Action Bar
   =================================================== */
.action-bar {
    position: sticky;
    top: 12px;
    z-index: 1000;
    width: 100%;
    max-width: 820px;
    margin: 0 auto 20px auto;
    padding: 10px 20px;
    background: rgba(17, 24, 39, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #f1f5f9;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: var(--font-sans);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--status-green);
    border-radius: 0px;
    display: inline-block;
    box-shadow: 0 0 8px var(--status-green);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
}

.brand-title {
    font-weight: 500;
    color: #ffffff;
    letter-spacing: -0.1px;
}

.badge-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
}

.brand-subtitle {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 400;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 0px;
    font-size: 12px;
    font-weight: 450;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    outline: none;
    user-select: none;
}

/* ===================================================
   Hugeicons Dualtone SVG Styling
   =================================================== */
.h-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.h-dualtone path[opacity],
.h-dualtone circle[opacity] {
    opacity: 0.42;
}

.btn .h-icon {
    margin-right: 1px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.btn-primary {
    background: #ffffff;
    color: #0F172A;
    border: 1px solid #ffffff;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.25);
}

/* ===================================================
   A4 Centered Studio Invoice Canvas (Optimized for Single Page Print)
   =================================================== */
.invoice-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.invoice-container {
    width: 794px; /* Standard A4 width at 96 DPI */
    min-height: 1060px; /* Standard A4 single page height range */
    background-color: var(--canvas-bg);
    color: var(--text-primary);
    padding: 42px 48px 36px 48px;
    position: relative;
    border: none;
    border-radius: 0px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

/* ===================================================
   SECTION 1: TOP HEADER
   =================================================== */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-main);
    margin-bottom: 18px;
}

/* LEFT: Company Info */
.company-brand-block {
    flex: 1.2;
}

.company-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.company-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
}

.studio-badge {
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 0px;
    border: 1px solid var(--border-main);
}

.company-name {
    font-family: var(--font-serif);
    font-size: 25px;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.company-address {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 10px;
}

.company-phone {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    color: var(--text-primary);
    font-weight: 450;
}

.gst-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--badge-bg);
    border: 1px solid var(--border-main);
    border-radius: 0px;
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.2;
    margin-top: 4px;
}

.gst-label {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.gst-number {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

/* RIGHT: Invoice Meta Panel */
.invoice-meta-panel {
    flex: 0.9;
    background: var(--card-bg);
    border: 1px solid var(--border-main);
    border-radius: 0px;
    padding: 14px 18px;
    box-shadow: var(--shadow-card);
}

.meta-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-main);
}

.doc-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--status-green-bg);
    color: #065F46;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 0px;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-dot {
    width: 5px;
    height: 5px;
    background: var(--status-green);
    border-radius: 0px;
}

.meta-title-label {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 450;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.meta-invoice-number {
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 500;
    color: var(--brand-dark);
    letter-spacing: -0.2px;
    margin-bottom: 10px;
}

.meta-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-main);
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-item .meta-label {
    font-size: 10px;
    font-weight: 450;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.meta-item .meta-val {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 450;
    color: var(--text-primary);
}

/* ===================================================
   SECTION 2: CLIENT INFORMATION (White Billed To Card)
   =================================================== */
.client-section {
    background: var(--card-bg);
    border: 1px solid var(--border-main);
    border-radius: 0px;
    padding: 14px 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-card);
}

.client-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-main);
}

.section-badge {
    font-size: 10px;
    font-weight: 500;
    color: var(--brand-dark);
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.client-id-tag {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 450;
    color: var(--text-muted);
}

.client-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.25fr;
    gap: 20px;
    align-items: flex-start;
}

.client-primary {
    border-right: 1px solid var(--border-main);
    padding-right: 18px;
}

.client-name {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    margin-bottom: 8px;
}

.client-gst-box {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--badge-bg);
    border: 1px solid var(--border-main);
    border-radius: 0px;
    padding: 3px 8px;
    line-height: 1.2;
}

.gst-mini-label {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.client-gst-code {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.client-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.client-info-item {
    display: flex;
    flex-direction: column;
}

.client-info-item .info-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}

.client-info-item .info-label .h-icon {
    color: var(--text-primary);
}

.client-address,
.client-contact {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.4;
}

.client-contact p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

/* ===================================================
   SECTION 3: SERVICES TABLE (Compact Row Heights for Single Page Print)
   =================================================== */
.invoice-table-section {
    margin-bottom: 18px;
}

.table-header-pill {
    background: var(--brand-dark);
    color: #FFFFFF;
    border-radius: 0px;
    display: flex;
    padding: 8px 16px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.col-index {
    flex: 0 0 6%;
    width: 6%;
    color: rgba(255, 255, 255, 0.5);
}

.col-desc {
    flex: 0 0 58%;
    width: 58%;
}

.col-price {
    flex: 0 0 18%;
    width: 18%;
    text-align: right;
    padding-right: 12px;
}

.col-total {
    flex: 0 0 18%;
    width: 18%;
    text-align: right;
}

/* Table Rows - Reduced Padding & Tight Gap */
.table-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.table-row {
    background: var(--card-bg);
    border: 1px solid var(--border-main);
    border-radius: 0px;
    padding: 9px 16px;
    display: flex;
    align-items: flex-start;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: all 0.15s ease;
}

.table-row:hover {
    background: var(--card-hover);
    border-color: #D1D5DB;
}

.table-row .col-index {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 450;
    color: var(--text-muted);
    padding-top: 1px;
}

.table-row .col-desc {
    padding-right: 16px;
}

.table-row .item-name {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1px;
    line-height: 1.25;
}

.table-row .item-subtext {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.35;
}

.table-row .col-price {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 450;
    color: var(--text-secondary);
    padding-top: 1px;
}

.table-row .col-total {
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-top: 1px;
}

.currency {
    font-family: var(--font-sans);
    font-weight: 450;
    margin-right: 2px;
}

.btn-row-del {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
    border-radius: 0px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-row-del:hover {
    background: #DC2626;
    color: #FFFFFF;
    transform: scale(1.08);
}

/* Inline Add Row Button (Edit Mode) */
.table-add-action {
    margin-top: 6px;
}

.btn-table-add {
    width: 100%;
    padding: 8px 16px;
    background: #F9FAFB;
    border: 1px dashed #CBD5E1;
    border-radius: 0px;
    color: var(--brand-dark);
    font-size: 11.5px;
    font-weight: 500;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-table-add:hover {
    background: #EFF6FF;
    border-color: #3B82F6;
    color: #1D4ED8;
}

/* ===================================================
   SECTION 4: PAYMENT DETAILS & TOTALS SUMMARY (Compact Padding)
   =================================================== */
.invoice-bottom-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
    align-items: stretch;
}

/* LEFT: Payment details card */
.payment-box {
    background: var(--card-bg);
    border: 1px solid var(--border-main);
    border-radius: 0px;
    padding: 14px 18px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.payment-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-main);
}

.payment-icon-wrapper {
    width: 30px;
    height: 30px;
    background: var(--badge-bg);
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-dark);
}

.payment-header-text h3 {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.payment-header-text span {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
}

.verified-tag {
    margin-left: auto;
    font-size: 9.5px;
    font-weight: 450;
    color: #059669;
    background: var(--status-green-bg);
    border: 1px solid rgba(5, 150, 105, 0.2);
    padding: 2px 6px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.payment-details-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pay-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    padding: 1px 0;
}

.pay-label {
    color: var(--text-muted);
    font-weight: 400;
}

.pay-val {
    color: var(--text-primary);
    font-weight: 450;
    text-align: right;
}

.pay-val.monospace {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2px;
}

/* RIGHT: Total Summary Card */
.totals-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-main);
    border-radius: 0px;
    padding: 14px 18px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
}

.calc-row .calc-label {
    color: var(--text-secondary);
    font-weight: 450;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tax-tag {
    font-size: 9px;
    font-weight: 450;
    color: var(--text-muted);
    background: var(--badge-bg);
    border: 1px solid var(--border-main);
    padding: 1px 5px;
    border-radius: 0px;
    text-transform: uppercase;
}

.calc-row .calc-val {
    font-family: var(--font-mono);
    font-weight: 450;
    color: var(--text-primary);
    font-size: 12.5px;
}

.calc-divider {
    height: 1px;
    background: var(--border-main);
    margin: 3px 0;
}

.grand-total-row {
    background: var(--brand-dark);
    color: #FFFFFF;
    margin: -4px -8px -4px -8px;
    padding: 10px 12px;
    border-radius: 0px;
}

.grand-total-row .total-label-group {
    display: flex;
    flex-direction: column;
}

.grand-total-row .total-title {
    color: #FFFFFF;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: -0.1px;
}

.grand-total-row .total-curr-tag {
    color: #94A3B8;
    font-size: 9px;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.grand-total-row .grand-val {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.2px;
}

/* ===================================================
   SECTION 5: FOOTER
   =================================================== */
.invoice-footer {
    border-top: 1px solid var(--border-main);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.handwritten-wrapper {
    position: relative;
    display: inline-block;
}

.thanks-script {
    font-family: var(--font-script);
    font-size: 42px;
    font-weight: 600;
    line-height: 0.9;
    color: var(--text-primary);
    display: block;
    transform: rotate(-2.5deg);
    letter-spacing: -0.2px;
}

.thanks-sub {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
    margin-left: 6px;
}

.footer-right {
    text-align: right;
}

.footer-brand {
    font-family: var(--font-serif);
    font-size: 16.5px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    margin-bottom: 3px;
}

.footer-email,
.footer-email a,
.footer-email span {
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 450;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: default;
}

.footer-email a:hover {
    color: var(--text-primary) !important;
    text-decoration: none !important;
}

.footer-note {
    font-size: 9.5px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===================================================
   Inline Editing Mode Highlighting
   =================================================== */
.editing .editable-field[contenteditable="true"] {
    outline: 2px dashed #3B82F6;
    outline-offset: 2px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 0px;
    cursor: text;
    transition: background 0.15s;
}

.editing .editable-field[contenteditable="true"]:hover {
    background: rgba(59, 130, 246, 0.14);
}

.editing .editable-field[contenteditable="true"]:focus {
    outline: 2px solid #2563EB;
    background: rgba(59, 130, 246, 0.2);
}

/* Toast Message */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #111827;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    padding: 10px 18px;
    border-radius: 0px;
    font-size: 12px;
    font-weight: 450;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================
   Responsive Breakpoints
   =================================================== */
@media screen and (max-width: 880px) {
    body {
        padding: 14px 10px 40px 10px;
    }

    .invoice-container {
        width: 100%;
        max-width: 794px;
        min-height: auto;
        padding: 30px 22px 26px 22px;
    }

    .action-bar {
        max-width: 100%;
    }
}

@media screen and (max-width: 680px) {
    body {
        padding: 8px 6px 30px 6px;
    }

    .action-bar {
        flex-direction: column;
        gap: 10px;
        border-radius: 0px;
        padding: 12px 16px;
    }

    .action-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .invoice-container {
        padding: 20px 14px 18px 14px;
        box-shadow: none;
        border-radius: 0px;
    }

    .invoice-header {
        flex-direction: column;
        gap: 16px;
    }

    .client-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .client-primary {
        border-right: none;
        border-bottom: 1px solid var(--border-main);
        padding-right: 0;
        padding-bottom: 12px;
    }

    .client-secondary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .invoice-bottom-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .invoice-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .footer-right {
        text-align: left;
    }

    .table-header-pill {
        padding: 7px 10px;
        font-size: 9.5px;
    }

    .table-row {
        padding: 8px 10px;
    }
}

/* ===================================================
   Print Styles (@media print)
   =================================================== */
@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    html, body {
        background: #FFFFFF !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        width: 100%;
        height: 100%;
    }

    .no-print,
    .action-bar,
    .btn-row-del,
    .toast {
        display: none !important;
    }

    .invoice-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }

    .invoice-container {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        height: 100vh !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 40px 48px 32px 48px !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
    }
}
