/* ============================================================
   KEMERA WALE - Premium Invoice System
   Brand Colors: Orange #F5A623, Green #7ED321, Blue #4A90E2, Red #D0021B
   ============================================================ */

:root {
    --kw-orange: #F5A623;
    --kw-green: #7ED321;
    --kw-blue: #4A90D9;
    --kw-red: #E8453C;
    --kw-dark: #1A1A2E;
    --kw-dark-2: #16213E;
    --kw-sidebar: #0F0F1A;
    --kw-white: #ffffff;
    --kw-bg: #F7F8FC;
    --kw-card: #ffffff;
    --kw-border: #E8EAF0;
    --kw-text: #2C2C3E;
    --kw-muted: #7A7A9D;
    --kw-shadow: 0 4px 24px rgba(26,26,46,0.08);
    --kw-shadow-lg: 0 12px 48px rgba(26,26,46,0.14);
    --sidebar-width: 270px;
    --topbar-h: 68px;
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--kw-bg);
    color: var(--kw-text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--kw-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(245,166,35,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
}

.brand-logo {
    width: 48px; height: 48px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(245,166,35,0.3);
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    line-height: 1.2;
}
.brand-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 0 20px 16px;
}

.sidebar-nav { list-style: none; flex: 1; padding: 0 12px; }
.sidebar-nav .nav-item { margin-bottom: 4px; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
}

.sidebar-nav .nav-item.active .nav-link {
    background: linear-gradient(135deg, rgba(245,166,35,0.2), rgba(245,166,35,0.08));
    color: var(--kw-orange);
    border: 1px solid rgba(245,166,35,0.2);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; }
.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--kw-orange), #e8920a);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.85); }
.user-role { font-size: 10px; color: rgba(255,255,255,0.35); }

.logout-btn {
    width: 32px; height: 32px;
    background: rgba(232,69,60,0.15);
    color: var(--kw-red);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}
.logout-btn:hover { background: rgba(232,69,60,0.3); color: var(--kw-red); }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* TOPBAR */
.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--kw-border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    position: sticky;
    top: 0; z-index: 100;
}

.sidebar-toggle {
    background: none; border: none;
    color: var(--kw-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
    display: none;
}
.sidebar-toggle:hover { color: var(--kw-text); background: var(--kw-bg); }

.topbar-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--kw-text);
    flex: 1;
}

.page-content { padding: 28px; flex: 1; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-kw {
    background: linear-gradient(135deg, var(--kw-orange) 0%, #e8920a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 20px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(245,166,35,0.35);
}
.btn-kw:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245,166,35,0.45);
    color: white;
}
.btn-kw:active { transform: translateY(0); }

.btn-kw-outline {
    background: transparent;
    color: var(--kw-orange);
    border: 1.5px solid var(--kw-orange);
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 20px;
    transition: var(--transition);
}
.btn-kw-outline:hover {
    background: var(--kw-orange);
    color: white;
    box-shadow: 0 4px 14px rgba(245,166,35,0.35);
}

.btn-blue {
    background: linear-gradient(135deg, var(--kw-blue) 0%, #2d7cc9 100%);
    color: white; border: none;
    border-radius: 10px; font-weight: 600;
    font-size: 13.5px; padding: 10px 20px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(74,144,217,0.3);
}
.btn-blue:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(74,144,217,0.4); color: white; }

.btn-green {
    background: linear-gradient(135deg, var(--kw-green) 0%, #6db81c 100%);
    color: white; border: none;
    border-radius: 10px; font-weight: 600;
    font-size: 13.5px; padding: 10px 20px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(126,211,33,0.3);
}
.btn-green:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(126,211,33,0.4); color: white; }

