/* ==========================================================================
   Invoify Digital Invoice SaaS Platform - Design System & Custom Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --bg-main: #f4f6fa;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-sidebar-active: #3b82f6;
    
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #f8fafc;
    
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    
    --success-color: #10b981;
    --success-light: #ecfdf5;
    
    --warning-color: #f59e0b;
    --warning-light: #fffbeb;
    
    --danger-color: #ef4444;
    --danger-light: #fef2f2;

    --info-color: #06b6d4;
    --info-light: #ecfeff;
    
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    --hover-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
}

/* App Wrapper Layout */
#app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Backdrop Overlay for Mobile Sidebar */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

#sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Navigation */
#sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    transition: transform 0.3s ease, margin-left 0.3s ease;
    z-index: 1040;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

#sidebar::-webkit-scrollbar,
#sidebar .sidebar-menu-wrapper::-webkit-scrollbar,
#sidebar .sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

#sidebar::-webkit-scrollbar-track,
#sidebar .sidebar-menu-wrapper::-webkit-scrollbar-track,
#sidebar .sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb,
#sidebar .sidebar-menu-wrapper::-webkit-scrollbar-thumb,
#sidebar .sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

#sidebar::-webkit-scrollbar-thumb:hover,
#sidebar .sidebar-menu-wrapper::-webkit-scrollbar-thumb:hover,
#sidebar .sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

#sidebar .sidebar-brand {
    padding: 1.25rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background-color: var(--bg-sidebar);
    z-index: 10;
}

#sidebar .sidebar-brand-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#sidebar .sidebar-brand img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

#sidebar .sidebar-brand .brand-title {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-sidebar-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    display: none;
}

.btn-sidebar-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-menu-wrapper,
#sidebar > .sidebar-menu {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

#sidebar .sidebar-menu {
    padding: 1rem 0.75rem;
    list-style: none;
    margin: 0;
    height: auto;
}

#sidebar .menu-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #64748b;
    padding: 0.75rem 0.85rem 0.35rem;
    font-weight: 700;
}

#sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.925rem;
    transition: var(--transition);
    margin-bottom: 0.25rem;
    text-decoration: none;
}

#sidebar .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    transition: var(--transition);
}

#sidebar .nav-link:hover {
    color: #ffffff;
    background-color: var(--bg-sidebar-hover);
}

#sidebar .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    font-weight: 600;
}

#sidebar .sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    flex-shrink: 0;
    background-color: var(--bg-sidebar);
}
.btn-logout-icon {
    color: #ef4444;
    font-size: 1.1rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.btn-logout-icon:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.2);
}


/* Main Content Area */
#main-content {
    flex-grow: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 260px);
    transition: var(--transition);
}

/* Sticky Navbar Header */
#top-navbar {
    min-height: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap !important;
}


.search-bar-wrap {
    position: relative;
    max-width: 380px;
    width: 100%;
}

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

.search-bar-wrap input {
    padding-left: 40px;
    border-radius: var(--radius-lg);
    background-color: var(--bg-main);
    border: 1px solid transparent;
    font-size: 0.9rem;
    height: 40px;
    transition: var(--transition);
}

.search-bar-wrap input:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.nav-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    flex-shrink: 0;
}

/* Dynamic Page Container */
.page-container {
    padding: 1.5rem;
    flex-grow: 1;
    width: 100%;
}

/* Page Header & Breadcrumbs */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.breadcrumb {
    margin-bottom: 0;
    font-size: 0.85rem;
}

/* Form Controls Normalization */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

/* SaaS Metric Cards */
.metric-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.metric-card .icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
}

.metric-card.primary .icon-wrapper { background-color: var(--primary-light); color: var(--primary-color); }
.metric-card.success .icon-wrapper { background-color: var(--success-light); color: var(--success-color); }
.metric-card.warning .icon-wrapper { background-color: var(--warning-light); color: var(--warning-color); }
.metric-card.danger .icon-wrapper  { background-color: var(--danger-light);  color: var(--danger-color); }
.metric-card.info .icon-wrapper    { background-color: var(--info-light);    color: var(--info-color); }

.metric-card .metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    word-break: break-word;
}

.metric-card .metric-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* SaaS Content Cards */
.saas-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    width: 100%;
}

