/* Base tokens */
:root {
    --primary: #1a237e;
    --secondary: #2f3b52;
    --success: #2e7d32;
    --accent: #3f51b5;
    --bg: #f3f6fb;
    --bg-dark: #0f172a;
    --card: #ffffff;
    --border: #e6e9f2;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    --soft-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: radial-gradient(circle at top right, #e4edff 0%, #f3f6fb 40%, #f9fbff 100%);
    color: #1f2937;
    margin: 0;
}

a {
    text-decoration: none;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary) !important;
}

.site-header {
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.site-header .container {
    min-height: 74px;
}

.site-header .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
}

.site-header .navbar-brand i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 35, 126, 0.1);
    color: var(--primary);
    font-size: 15px;
}

.navbar .nav-link {
    color: #334155;
    font-weight: 600;
    border-radius: 10px;
    padding: 8px 14px;
}

.navbar .nav-link:hover {
    color: var(--primary);
    background: rgba(26, 35, 126, 0.08);
}

.site-header .navbar-toggler {
    border-color: var(--border);
}

.site-header .btn {
    border-radius: 10px;
    font-weight: 600;
    padding-inline: 14px;
}

/* Auth pages */
.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(120deg, #f7f9ff, #eef3ff);
}

.auth-wrapper {
    width: min(420px, 92vw);
    margin: auto;
    padding-block: 24px;
}

.auth-body .site-header,
.auth-body .site-footer {
    width: 100%;
}

.auth-body .site-header {
    margin-bottom: 12px;
}

.auth-body .site-footer {
    margin-top: 12px;
}

.auth-card {
    background: var(--card);
    padding: 32px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 18px;
}

.auth-card .form-control {
    border-radius: 12px;
    border-color: #d9e0f1;
}

.auth-card .btn-primary {
    background: var(--primary);
    border: none;
    border-radius: 12px;
}

/* Dashboard shell */
.saas-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 280px;
}

.sidebar {
    background: var(--bg-dark);
    color: #e2e8f0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    grid-column: 2;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-user {
    background: rgba(255, 255, 255, 0.08);
    padding: 16px;
    border-radius: 14px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav a {
    padding: 12px 14px;
    border-radius: 12px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.main-content {
    padding: 32px 40px 40px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.stat-value {
    color: var(--primary);
    font-size: 26px;
    line-height: 1.2;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 24px;
    align-items: start;
}

.card {
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--soft-shadow);
}

.form-card {
    padding: 24px;
}

.form-card .btn-primary {
    background: var(--primary);
    border: none;
    border-radius: 12px;
}

.form-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
}

.invoice-preview {
    background: var(--card);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--border);
    box-shadow: var(--soft-shadow);
}

.invoice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.invoice-head h2 {
    margin: 0;
    font-weight: 700;
}

.invoice-badge {
    display: inline-flex;
    margin-top: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(26, 35, 126, 0.08);
    color: var(--primary);
    font-weight: 700;
    font-size: 12px;
}

.invoice-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.invoice-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.qr-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.qr-block img {
    width: 160px;
    height: 160px;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 6px;
    background: #fff;
}

.qr-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 12px;
    border: 1px dashed #cbd5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: #6b7280;
}