.btn-red {
    background: linear-gradient(135deg, var(--kw-red) 0%, #c73028 100%);
    color: white; border: none;
    border-radius: 10px; font-weight: 600;
    font-size: 13.5px; padding: 10px 20px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(232,69,60,0.3);
}
.btn-red:hover { transform: translateY(-1px); color: white; }

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white; border: none;
    border-radius: 10px; font-weight: 600;
    font-size: 13.5px; padding: 10px 20px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(37,211,102,0.3);
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-whatsapp:hover { transform: translateY(-1px); color: white; box-shadow: 0 6px 20px rgba(37,211,102,0.4); }

/* ============================================================
   CARDS
   ============================================================ */
.kw-card {
    background: var(--kw-card);
    border-radius: var(--radius);
    border: 1px solid var(--kw-border);
    box-shadow: var(--kw-shadow);
    transition: var(--transition);
}
.kw-card:hover { box-shadow: var(--kw-shadow-lg); }

.kw-card-header {
    padding: 20px 24px 0;
    display: flex; align-items: center; justify-content: space-between;
}
.kw-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 17px; font-weight: 700;
    color: var(--kw-text);
}
.kw-card-body { padding: 20px 24px 24px; }

/* STAT CARDS */
.stat-card {
    background: var(--kw-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--kw-border);
    box-shadow: var(--kw-shadow);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--kw-shadow-lg); }
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 0 var(--radius) 0 100%;
    opacity: 0.12;
}
.stat-card.orange::after { background: var(--kw-orange); }
.stat-card.green::after { background: var(--kw-green); }
.stat-card.blue::after { background: var(--kw-blue); }
.stat-card.red::after { background: var(--kw-red); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
    margin-bottom: 16px;
}
.stat-icon.orange { background: linear-gradient(135deg, var(--kw-orange), #e8920a); box-shadow: 0 4px 14px rgba(245,166,35,0.35); }
.stat-icon.green { background: linear-gradient(135deg, var(--kw-green), #6db81c); box-shadow: 0 4px 14px rgba(126,211,33,0.3); }
.stat-icon.blue { background: linear-gradient(135deg, var(--kw-blue), #2d7cc9); box-shadow: 0 4px 14px rgba(74,144,217,0.3); }
.stat-icon.red { background: linear-gradient(135deg, var(--kw-red), #c73028); box-shadow: 0 4px 14px rgba(232,69,60,0.3); }

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 28px; font-weight: 800;
    color: var(--kw-text); line-height: 1;
    margin-bottom: 6px;
}
.stat-label { font-size: 12.5px; color: var(--kw-muted); font-weight: 500; }

/* ============================================================
   TABLE
   ============================================================ */
.kw-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.kw-table thead th {
    background: var(--kw-bg);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--kw-muted);
    padding: 14px 16px;
    border-bottom: 2px solid var(--kw-border);
}
.kw-table tbody td {
    padding: 14px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--kw-border);
    vertical-align: middle;
}
.kw-table tbody tr:last-child td { border-bottom: none; }
.kw-table tbody tr {
    transition: var(--transition);
}
.kw-table tbody tr:hover { background: rgba(245,166,35,0.03); }

/* BADGES */
.badge-paid {
    background: rgba(126,211,33,0.15); color: #5aad00;
    padding: 5px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-pending {
    background: rgba(245,166,35,0.15); color: #c5820a;
    padding: 5px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-partial {
    background: rgba(74,144,217,0.15); color: #2d7cc9;
    padding: 5px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.5px; text-transform: uppercase;
}

/* INVOICE NUMBER CHIP */
.inv-num {
    font-family: 'DM Sans', monospace;
    font-size: 12px; font-weight: 700;
    color: var(--kw-orange);
    background: rgba(245,166,35,0.1);
    padding: 3px 9px; border-radius: 6px;
}

/* ============================================================
   FORMS
   ============================================================ */
.kw-form-group { margin-bottom: 20px; }
.kw-label {
    display: block;
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--kw-muted);
    margin-bottom: 8px;
}
.kw-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--kw-border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--kw-text);
    background: white;
    transition: var(--transition);
    outline: none;
}
.kw-input:focus {
    border-color: var(--kw-orange);
    box-shadow: 0 0 0 4px rgba(245,166,35,0.1);
}
.kw-input:read-only {
    background: var(--kw-bg);
    color: var(--kw-muted);
}
select.kw-input { cursor: pointer; }
textarea.kw-input { resize: vertical; min-height: 100px; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--kw-dark);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -100px; left: -100px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(245,166,35,0.15) 0%, transparent 60%);
}
.login-page::after {
    content: '';
    position: absolute;
    bottom: -100px; right: -100px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(74,144,217,0.12) 0%, transparent 60%);
}

.login-bg-circles {
    position: absolute; inset: 0; pointer-events: none;
}
.login-bg-circles span {
    position: absolute; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.05);
}
.login-bg-circles span:nth-child(1) { width: 300px; height: 300px; top: 10%; left: 5%; }
.login-bg-circles span:nth-child(2) { width: 200px; height: 200px; top: 60%; right: 10%; }
.login-bg-circles span:nth-child(3) { width: 150px; height: 150px; bottom: 20%; left: 20%; }