.saas-card .card-header {
    padding: 1rem 1.25rem;
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.saas-card .card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.saas-card .card-body {
    padding: 1.25rem;
}

/* Data Tables & Responsive Adapters */
.table-responsive {
    width: 100%;
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-custom {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.table-custom th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-custom td {
    padding: 0.55rem 0.5rem;
    vertical-align: middle;
    font-size: 0.82rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.table-compact th {
    font-size: 0.7rem !important;
    padding: 0.55rem 0.4rem !important;
    letter-spacing: 0.4px !important;
}

.table-compact td {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.4rem !important;
}

@media (min-width: 992px) {
    .table-responsive {
        overflow-x: hidden !important;
    }
}

    background-color: #f8fafc;
}

/* Badges */
.badge-status {
    padding: 0.35em 0.75em;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 30px;
    text-transform: capitalize;
    display: inline-block;
}

.badge-status.active { background-color: var(--success-light); color: var(--success-color); }
.badge-status.inactive { background-color: var(--danger-light); color: var(--danger-color); }

/* Modals */
.modal-dialog {
    max-width: 90%;
    margin: 1.75rem auto;
}

@media (min-width: 576px) {
    .modal-dialog { max-width: 500px; }
    .modal-dialog.modal-lg { max-width: 800px; }
    .modal-dialog.modal-xl { max-width: 1140px; }
}

.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(85vh - 130px);
    overflow-y: auto;
}

.modal-footer {
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* Auth View Layout */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 1.5rem 1rem;
    width: 100%;
}

.auth-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    padding: 2.25rem 2rem;
}

.auth-card.wide {
    max-width: 860px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand h2 {
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

/* Tabs & Step Navigation */
.step-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.75rem;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.step-nav .step-item {
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: var(--transition);
}

.step-nav .step-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ==========================================================================
   INVOICE CREATE & REAL A4 LIVE PREVIEW STYLES (WYSIWYG)
   ========================================================================== */
.inv-create-wrapper {
    display: flex;
    gap: 0;
    height: calc(100vh - 70px);
    max-height: calc(100vh - 70px);
    width: 100%;
    overflow: hidden;
}

/* LEFT FORM PANEL (Independent Scroll) */
.inv-form-panel {
    width: 44%;
    height: 100%;
    max-height: 100%;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    background: var(--bg-main);
    border-right: 1.5px solid var(--border-color);
    box-sizing: border-box;
}

/* RIGHT PREVIEW PANEL (Independent Scroll) */
.inv-preview-panel {
    width: 56%;
    height: 100%;
    max-height: 100%;
    flex-grow: 1;
    overflow: hidden;
    background: #cbd5e1;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-sizing: border-box;
}

/* Sleek Independent Scrollbars */
.inv-form-panel::-webkit-scrollbar,
.inv-preview-panel::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.inv-form-panel::-webkit-scrollbar-track,
.inv-preview-panel::-webkit-scrollbar-track {
    background: transparent;
}

.inv-form-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
}

.inv-form-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

.inv-preview-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.inv-preview-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Toolbar Header above Preview - Strictly Single Row */
.preview-panel-header {
    width: 100%;
    max-width: 794px;
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap !important;
    margin-bottom: 12px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 6px 10px;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.preview-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.preview-panel-header .preview-title {
    color: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.preview-badge {
    font-size: 9.5px;
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}

.preview-panel-header .preview-title .dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* Zoom Controls */
.preview-zoom-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255,255,255,0.06);
    padding: 2px 4px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-zoom {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-zoom span.zoom-label {
    display: none !important;
}

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

.zoom-level-text {
    color: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    min-width: 34px;
    text-align: center;
}

.btn-download-pdf {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
    flex-shrink: 0;
    margin-left: auto;
}

.btn-download-pdf:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99,102,241,0.5);
    color: white;
}

/* A4 Viewport & Scaling Outer Container */
.inv-a4-viewport {
    width: 100%;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    padding: 16px 0;
    box-sizing: border-box;
}

.inv-a4-scale-container {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.22);
    border-radius: 4px;
    background: #ffffff;
    transition: width 0.15s ease-out, height 0.15s ease-out;
}

.inv-a4-scale-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 794px;
    height: 1123px;
    transform-origin: top left;
    transition: transform 0.15s ease-out;
    background: #ffffff;
}

