/* CompanyBill Modern Professional ERP Styling */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #06b6d4;
    --bg-dark: #0f172a;
    --bg-card-dark: #1e293b;
    --border-color: #e2e8f0;
    --border-dark: #334155;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: #1e293b;
    --sidebar-active-text: #ffffff;
    --topbar-height: 64px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Sidebar Styling */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    transition: all 0.3s ease;
    z-index: 1040;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand i {
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 1rem 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-heading {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    padding: 0.75rem 1.5rem 0.25rem;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.65rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link-custom:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.04);
}

.nav-link-custom.active {
    color: var(--sidebar-active-text);
    background-color: var(--sidebar-active-bg);
    border-left-color: var(--primary-color);
}

.nav-link-custom i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* App Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar Styling */
.app-topbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.search-input-group {
    position: relative;
    width: 320px;
}

.search-input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-group input {
    padding-left: 2.5rem;
    border-radius: 20px;
    background-color: #f1f5f9;
    border: 1px solid transparent;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-input-group input:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Page Content Container */
.page-content {
    padding: 1.75rem;
    flex-grow: 1;
}

/* Custom Cards */
.card-custom {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.card-custom:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

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

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

.card-body-custom {
    padding: 1.5rem;
}

/* Tables */
.table-custom {
    margin-bottom: 0;
}

.table-custom th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

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

/* Status Badges & Pills */
.badge-pill-custom {
    padding: 0.35em 0.75em;
    border-radius: 50rem;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-paid, .badge-active, .badge-accepted {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-partially_paid, .badge-sent {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-overdue, .badge-inactive, .badge-rejected {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-draft, .badge-pending {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-cancelled {
    background-color: #f1f5f9;
    color: #64748b;
}

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

.auth-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.auth-header {
    background: #1e293b;
    color: #ffffff;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
}

.auth-brand {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.auth-brand i {
    color: var(--secondary-color);
}

.auth-body {
    padding: 2rem;
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
    }
    .app-sidebar.show {
        left: 0;
    }
    .search-input-group {
        width: 180px;
    }
}