.login-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    position: relative; z-index: 1;
}

.login-logo {
    width: 72px; height: 72px;
    border-radius: 18px;
    object-fit: cover;
    border: 2px solid rgba(245,166,35,0.4);
    box-shadow: 0 8px 32px rgba(245,166,35,0.2);
    margin-bottom: 20px;
}

.login-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px; font-weight: 800;
    color: white; margin-bottom: 4px;
}
.login-subtitle { font-size: 13px; color: rgba(255,255,255,0.4); margin-bottom: 36px; }

.login-label {
    display: block;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
}
.login-input {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 13px 16px;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    margin-bottom: 18px;
}
.login-input:focus {
    border-color: var(--kw-orange);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 4px rgba(245,166,35,0.1);
}
.login-input::placeholder { color: rgba(255,255,255,0.25); }

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--kw-orange) 0%, #e8920a 100%);
    color: white; border: none;
    border-radius: 12px; padding: 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px; font-weight: 700;
    cursor: pointer; transition: var(--transition);
    box-shadow: 0 6px 24px rgba(245,166,35,0.4);
    letter-spacing: 0.3px;
    margin-top: 8px;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(245,166,35,0.5);
}

.login-footer { text-align: center; margin-top: 28px; font-size: 12px; color: rgba(255,255,255,0.25); }
.login-error {
    background: rgba(232,69,60,0.2);
    border: 1px solid rgba(232,69,60,0.3);
    color: #ff8a80; border-radius: 10px;
    padding: 12px 16px; font-size: 13px;
    margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
    display: flex; align-items: center; gap: 12px;
    background: white;
    border: 1.5px solid var(--kw-border);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    max-width: 320px;
}
.search-bar i { color: var(--kw-muted); font-size: 14px; }
.search-bar input {
    border: none; outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px; color: var(--kw-text);
    padding: 11px 0; flex: 1; background: transparent;
}
.search-bar input::placeholder { color: var(--kw-muted); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 40px;
}
.empty-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, rgba(245,166,35,0.15), rgba(245,166,35,0.05));
    border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: var(--kw-orange);
    margin: 0 auto 24px;
}
.empty-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-text { font-size: 13.5px; color: var(--kw-muted); margin-bottom: 24px; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px;
}
.page-header-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px; font-weight: 800;
    color: var(--kw-text);
}
.page-header-sub { font-size: 13px; color: var(--kw-muted); margin-top: 2px; }

/* ============================================================
   ACTION BUTTONS (TABLE)
   ============================================================ */