/* Fixed A4 Paper Canvas (210mm x 297mm @ 96DPI => 794px x 1123px) */
.inv-a4-canvas,
.gst-a4-wrap,
.sb-a4-wrap {
    width: 794px;
    height: 1123px;
    max-height: 1123px;
    background: #ffffff;
    color: #111111;
    box-sizing: border-box;
    padding: 36px 40px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gst-frame,
.sb-frame,
.pv-gst-wrap {
    width: 100%;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    overflow: hidden;
}

.inv-a4-canvas table,
.gst-a4-wrap table,
.sb-a4-wrap table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.inv-a4-canvas td, .inv-a4-canvas th,
.gst-a4-wrap td, .gst-a4-wrap th,
.sb-a4-wrap td, .sb-a4-wrap th {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Floating Sticky Mobile Actions Bar (< 768px) */
.mobile-sticky-actions {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f172a;
    padding: 10px 16px;
    z-index: 1020;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
}

.mobile-sticky-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
}

/* ==========================================================================
   MODERN SAAS LANDING PAGE DESIGN SYSTEM & UTILITIES
   ========================================================================== */

/* Hero Section & Backgrounds */
.hero-section-saas {
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 70%);
    color: #ffffff;
    padding: 5.5rem 0 6.5rem;
    position: relative;
    overflow: hidden;
}
.hero-section-saas::before {
    content: '';
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.25) 0%, rgba(37, 99, 235, 0) 70%);
    pointer-events: none;
}

.hero-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.25;
    pointer-events: none;
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.hero-badge-saas {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #93c5fd;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.hero-title-accent {
    background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Floating UI Widgets in Hero Preview */
.hero-mockup-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.hero-mockup-img {
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.4s ease;
}

.floating-chip {
    position: absolute;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 0.825rem;
    font-weight: 700;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: floatWidget 4s ease-in-out infinite alternate;
    z-index: 10;
}

.floating-chip-1 {
    top: 15%;
    left: -20px;
}

.floating-chip-2 {
    bottom: 12%;
    right: -15px;
    animation-delay: 2s;
}

@keyframes floatWidget {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-10px); }
}

/* Floating Stats Section Bar */
.saas-stats-bar {
    position: relative;
    margin-top: -3.5rem;
    z-index: 20;
}

.saas-stats-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.08);
}

.stat-item {
    padding: 1.5rem 1rem;
    border-right: 1px solid #f1f5f9;
}
.stat-item:last-child {
    border-right: none;
}