.totals {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.totals div {
    display: flex;
    justify-content: space-between;
}

.totals .total {
    font-weight: 700;
    font-size: 18px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.table-card {
    margin-top: 24px;
    padding: 24px;
}

.table-card .table thead th {
    color: var(--secondary);
    font-weight: 700;
}

.table-card .table tbody tr.row-active {
    background: rgba(26, 35, 126, 0.06);
}

.table-card .table tbody tr.row-active td {
    border-color: rgba(26, 35, 126, 0.18);
}

.brand-color {
    color: var(--primary);
}

.badge.bg-success {
    background-color: var(--success) !important;
}

/* Footer */
.footer-dark {
    background: var(--bg-dark);
    color: #cbd5f5;
    padding: 28px 0;
    margin-top: 40px;
}

.site-footer {
    border-top: 1px solid rgba(203, 213, 245, 0.14);
}

.site-footer strong {
    color: #ffffff;
    font-size: 18px;
}

.site-footer p {
    margin-top: 6px;
    color: #cbd5f5;
}

.site-footer .row {
    row-gap: 12px;
}

.site-footer hr {
    opacity: 0.45;
    margin: 18px 0 14px;
}

.footer-dark a {
    color: #cbd5f5;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-dark a:hover {
    color: #ffffff;
}

/* Dashboard layout helpers */
.dashboard-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 280px;
}

.dashboard-layout .sidebar {
    grid-column: 2;
}

.dashboard-layout .main-content {
    grid-column: 1;
}

/* Bottom nav for mobile */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: var(--shadow);
    display: none;
    padding: 10px 14px;
    z-index: 999;
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    color: var(--secondary);
    font-size: 14px;
    font-weight: 600;
}

.bottom-nav a i {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
}

/* Official invoice preview */
.official-invoice {
    background: #ffffff;
    border: 1px solid #d9dde8;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    font-family: 'Tajawal', sans-serif;
    position: relative;
}

.official-invoice::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 14px;
    border-bottom: 1px dashed #cbd5f5;
}

.official-invoice h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

.official-invoice .receipt-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    color: #4b5563;
    font-size: 14px;
}

.official-invoice .receipt-total {
    border-top: 1px dashed #cbd5f5;
    padding-top: 12px;
    font-weight: 700;
}

/* Error pages */
.error-page {
    min-height: calc(100vh - 260px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-card {
    width: min(760px, 100%);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--soft-shadow);
    padding: 36px 28px;
    text-align: center;
}

.error-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: rgba(26, 35, 126, 0.1);
    color: var(--primary);
    padding: 8px 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.error-code {
    font-size: clamp(52px, 10vw, 92px);
    line-height: 1;
    margin: 0;
    font-weight: 700;
    color: var(--primary);
}

.error-title {
    margin: 12px 0 10px;
    font-size: clamp(24px, 3.2vw, 32px);
    font-weight: 700;
    color: #1f2937;
}

.error-message {
    margin: 0 auto;
    max-width: 620px;
    color: #4b5563;
    font-size: 18px;
}

.error-hint {
    margin-top: 14px;
    color: #64748b;
    font-size: 14px;
}

.error-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.error-actions .btn {
    min-width: 148px;
    border-radius: 12px;
    font-weight: 700;
}

/* Subscriptions page */
.pricing-page {
    padding: 44px 0;
}

.pricing-head {
    text-align: center;
    margin-bottom: 26px;
}

.pricing-head h1 {
    margin: 0;
    font-weight: 700;
    color: var(--primary);
}

.pricing-head p {
    margin: 10px 0 0;
    color: #4b5563;
}

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

.plan-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--soft-shadow);
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
}

.plan-card.featured {
    border-color: rgba(26, 35, 126, 0.35);
    transform: translateY(-4px);
}

.plan-name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.plan-note {
    margin: 8px 0 0;
    color: #64748b;
    min-height: 42px;
}

.plan-price {
    margin: 18px 0 14px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.plan-price strong {
    font-size: 34px;
    color: var(--primary);
    line-height: 1;
}

.plan-price span {
    color: #64748b;
    font-weight: 600;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
}

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

.plan-card .btn {
    margin-top: auto;
    border-radius: 12px;
    font-weight: 700;
}

.current-plan-card {
    border-radius: 16px;
}

.checkout-page .card {
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--soft-shadow);
}

.checkout-summary h1 {
    color: var(--primary);
}

.checkout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.checkout-row.total {
    border-bottom: 0;
    padding-bottom: 0;
}

.checkout-row.total strong {
    color: var(--primary);
    font-size: 24px;
}