.action-btns { display: flex; gap: 6px; align-items: center; }
.action-btn {
    width: 32px; height: 32px;
    border-radius: 8px; border: none;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; cursor: pointer; transition: var(--transition);
    text-decoration: none;
}
.action-btn.view { background: rgba(74,144,217,0.12); color: var(--kw-blue); }
.action-btn.view:hover { background: var(--kw-blue); color: white; }
.action-btn.edit { background: rgba(245,166,35,0.12); color: var(--kw-orange); }
.action-btn.edit:hover { background: var(--kw-orange); color: white; }
.action-btn.delete { background: rgba(232,69,60,0.12); color: var(--kw-red); }
.action-btn.delete:hover { background: var(--kw-red); color: white; }
.action-btn.whatsapp { background: rgba(37,211,102,0.12); color: #25D366; }
.action-btn.whatsapp:hover { background: #25D366; color: white; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .sidebar-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.show { display: block; }
}

@media (max-width: 768px) {
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .stat-value { font-size: 22px; }
}

/* ============================================================
   TOAST
   ============================================================ */
.kw-toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.kw-toast {
    background: white;
    border-radius: 12px;
    padding: 14px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border-left: 4px solid var(--kw-green);
    font-size: 14px;
    display: flex; align-items: center; gap: 12px;
    animation: slideInRight 0.4s ease;
    min-width: 280px;
}
.kw-toast.error { border-left-color: var(--kw-red); }
@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   ===== INVOICE PRINT / VIEW STYLES =====
   ============================================================ */
.invoice-wrapper {
    max-width: 820px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--kw-shadow-lg);
    overflow: hidden;
    position: relative;
}

/* Watermark */
.invoice-watermark {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    opacity: 0.04;
    width: 340px;
    pointer-events: none;
    z-index: 0;
}

.invoice-inner { position: relative; z-index: 1; }

/* INVOICE HEADER BAND */
.invoice-header-band {
    background: var(--kw-dark);
    padding: 0;
    position: relative;
    overflow: hidden;
}
.invoice-header-band::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--kw-dark) 60%, #1e2a4a 100%);
}

/* Color stripe */
.invoice-color-stripe {
    display: flex;
    height: 6px;
}
.invoice-color-stripe span {
    flex: 1;
}
.stripe-orange { background: var(--kw-orange); }
.stripe-red { background: var(--kw-red); }
.stripe-blue { background: var(--kw-blue); }
.stripe-green { background: var(--kw-green); }

.invoice-header-content {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    padding: 32px 40px;
    gap: 20px;
}

.inv-company { display: flex; align-items: center; gap: 18px; }
.inv-logo {
    width: 72px; height: 72px;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid rgba(245,166,35,0.4);
    background: white;
}
.inv-company-info {}
.inv-company-name {
    font-family: 'Playfair Display', serif;
    font-size: 26px; font-weight: 800;
    color: white; line-height: 1;
    letter-spacing: -0.5px;
}
.inv-tagline {
    font-size: 10px; letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--kw-orange);
    margin-top: 4px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}
.inv-company-details {
    margin-top: 10px;
    font-size: 11.5px;
    color: rgba(255,255,255,0.55);
    line-height: 1.8;
}
.inv-company-details i { color: var(--kw-orange); width: 14px; margin-right: 4px; }

.inv-title-block { text-align: right; }
.inv-title {
    font-family: 'Playfair Display', serif;
    font-size: 42px; font-weight: 800;
    color: rgba(255,255,255,0.08);
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 1;
}
.inv-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--kw-orange), #e8920a);
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(245,166,35,0.4);
}
.inv-number-display {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px; font-weight: 700;
    color: white;
    margin-top: 8px;
}
.inv-date-display {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

/* INVOICE META ROW */
.invoice-meta-row {
    display: flex;
    background: var(--kw-bg);
    border-bottom: 1px solid var(--kw-border);
    padding: 0 40px;
}
.invoice-meta-item {
    flex: 1; padding: 20px 0;
    border-right: 1px solid var(--kw-border);
}
.invoice-meta-item:last-child { border-right: none; padding-left: 24px; }
.invoice-meta-item:first-child { padding-right: 24px; }
.invoice-meta-item + .invoice-meta-item { padding-left: 24px; padding-right: 24px; }
.meta-label {
    font-size: 10px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--kw-muted);
    font-weight: 700; margin-bottom: 4px;
}
.meta-value {
    font-size: 14px; font-weight: 700; color: var(--kw-text);
    line-height: 1.4;
}
.meta-value.small { font-size: 12.5px; font-weight: 500; color: var(--kw-muted); }