/* Section Header Typography */
.section-tag {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 0.775rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Cards & Hover Animations */
.saas-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.saas-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.icon-box-saas {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}
.icon-box-primary { background: #eff6ff; color: #2563eb; }
.icon-box-success { background: #ecfdf5; color: #10b981; }
.icon-box-warning { background: #fffbeb; color: #f59e0b; }
.icon-box-info { background: #ecfeff; color: #06b6d4; }
.icon-box-danger { background: #fef2f2; color: #ef4444; }

/* Pricing Cards */
.card-pricing {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.card-pricing:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.09);
}

.card-pricing-popular {
    border: 2px solid var(--primary-color);
    box-shadow: 0 15px 35px -5px rgba(37, 99, 235, 0.15);
}

.popular-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 0.725rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* FAQ Accordion Styling */
.saas-accordion .accordion-item {
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 0.85rem;
    overflow: hidden;
    transition: var(--transition);
}

.saas-accordion .accordion-button {
    font-weight: 700;
    color: #0f172a;
    background-color: #ffffff;
    padding: 1.2rem 1.5rem;
    box-shadow: none !important;
}

.saas-accordion .accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: #f8fafc;
}

.saas-accordion .accordion-body {
    padding: 1.25rem 1.5rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Page Hero Banner for Inner Marketing Pages */
.page-hero-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 4rem 0 4.5rem;
    position: relative;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (320px to 2560px)
   ========================================================================== */

/* Ultra Wide Desktops (>= 1600px) */
@media (min-width: 1600px) {
    .inv-form-panel { width: 42%; }
    .inv-preview-panel { width: 58%; }
}

@media (min-width: 1920px) {
    .inv-form-panel { width: 40%; }
    .inv-preview-panel { width: 60%; }
}

/* Standard Desktops / Laptops (992px to 1199.98px) */
@media (max-width: 1199.98px) {
    .inv-form-panel { width: 46%; padding: 1rem 0.75rem; }
    .inv-preview-panel { width: 54%; padding: 1rem 0.75rem; }
}

/* Tablets (768px to 991.98px) */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.show {
        transform: translateX(0);
    }
    .btn-sidebar-close {
        display: block;
    }
    #main-content {
        margin-left: 0;
        width: 100%;
    }
    .inv-create-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .inv-form-panel {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        overflow-y: visible;
    }
    .inv-preview-panel {
        width: 100%;
        overflow-y: visible;
        padding: 1.25rem 0.75rem;
    }
}

/* Mobile Devices (< 768px) */
@media (max-width: 767.98px) {
    #top-navbar {
        padding: 0.5rem 1rem;
    }
    .page-container {
        padding: 1rem 0.75rem;
    }
    .page-header {
        margin-bottom: 1rem;
    }
    .page-title {
        font-size: 1.25rem;
    }
    .search-bar-wrap {
        max-width: 100%;
        order: 3;
        margin-top: 0.5rem;
    }
    .mobile-sticky-actions {
        display: flex;
        gap: 10px;
    }
    .inv-form-panel {
        padding: 1rem 0.75rem 4rem 0.75rem;
    }
    .preview-panel-header {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }
    .preview-zoom-controls {
        justify-content: center;
    }
    .btn-download-pdf {
        justify-content: center;
    }
    .auth-card {
        padding: 1.75rem 1.25rem;
    }
}

/* Small Mobile Screens (320px to 480px) */
@media (max-width: 480px) {
    .btn-zoom span.zoom-label {
        display: none;
    }
    .table-custom th, .table-custom td {
        padding: 0.65rem 0.5rem;
        font-size: 0.8rem;
    }
    .metric-card {
        padding: 1rem;
    }
    .metric-card .metric-value {
        font-size: 1.4rem;
    }
}

/* ==========================================================================
   PRINT CSS (PDF SAFE & CLEAN DRAFT HIDING)
   ========================================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    body, html {
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
    }
    #sidebar, #sidebar-overlay, #top-navbar, .preview-panel-header, .mobile-sticky-actions, .no-print, .print-action-bar {
        display: none !important;
    }
    #main-content, .inv-create-wrapper, .inv-preview-panel, .inv-a4-viewport, .invoice-canvas {
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm !important;
        background: transparent !important;
        display: block !important;
    }
    .inv-a4-scale-wrapper, .invoice-shadow-wrap {
        transform: scale(1) !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        background: #ffffff !important;
    }
    .inv-a4-canvas, .gst-a4-wrap, .sb-a4-wrap {
        margin: 0 !important;
        width: 210mm !important;
        min-height: 297mm !important;
        height: 297mm !important;
        padding: 12.7mm !important; /* Fixed 0.5 inch (12.7mm) margin */
        box-sizing: border-box !important;
        background: #ffffff !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
    }
}

/* ==========================================================================
   PREMIUM SAAS USER DASHBOARD UI/UX STYLES
   ========================================================================== */

/* Typography & Variables */
body {
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
}
.brand-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Glassmorphism & Soft Shadow SaaS Cards */
.glass-card, .saas-card-v2 {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.glass-card:hover, .saas-card-v2:hover {
    box-shadow: 0 12px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
}

/* Responsive Overview Summary Grid (4-6 columns Desktop, 2-3 Tablet, 1 Mobile) */
.saas-grid-summary {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
}
@media (max-width: 1599px) {
    .saas-grid-summary {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 1199px) {
    .saas-grid-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 767px) {
    .saas-grid-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .saas-grid-summary {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Equal-Height SaaS Stat Cards */
.saas-stat-card {
    position: relative;
    padding: 1.25rem;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 120px;
}
.saas-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.07);
}
.saas-stat-card .stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.saas-stat-card .stat-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}
.saas-stat-card:hover .stat-icon-box {
    transform: scale(1.1);
}
.saas-stat-card .stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}
.saas-stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