.template-badge {
    margin: 10px 0 0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.invoice-preview {
    --inv-accent: #1a237e;
    --inv-accent-soft: rgba(26, 35, 126, 0.1);
    --inv-accent-border: rgba(26, 35, 126, 0.28);
}

.invoice-preview .brand-color {
    color: var(--inv-accent) !important;
}

.invoice-preview .invoice-badge,
.invoice-preview .template-badge {
    background: var(--inv-accent-soft);
    color: var(--inv-accent);
}

.invoice-preview .invoice-lines thead {
    border-bottom: 1px solid var(--inv-accent-border);
}

.invoice-preview .totals .total {
    color: var(--inv-accent);
    border-top-color: var(--inv-accent-border);
}

.invoice-color-name {
    margin-top: 6px;
}

.invoice-preview.invoice-color-indigo {
    --inv-accent: #1a237e;
    --inv-accent-soft: rgba(26, 35, 126, 0.1);
    --inv-accent-border: rgba(26, 35, 126, 0.28);
}

.invoice-preview.invoice-color-emerald {
    --inv-accent: #047857;
    --inv-accent-soft: rgba(4, 120, 87, 0.12);
    --inv-accent-border: rgba(4, 120, 87, 0.3);
}

.invoice-preview.invoice-color-sunset {
    --inv-accent: #c2410c;
    --inv-accent-soft: rgba(194, 65, 12, 0.12);
    --inv-accent-border: rgba(194, 65, 12, 0.3);
}

.invoice-preview.invoice-color-rose {
    --inv-accent: #be185d;
    --inv-accent-soft: rgba(190, 24, 93, 0.12);
    --inv-accent-border: rgba(190, 24, 93, 0.3);
}

.invoice-preview.invoice-color-ocean {
    --inv-accent: #0369a1;
    --inv-accent-soft: rgba(3, 105, 161, 0.12);
    --inv-accent-border: rgba(3, 105, 161, 0.3);
}

.invoice-preview.invoice-color-amber {
    --inv-accent: #b45309;
    --inv-accent-soft: rgba(180, 83, 9, 0.12);
    --inv-accent-border: rgba(180, 83, 9, 0.3);
}

.invoice-preview.invoice-color-graphite {
    --inv-accent: #374151;
    --inv-accent-soft: rgba(55, 65, 81, 0.12);
    --inv-accent-border: rgba(55, 65, 81, 0.3);
}

.template-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.template-chip {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #d6dbe8;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.template-chip.active {
    border-color: rgba(26, 35, 126, 0.35);
    color: var(--primary);
    background: rgba(26, 35, 126, 0.08);
}

.template-chip.locked {
    opacity: 0.6;
}

.invoice-preview .table thead th {
    color: #334155;
    font-weight: 700;
}

.invoice-preview .table tbody td {
    border-color: #e5e7eb;
}

.invoice-preview .invoice-section-head {
    grid-area: head;
}

.invoice-preview .invoice-section-meta {
    grid-area: meta;
}

.invoice-preview .invoice-lines {
    grid-area: lines;
}

.invoice-preview .invoice-template-name {
    grid-area: badge;
}

.invoice-preview .invoice-section-footer {
    grid-area: footer;
}

.invoice-template-modern {
    border-color: rgba(26, 35, 126, 0.28);
    background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
    border-top: 6px solid rgba(26, 35, 126, 0.65);
    display: grid;
    grid-template-areas:
        'head head'
        'meta badge'
        'lines lines'
        'footer footer';
    grid-template-columns: 1fr auto;
    gap: 14px 18px;
}

.invoice-template-modern .invoice-head {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.invoice-template-executive {
    border-color: #0f172a;
    background: #ffffff;
    display: grid;
    grid-template-areas:
        'head head'
        'lines meta'
        'lines footer'
        'badge footer';
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: 16px 18px;
}

.invoice-template-executive .invoice-head {
    background: #0f172a;
    color: #ffffff;
    border-radius: 14px;
    padding: 16px;
}

.invoice-template-executive .invoice-head .text-muted,
.invoice-template-executive .invoice-meta .text-muted {
    color: #94a3b8 !important;
}

.invoice-template-executive .invoice-badge {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.invoice-template-executive .invoice-section-footer {
    margin-top: 0;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 14px;
}

.invoice-template-executive .invoice-qr {
    align-items: center;
}

.invoice-template-minimal {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: none;
    border-radius: 10px;
    display: grid;
    grid-template-areas:
        'head'
        'meta'
        'lines'
        'footer'
        'badge';
    grid-template-columns: 1fr;
    gap: 10px;
}

.invoice-template-minimal .invoice-head,
.invoice-template-minimal .invoice-meta {
    margin-bottom: 12px;
}

.invoice-template-minimal .invoice-badge,
.invoice-template-minimal .template-badge {
    background: transparent;
    border: 1px solid #d1d5db;
}

.invoice-template-minimal .invoice-section-footer {
    grid-template-columns: 1fr;
    gap: 8px;
}

.invoice-template-minimal .invoice-qr {
    order: 2;
}

.invoice-template-minimal .invoice-totals {
    order: 1;
}

.invoice-template-bordered {
    border: 2px solid rgba(26, 35, 126, 0.28);
    background: #ffffff;
    display: grid;
    grid-template-areas:
        'head head'
        'meta lines'
        'badge lines'
        'footer footer';
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
    gap: 14px;
}

.invoice-template-bordered .invoice-head,
.invoice-template-bordered .invoice-meta,
.invoice-template-bordered .invoice-footer {
    border: 1px solid rgba(26, 35, 126, 0.16);
    border-radius: 12px;
    padding: 12px;
}

.invoice-template-bordered .totals .total {
    border-top: 2px solid rgba(26, 35, 126, 0.22);
}

.invoice-template-bordered .invoice-lines {
    margin: 0;
}

.invoice-template-compact {
    padding: 22px;
    border-radius: 14px;
    display: grid;
    grid-template-areas:
        'head badge'
        'meta meta'
        'lines footer';
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    gap: 12px;
}

.invoice-template-compact h2 {
    font-size: 22px;
}

.invoice-template-compact .invoice-head {
    margin-bottom: 14px;
}

.invoice-template-compact .invoice-meta {
    margin-bottom: 14px;
}

.invoice-template-compact .invoice-footer {
    margin-top: 14px;
    gap: 12px;
}

.invoice-template-compact .invoice-section-footer {
    margin-top: 0;
    grid-template-columns: 1fr;
    align-content: start;
}

.invoice-template-compact .table td,
.invoice-template-compact .table th {
    padding-top: 6px;
    padding-bottom: 6px;
}

.invoice-template-split {
    background: linear-gradient(90deg, rgba(26, 35, 126, 0.06) 0 26%, #ffffff 26% 100%);
    border-color: rgba(26, 35, 126, 0.24);
    display: grid;
    grid-template-areas:
        'meta head'
        'footer lines'
        'footer badge';
    grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
    gap: 16px;
}

.invoice-template-split .invoice-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.invoice-template-split .invoice-footer {
    border-top: 1px dashed rgba(26, 35, 126, 0.28);
    padding-top: 16px;
    margin-top: 0;
    border-top: 0;
    border-left: 1px dashed rgba(26, 35, 126, 0.28);
    padding-left: 12px;
    grid-template-columns: 1fr;
    align-content: start;
}

.invoice-template-split .invoice-head h2,
.invoice-template-split .brand-color {
    color: var(--primary);
}

.invoice-template-slate {
    border-color: rgba(47, 59, 82, 0.24);
    background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
    display: grid;
    grid-template-areas:
        'head meta'
        'lines lines'
        'badge footer';
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    gap: 14px;
}

.invoice-template-slate .invoice-badge {
    background: rgba(47, 59, 82, 0.12);
    color: var(--secondary);
}

.invoice-template-slate .table thead {
    background: rgba(47, 59, 82, 0.08);
}

.invoice-template-royal {
    border-color: rgba(26, 35, 126, 0.34);
    background: linear-gradient(165deg, rgba(26, 35, 126, 0.08) 0%, #ffffff 40%);
    display: grid;
    grid-template-areas:
        'head'
        'badge'
        'meta'
        'lines'
        'footer';
    grid-template-columns: 1fr;
    gap: 12px;
}

.invoice-template-royal .invoice-head {
    border-bottom: 1px solid rgba(26, 35, 126, 0.18);
    padding-bottom: 12px;
    text-align: center;
}

.invoice-template-royal .invoice-meta {
    justify-content: center;
    gap: 40px;
}

.invoice-template-royal .invoice-section-footer {
    max-width: 460px;
    margin-inline: auto;
}

.invoice-template-royal .invoice-badge,
.invoice-template-royal .template-badge {
    background: rgba(26, 35, 126, 0.14);
    color: var(--primary);
}

.invoice-template-mono {
    border-color: #d1d5db;
    background: #ffffff;
    display: grid;
    grid-template-areas:
        'meta head'
        'lines lines'
        'footer badge';
    grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
}

.invoice-template-mono .invoice-head h2,
.invoice-template-mono .brand-color,
.invoice-template-mono .invoice-badge {
    color: #111827;
}

.invoice-template-mono .invoice-badge {
    background: #f3f4f6;
}

.invoice-template-mono .table thead,
.invoice-template-mono .totals .total {
    border-color: #111827;
}

.invoice-template-soft {
    border-color: rgba(26, 35, 126, 0.16);
    background: linear-gradient(160deg, #ffffff 0%, #f8faff 70%);
    display: grid;
    grid-template-areas:
        'head head'
        'meta lines'
        'footer lines'
        'badge lines';
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
    gap: 14px;
}

.invoice-template-soft .qr-placeholder {
    border-style: solid;
    border-color: rgba(26, 35, 126, 0.24);
    background: rgba(26, 35, 126, 0.03);
}

.invoice-template-signature {
    border-color: rgba(46, 125, 50, 0.3);
    background: linear-gradient(160deg, #ffffff 0%, rgba(46, 125, 50, 0.06) 100%);
    display: grid;
    grid-template-areas:
        'head meta'
        'lines lines'
        'badge footer';
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
    gap: 14px;
}

.invoice-template-signature .invoice-footer {
    border-top: 1px dashed rgba(46, 125, 50, 0.35);
    padding-top: 14px;
    position: relative;
    margin-top: 0;
    grid-template-columns: 1fr;
}

.invoice-template-signature .invoice-footer::after {
    content: 'توقيع المستلم: __________________';
    position: absolute;
    bottom: -28px;
    right: 0;
    font-size: 12px;
    font-weight: 700;
    color: #166534;
}

.invoice-template-signature .invoice-badge {
    background: rgba(46, 125, 50, 0.15);
    color: var(--success);
}

.invoice-template-signature .totals .total {
    color: var(--success);
}

@media (max-width: 992px) {
    .invoice-template-modern,
    .invoice-template-executive,
    .invoice-template-minimal,
    .invoice-template-bordered,
    .invoice-template-compact,
    .invoice-template-split,
    .invoice-template-slate,
    .invoice-template-royal,
    .invoice-template-mono,
    .invoice-template-soft,
    .invoice-template-signature {
        display: block;
    }

    .invoice-template-split .invoice-footer {
        border-left: 0;
        padding-left: 0;
    }
}

/* Landing page */
.landing-page {
    padding-bottom: 8px;
}

.landing-hero {
    padding: 58px 0 36px;
}

.landing-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(26, 35, 126, 0.08);
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
}

.landing-title {
    margin: 0;
    font-size: clamp(34px, 4.8vw, 50px);
    line-height: 1.2;
    font-weight: 700;
    color: #0f172a;
}

.landing-subtitle {
    margin: 18px 0 0;
    font-size: 18px;
    color: #475569;
    max-width: 620px;
}

.landing-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.landing-actions .btn {
    border-radius: 12px;
    font-weight: 700;
}

.landing-trust {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    color: #334155;
    font-weight: 600;
}

.landing-trust span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.landing-trust i {
    color: var(--success);
}

.hero-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.hero-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.hero-stats {
    display: grid;
    gap: 14px;
}

.hero-stats div {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.hero-stats small {
    color: #64748b;
    font-weight: 600;
}

.hero-stats strong {
    color: var(--primary);
    font-size: 18px;
}

.hero-card-foot {
    margin-top: 14px;
    color: #64748b;
    font-size: 14px;
}

.landing-section {
    padding: 54px 0;
}

.landing-section-muted {
    background: rgba(255, 255, 255, 0.65);
    border-block: 1px solid var(--border);
}

.landing-section-head {
    margin-bottom: 28px;
}

.landing-section-head h2 {
    margin: 0;
    font-size: clamp(28px, 3.6vw, 38px);
    color: #0f172a;
    font-weight: 700;
}

.landing-section-head p {
    margin: 10px 0 0;
    color: #4b5563;
}

.features-grid,
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.feature-card,
.step-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--soft-shadow);
    padding: 22px;
}

.feature-card i {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 35, 126, 0.1);
    color: var(--primary);
}

.feature-card h3,
.step-card h3 {
    margin: 14px 0 10px;
    font-size: 22px;
    color: #0f172a;
}

.feature-card p,
.step-card p {
    margin: 0;
    color: #4b5563;
}

.step-card span {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
}

.landing-cta {
    padding: 0 0 56px;
}

/* Info pages (Support / FAQ / Privacy) */
.info-page {
    padding: 44px 0 52px;
}

.info-head {
    text-align: center;
    margin-bottom: 22px;
}

.info-head h1 {
    margin: 0;
    color: var(--primary);
    font-weight: 700;
}

.info-head p {
    margin: 10px 0 0;
    color: #475569;
}

.info-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--soft-shadow);
    padding: 20px;
}

.info-card + .info-card {
    margin-top: 14px;
}

.info-card h2 {
    font-size: 22px;
    margin: 0 0 12px;
    color: #0f172a;
}

.info-card h3 {
    font-size: 18px;
    margin: 16px 0 10px;
    color: #1e293b;
}

.info-card p,
.info-card li {
    color: #334155;
    line-height: 1.8;
}

.info-list {
    margin: 0;
    padding-right: 18px;
}

.faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
}

.faq-item + .faq-item {
    margin-top: 10px;
}

.faq-item h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.cta-box {
    background: linear-gradient(120deg, #0f172a, #1a237e);
    border-radius: 24px;
    padding: clamp(26px, 4vw, 40px);
    color: #ffffff;
    text-align: center;
    box-shadow: var(--shadow);
}

.cta-box h2 {
    margin: 0;
    font-size: clamp(28px, 3.8vw, 40px);
    font-weight: 700;
}

.cta-box p {
    margin: 12px auto 0;
    color: #dbeafe;
    max-width: 640px;
}

.cta-box .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

.cta-box .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive */
@media (max-width: 992px) {
    .saas-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-layout .sidebar {
        grid-column: 1;
        order: -1;
    }

    .bottom-nav {
        display: flex;
        gap: 8px;
        justify-content: space-between;
    }

    .plans-grid {
        grid-template-columns: 1fr;
        max-width: 560px;
        margin: 0 auto;
    }

    .plan-card.featured {
        transform: none;
    }

    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 24px 20px 32px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stat-value {
        font-size: 22px;
    }

    .invoice-footer {
        grid-template-columns: 1fr;
    }

    .error-card {
        padding: 28px 20px;
    }

    .error-message {
        font-size: 16px;
    }

    .landing-hero {
        padding-top: 38px;
    }

    .landing-actions .btn {
        width: 100%;
    }
}

/* Print styling */
@media print {
    body { background: #ffffff; }
    body * { visibility: hidden; }
    #invoice-to-print, #invoice-to-print * { visibility: visible; }
    #invoice-to-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        margin: 0;
        border: none;
        box-shadow: none;
    }
    .no-print {
        display: none !important;
    }
}