/* INVOICE BODY */
.invoice-body { padding: 36px 40px; }

/* Billing Table */
.billing-table {
    width: 100%; border-collapse: collapse;
    margin-bottom: 28px;
}
.billing-table thead tr {
    background: var(--kw-dark);
}
.billing-table thead th {
    padding: 14px 18px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: rgba(255,255,255,0.7);
}
.billing-table thead th:last-child { text-align: right; }
.billing-table thead th:first-child { border-radius: 10px 0 0 0; }
.billing-table thead th:last-child { border-radius: 0 10px 0 0; }

.billing-table tbody td {
    padding: 16px 18px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--kw-border);
    vertical-align: top;
}
.billing-table tbody td:last-child { text-align: right; font-weight: 700; }

.billing-table tbody tr:last-child td { border-bottom: none; }

.service-name { font-weight: 700; color: var(--kw-text); margin-bottom: 3px; }
.service-desc { font-size: 12px; color: var(--kw-muted); }

/* Payment Summary */
.payment-summary {
    background: linear-gradient(135deg, var(--kw-dark) 0%, #1e2a4a 100%);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 28px;
    position: relative; overflow: hidden;
}
.payment-summary::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(245,166,35,0.2) 0%, transparent 60%);
}
.payment-summary-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px; font-weight: 700;
    color: white; margin-bottom: 20px;
    position: relative; z-index: 1;
}
.payment-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: relative; z-index: 1;
}
.payment-row:last-child { border-bottom: none; padding-top: 14px; margin-top: 6px; }
.payment-label { font-size: 13px; color: rgba(255,255,255,0.55); }
.payment-value { font-size: 14px; font-weight: 700; color: white; }
.payment-row.total .payment-label {
    font-size: 15px; font-weight: 700;
    color: rgba(255,255,255,0.9);
}
.payment-row.total .payment-value {
    font-size: 22px; font-weight: 800;
    color: var(--kw-orange);
}
.payment-row.advance .payment-value { color: var(--kw-green); }

/* Status Badge in invoice */
.inv-status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
    text-transform: uppercase;
}
.inv-status-badge.paid { background: rgba(126,211,33,0.15); color: #5aad00; }
.inv-status-badge.pending { background: rgba(245,166,35,0.15); color: #c5820a; }

/* Notes & Terms */
.invoice-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px; font-weight: 700;
    color: var(--kw-text);
    border-left: 3px solid var(--kw-orange);
    padding-left: 12px;
    margin-bottom: 12px;
}

.terms-list {
    list-style: none; padding: 0;
}
.terms-list li {
    padding: 6px 0;
    font-size: 12.5px;
    color: var(--kw-muted);
    display: flex; gap: 10px; align-items: flex-start;
}
.terms-list li::before {
    content: '✦';
    color: var(--kw-orange);
    font-size: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Signature Area */
.signature-area {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--kw-border);
}
.signature-box { text-align: center; }
.signature-line {
    width: 160px; height: 1px;
    background: var(--kw-dark);
    margin: 0 auto 8px;
}
.signature-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--kw-muted); }

/* INVOICE FOOTER */
.invoice-footer {
    background: var(--kw-dark);
    padding: 20px 40px;
    text-align: center;
}
.invoice-footer-text {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}
.invoice-footer-text strong { color: var(--kw-orange); }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

    body {
        background: white !important;
        font-size: 12px;
        margin: 0; padding: 0;
    }

    .no-print, .sidebar, .topbar, .topbar-actions, .sidebar-overlay,
    .page-header .btn, .invoice-actions, .breadcrumb { display: none !important; }

    .main-wrapper { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }

    .invoice-wrapper {
        box-shadow: none !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .invoice-header-band::before { display: none; }
    .payment-summary::before { display: none; }

    .invoice-header-content { padding: 20px 30px; }
    .invoice-body { padding: 24px 30px; }
    .invoice-footer { padding: 14px 30px; }
    .invoice-meta-row { padding: 0 30px; }

    .inv-company-name { font-size: 20px !important; }
    .inv-title { font-size: 28px !important; }
    .payment-row.total .payment-value { font-size: 18px !important; }

    .billing-table thead tr { background: var(--kw-dark) !important; }
    .payment-summary { background: var(--kw-dark) !important; }
    .invoice-header-band { background: var(--kw-dark) !important; }
    .invoice-footer { background: var(--kw-dark) !important; }
    .invoice-color-stripe { display: flex !important; }

    a { text-decoration: none !important; }
}