/* Color Accent Variations for Stat Cards */
.saas-stat-card.accent-primary { border-top: 3px solid #3b82f6; }
.saas-stat-card.accent-primary .stat-icon-box { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }

.saas-stat-card.accent-success { border-top: 3px solid #10b981; }
.saas-stat-card.accent-success .stat-icon-box { background: rgba(16, 185, 129, 0.12); color: #10b981; }

.saas-stat-card.accent-info { border-top: 3px solid #06b6d4; }
.saas-stat-card.accent-info .stat-icon-box { background: rgba(6, 182, 212, 0.12); color: #06b6d4; }

.saas-stat-card.accent-warning { border-top: 3px solid #f59e0b; }
.saas-stat-card.accent-warning .stat-icon-box { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.saas-stat-card.accent-danger { border-top: 3px solid #ef4444; }
.saas-stat-card.accent-danger .stat-icon-box { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.saas-stat-card.accent-purple { border-top: 3px solid #8b5cf6; }
.saas-stat-card.accent-purple .stat-icon-box { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }

.saas-stat-card.accent-teal { border-top: 3px solid #14b8a6; }
.saas-stat-card.accent-teal .stat-icon-box { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }

.saas-stat-card.accent-dark { border-top: 3px solid #334155; }
.saas-stat-card.accent-dark .stat-icon-box { background: rgba(51, 65, 85, 0.12); color: #334155; }

/* Quick Action Grid Section */
.quick-actions-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 1200px) {
    .quick-actions-bar {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 576px) {
    .quick-actions-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: all 0.25s ease;
    cursor: pointer;
}
.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    border-color: #3b82f6;
    color: #2563eb;
}
.quick-action-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Invoice Status Breakdown Grid Widget */
.status-grid-widget {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
}
@media (max-width: 1200px) {
    .status-grid-widget {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 768px) {
    .status-grid-widget {
        grid-template-columns: repeat(2, 1fr);
    }
}
.status-widget-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem;
    text-align: center;
    transition: all 0.2s ease;
}
.status-widget-item:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}
.status-widget-item .st-count {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.2rem;
}
.status-widget-item .st-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

/* Chart Canvas Wrapper */
.chart-container-saas {
    position: relative;
    width: 100%;
    height: 280px;
}
.chart-container-saas.doughnut-container {
    height: 240px;
}

/* Activity Log Timeline */
.timeline-saas {
    position: relative;
    padding-left: 1.5rem;
}
.timeline-saas::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 7px;
    width: 2px;
    background: #e2e8f0;
}
.timeline-item-saas {
    position: relative;
    padding-bottom: 1.25rem;
}
.timeline-item-saas:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Collapsible Desktop Sidebar Styles */
#sidebar.sidebar-collapsed {
    width: 80px !important;
}
#sidebar.sidebar-collapsed .brand-title,
#sidebar.sidebar-collapsed .brand-badge,
#sidebar.sidebar-collapsed .sidebar-menu span,
#sidebar.sidebar-collapsed .menu-header,
#sidebar.sidebar-collapsed .user-info {
    display: none !important;
}
#sidebar.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 1rem 0.5rem;
}
#sidebar.sidebar-collapsed .sidebar-menu a {
    justify-content: center;
    padding: 0.85rem 0;
}
#sidebar.sidebar-collapsed .sidebar-menu i {
    margin-right: 0 !important;
    font-size: 1.3rem;
}
#sidebar.sidebar-collapsed .sidebar-footer {
    justify-content: center;
    padding: 1rem 0.5rem;
}
#sidebar.sidebar-collapsed ~ #main-content {
    margin-left: 80px !important;
}
.btn-sidebar-collapse {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.btn-sidebar-collapse:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Header & Global Search Bar */
.top-navbar-saas {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    height: 70px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.global-search-wrapper {
    position: relative;
    width: 380px;
}
.global-search-wrapper .search-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 0.9rem;
}
.global-search-input {
    padding-left: 2.4rem;
    padding-right: 4.5rem;
    border-radius: 99px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.875rem;
    height: 40px;
    transition: all 0.2s ease;
}
.global-search-input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.search-kbd-hint {
    position: absolute;
    right: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px 6px;
    pointer-events: none;
}
.btn-primary-saas {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-primary-saas:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.avatar-circle-nav {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

