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

:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --accent-gradient: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
    --bg-main: #f8fafc;
    --sidebar-bg: #0f172a;
    --card-shadow: 0 4px 20px -2px rgba(148, 163, 184, 0.12), 0 2px 8px -1px rgba(148, 163, 184, 0.08);
    --hover-shadow: 0 12px 30px -4px rgba(99, 102, 241, 0.16), 0 4px 12px -2px rgba(99, 102, 241, 0.1);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
    background-color: var(--sidebar-bg);
    min-height: 100vh;
    box-shadow: 4px 0 20px 0 rgba(15, 23, 42, 0.05);
    z-index: 100;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #94a3b8;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    margin: 0.2rem 1rem;
    transition: all 0.2s ease-in-out;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar .nav-link.active {
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px 0 rgba(99, 102, 241, 0.3);
}

/* Premium Dashboard Cards */
.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: #c7d2fe;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Status Badges */
.badge-draft {
    background-color: #f1f5f9;
    color: #475569;
}
.badge-sent {
    background-color: #e0f2fe;
    color: #0284c7;
}
.badge-paid {
    background-color: #dcfce7;
    color: #16a34a;
}
.badge-overdue {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Custom Table Design */
.custom-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.custom-table thead th {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 12px 24px;
}

.custom-table tbody tr {
    background: #ffffff;
    box-shadow: var(--card-shadow);
    border-radius: 12px;
    transition: transform 0.2s;
}

.custom-table tbody tr:hover {
    transform: scale(1.005);
}

.custom-table tbody td {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.custom-table tbody td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.custom-table tbody td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Custom Forms styling */
.form-control, .form-select {
    padding: 0.625rem 1rem;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background-color: #fff;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* Modern buttons */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    font-weight: 500;
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

/* Interactive form items styling */
.invoice-item-row {
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    padding: 1rem;
    transition: border-color 0.2s;
}

.invoice-item-row:hover {
    border-color: #cbd5e1;
}

/* Print View Styling */
@media print {
    @page {
        margin: 0.5in !important;
    }
    
    body {
        background-color: #fff !important;
        color: #000 !important;
        font-size: 11pt;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .sidebar, .navbar, .btn, .no-print, .messages, .breadcrumb, .dropdown, .dropdown-menu {
        display: none !important;
    }
    
    /* Reset Bootstrap grid columns and offsets in print */
    .col-md-9, .col-lg-10, main.main-content, .container-fluid, .row {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .invoice-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0.2in !important;
        margin: 0 !important;
        width: 100% !important;
        background-color: #fff !important;
    }

    /* Keep table styling crisp on paper */
    .table {
        border-collapse: collapse !important;
        width: 100% !important;
    }
    
    .table th, .table td {
        border: 1px solid #cbd5e1 !important;
        padding: 8px !important;
    }
}