/* ============================================================
   MOBILE RESPONSIVE INVOICE FIX
   Full-page mobile invoice like PDF
   ============================================================ */

@media (max-width: 768px) {

    body {
        overflow-x: hidden;
        background: #F7F8FC;
    }

    #invoicePage {
        padding: 0 !important;
    }

    .invoice-wrapper {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        margin: 0;
        box-shadow: none;
    }

    .invoice-inner {
        width: 100%;
    }

    /* HEADER */
    .invoice-header-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 20px;
        gap: 20px;
    }

    .inv-company {
        width: 100%;
        align-items: center;
    }

    .inv-logo {
        width: 56px;
        height: 56px;
    }

    .inv-company-name {
        font-size: 22px;
    }

    .inv-title-block {
        width: 100%;
        text-align: left;
    }

    .inv-title {
        font-size: 30px;
        letter-spacing: 2px;
    }

    .inv-number-display {
        font-size: 13px;
    }

    /* META ROW */
    .invoice-meta-row {
        flex-direction: column;
        padding: 0 20px;
    }

    .invoice-meta-item {
        border-right: none;
        border-bottom: 1px solid var(--kw-border);
        padding: 18px 0 !important;
    }

    .invoice-meta-item:last-child {
        border-bottom: none;
    }

    /* BODY */
    .invoice-body {
        padding: 24px 20px;
    }

    /* TABLE */
    .billing-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .billing-table thead th,
    .billing-table tbody td {
        padding: 12px;
        font-size: 12px;
    }

    .service-name {
        font-size: 13px;
    }

    .service-desc {
        font-size: 11px;
    }

    /* PAYMENT SUMMARY */
    .payment-summary {
        padding: 22px 20px;
        margin-top: 20px;
    }

    .payment-row.total .payment-value {
        font-size: 20px;
    }

    /* SIGNATURE AREA */
    .signature-area {
        flex-direction: column;
        gap: 30px;
        align-items: center;
        text-align: center;
    }

    .signature-box {
        width: 100%;
        text-align: center !important;
    }

    .signature-line {
        margin: 0 auto 8px !important;
        width: 140px;
    }

    /* FOOTER */
    .invoice-footer {
        padding: 18px 20px;
    }

    .invoice-footer-text {
        font-size: 11px;
        line-height: 1.8;
    }

    /* WATERMARK */
    .invoice-watermark {
        width: 220px;
    }

    /* PUBLIC CONTACT CARD */
    .btn-whatsapp {
        width: 100%;
        justify-content: center;
    }

}


/* ============================================================
   EXTRA SMALL DEVICES
   ============================================================ */

@media (max-width: 480px) {

    .invoice-header-content {
        padding: 20px 16px;
    }

    .invoice-body {
        padding: 20px 16px;
    }

    .invoice-meta-row {
        padding: 0 16px;
    }

    .invoice-footer {
        padding: 16px;
    }

    .inv-company-name {
        font-size: 20px;
    }

    .inv-title {
        font-size: 26px;
    }

    .payment-summary {
        border-radius: 14px;
    }

    .payment-row.total .payment-value {
        font-size: 18px;
    }

    .meta-value {
        font-size: 13px;
    }

    .meta-value.small {
        font-size: 11.5px;
    }

    .terms-list li {
        font-size: 11.5px;
    }

}
