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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    --secondary-color: #06b6d4;
    --secondary-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --success-color: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-color: #f59e0b;
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-color: #ef4444;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --dark-bg: #0f172a;
    --card-bg: #ffffff;
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #334155;
    --heading-color: #0f172a;
}

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    background-color: #f8fafc;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--heading-color);
}

/* Sidebar Styling */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 265px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(15, 23, 42, 0.15);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar::-webkit-scrollbar {
    width: 4px;
}
#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

#sidebar .sidebar-header {
    padding: 1.35rem 1.25rem;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#sidebar .sidebar-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

#sidebar ul.components {
    padding: 1rem 0;
}

#sidebar ul li a {
    padding: 0.85rem 1.5rem;
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    margin: 2px 0;
}

#sidebar ul li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    border-left-color: rgba(99, 102, 241, 0.5);
    padding-left: 1.7rem;
}

#sidebar ul li.active > a {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.25) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

#sidebar ul li a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    transition: transform 0.2s ease;
}

#sidebar ul li a:hover i,
#sidebar ul li.active > a i {
    transform: scale(1.15);
    color: #818cf8;
}

/* Content Area */
#content {
    margin-left: 265px;
    width: calc(100% - 265px);
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.top-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

/* Metric Cards */
.metric-card {
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.04), 0 4px 12px -2px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.08), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.metric-card.card-success::before { background: var(--success-gradient); }
.metric-card.card-danger::before { background: var(--danger-gradient); }
.metric-card.card-primary::before { background: var(--primary-gradient); }
.metric-card.card-warning::before { background: var(--warning-gradient); }

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Custom Cards & Containers */
.card-custom {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.03), 0 4px 12px -2px rgba(0, 0, 0, 0.015);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-custom .card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.6rem;
}

/* Modern Tables */
.table-custom {
    vertical-align: middle;
    margin-bottom: 0;
}

.table-custom th {
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.73rem;
    letter-spacing: 0.07em;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 1.05rem 1.2rem;
}

.table-custom td {
    vertical-align: middle;
    padding: 1.05rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.93rem;
    color: #334155;
}

.table-custom tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.table-custom tbody tr:hover {
    background-color: #f1f5f9;
}

/* Form Control Polish */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 0.65rem 0.9rem;
    font-size: 0.93rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Remove increase/decrease spin arrows from all numeric input fields */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

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

/* Modern Soft Badges */
.badge {
    font-weight: 600;
    padding: 0.45em 0.85em;
    letter-spacing: 0.02em;
}

.badge-soft-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-soft-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-soft-info {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-soft-danger {
    background-color: #ffe4e6;
    color: #9f1239;
}

.badge-soft-primary {
    background-color: #e0e7ff;
    color: #3730a3;
}

.badge-soft-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

/* Bill Action Pills */
.bill-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.79rem;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bill-pill-client {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.bill-pill-client:hover {
    background: var(--success-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.bill-pill-auditor {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.bill-pill-auditor:hover {
    background: var(--warning-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
}

.btn-icon-action {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.btn-icon-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Buttons Polish */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    transition: all 0.25s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-gradient);
    border: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover, .btn-success:focus {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

/* Mode Toggle Bar for Document Viewer */
.mode-toggle-bar {
    background: #ffffff;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04);
}

/* Search input polish */
.search-input-group {
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.search-input-group .form-control {
    border: none;
    box-shadow: none;
}

.search-input-group .input-group-text {
    border: none;
    background: #ffffff;
}

@media (max-width: 991.98px) {
    #sidebar {
        margin-left: -265px;
    }

    #sidebar.active {
        margin-left: 0;
    }

    #content {
        margin-left: 0;
        width: 100%;
    }
}

@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }

    #sidebar,
    .top-navbar,
    .mode-toggle-bar,
    .no-print {
        display: none !important;
    }

    #content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
}