:root {
    --bg-primary: #0b1120;
    --bg-secondary: #0f172a;
    --bg-card: #111c33;
    --bg-card-hover: #162340;
    --bg-sidebar: #0b1120;
    --bg-topbar: #0f172a;
    --border-color: #1e293b;
    --border-light: rgba(148, 163, 184, 0.15);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-green: #10b981;
    --accent-green-light: #34d399;
    --accent-green-dark: #059669;
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-purple: #8b5cf6;
    --accent-purple-light: #a78bfa;
    --accent-orange: #f59e0b;
    --accent-orange-light: #fbbf24;
    --accent-cyan: #06b6d4;
    --accent-cyan-light: #22d3ee;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --sidebar-width: 230px;
    --topbar-height: 56px;
    --font-base: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body, html {
    font-family: var(--font-base);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 0.9rem;
    overflow-x: hidden;
    max-width: 100%;
}

body.dark-theme {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
    overflow-x: hidden;
    max-width: 100vw;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .menu-text,
.sidebar.collapsed .section-label,
.sidebar.collapsed .menu-arrow,
.sidebar.collapsed .badge-notif,
.sidebar.collapsed .user-info,
.sidebar.collapsed .dropdown-toggle {
    display: none !important;
}

.sidebar.collapsed .menu-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .submenu {
    display: none !important;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--topbar-height);
}

.company-logo-img {
    max-height: 40px;
    max-width: 100%;
    object-fit: contain;
}

.logo-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: #10b981;
    letter-spacing: 0.03em;
    font-style: italic;
    margin-top: 2px;
    opacity: 0.9;
}

.logo-subtitle-second {
    font-size: 0.75rem;
    font-weight: 500;
    color: #10b981;
    letter-spacing: 0.03em;
    font-style: italic;
    margin-top: 1px;
    opacity: 0.9;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-menu {
    flex: 1;
    padding: 10px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 140px);
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.menu-section {
    margin-bottom: 16px;
}

.section-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 10px 6px;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 1px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 7px;
    font-weight: 500;
    font-size: 0.84rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    width: 100%;
}

.menu-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.menu-link.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.08) 100%);
    color: var(--accent-green-light);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.25);
}

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.menu-arrow i.rotate {
    transform: rotate(180deg);
}

.badge-notif {
    background: var(--accent-green);
    color: #062d1f;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.submenu {
    padding: 3px 0 3px 14px;
    margin-top: 1px;
}

.submenu-link {
    display: block;
    padding: 6px 10px 6px 30px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 450;
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
}

.submenu-link::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    transform: translateY(-50%);
    opacity: 0.4;
}

.submenu-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.submenu-link:hover::before {
    background: var(--accent-green);
    opacity: 1;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 10px 12px;
    background: var(--bg-secondary);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 5px;
    border-radius: 9px;
    transition: background 0.2s;
    cursor: pointer;
}

.user-card:hover {
    background: var(--bg-card);
}

.user-avatar {
    position: relative;
    flex-shrink: 0;
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    object-fit: cover;
}

.status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.status-dot.online {
    background: var(--accent-green);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-toggle {
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 4px;
}

.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    min-width: 200px;
}

.dropdown-item {
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: 4px 6px;
}

.text-danger.dropdown-item {
    color: var(--accent-red);
}

.main-content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
    overflow-x: hidden;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width));
}

.sidebar.collapsed ~ .main-content-wrapper {
    margin-left: 72px;
    max-width: calc(100vw - 72px);
}

.top-navbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-toggle-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.current-page-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 5px 10px;
    width: 280px;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-icon {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 8px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.82rem;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-kbd {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace;
}

.nav-icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 9px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.nav-icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    border: 2px solid var(--bg-card);
}

.company-selector {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 9px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.company-selector:hover {
    background: var(--bg-card-hover);
}

.shield-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue-light);
    border-radius: 7px;
    font-size: 0.75rem;
}

.content-area {
    flex: 1;
    padding: 18px 24px;
    background: var(--bg-primary);
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.welcome-section h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.welcome-section p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.85rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 7px 12px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.date-range-picker:hover {
    border-color: var(--text-muted);
}

.date-range-picker i {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.customize-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-green);
    color: #062d1f;
    border: none;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.customize-btn:hover {
    background: var(--accent-green-light);
    transform: translateY(-1px);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    border-color: rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 6px;
}

.kpi-title {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 500;
    margin: 0;
}

.kpi-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
}

.kpi-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green-light);
}

.kpi-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue-light);
}

.kpi-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple-light);
}

.kpi-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange-light);
}

.kpi-icon.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan-light);
}

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
}

.kpi-change.up {
    color: var(--accent-green-light);
    background: rgba(16, 185, 129, 0.1);
}

.kpi-change.down {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.kpi-compare {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin: 0;
}

.kpi-sparkline {
    height: 24px;
    margin-top: 6px;
}

.sparkline-canvas {
    width: 100%;
    height: 100%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr 1.3fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
    align-items: start;
}

.dashboard-grid-row-2 {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 12px;
    width: 100%;
    align-items: stretch;
    margin-bottom: 16px;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-card:hover {
    border-color: rgba(148, 163, 184, 0.2);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

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

.panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.76rem;
    cursor: pointer;
    outline: none;
}

.panel-select:focus {
    border-color: var(--accent-green);
}

.view-all-link {
    color: var(--accent-green-light);
    font-size: 0.76rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.view-all-link:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

.revenue-summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.revenue-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.revenue-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--accent-green-light);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.revenue-compare {
    color: var(--text-muted);
    font-size: 0.76rem;
    margin-bottom: 2px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
}

.funnel-container {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 230px;
}

.funnel-chart-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 220px;
    width: 100%;
}

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

.funnel-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.funnel-dot {
    width: 8px;
    height: 8px;
    border-radius: 3px;
}

.funnel-info {
    display: flex;
    flex-direction: column;
}

.funnel-label {
    font-size: 0.76rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.funnel-meta {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.funnel-count {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.funnel-pct {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

.activity-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.78rem;
}

.activity-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green-light);
}

.activity-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue-light);
}

.activity-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple-light);
}

.activity-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange-light);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.78rem;
    color: var(--text-primary);
    margin-bottom: 1px;
    line-height: 1.35;
}

.activity-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.activity-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 1px;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 8px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table thead th:last-child {
    text-align: right;
}

.data-table tbody td {
    padding: 8px;
    font-size: 0.8rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

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

.data-table tbody td:last-child {
    text-align: right;
}

/* Dashboard employee table compact */
.dashboard-grid-row-2 .data-table thead th {
    padding: 0 6px 6px;
    font-size: 0.68rem;
}

.dashboard-grid-row-2 .data-table tbody td {
    padding: 6px;
    font-size: 0.76rem;
}

.rank-cell {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    width: 24px;
}

.employee-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.emp-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    object-fit: cover;
}

.emp-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.num-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: 0.78rem;
}

.achievement-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 3px;
    min-width: 70px;
}

.achievement-fill {
    height: 100%;
    background: var(--accent-green);
    border-radius: 10px;
    transition: width 0.5s;
}

.achievement-pct {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-green-light);
}

.donut-wrap {
    position: relative;
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-center {
    position: absolute;
    text-align: center;
}

.donut-total-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 1px;
}

.donut-total {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.donut-legend {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.legend-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-label {
    font-size: 0.76rem;
    color: var(--text-primary);
    font-weight: 500;
}

.legend-val {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.legend-amount {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.legend-pct {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.gauge-wrap {
    position: relative;
    width: 100%;
    height: 160px;
}

.gauge-center-text {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    text-align: center;
}

.gauge-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1px;
}

.gauge-achieved-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.gauge-pct-big {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-green-light);
    margin-bottom: 1px;
}

.gauge-target-text {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: none;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.card:hover {
    transform: none;
    border-color: rgba(148, 163, 184, 0.2);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 16px 20px;
    color: var(--text-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-body {
    padding: 20px;
    color: var(--text-secondary);
}

.table {
    background: transparent;
    color: var(--text-primary);
}

.table thead th {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
}

.table tbody tr {
    border-color: var(--border-light);
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    background: rgba(15, 23, 42, 0.4);
    color: var(--text-primary);
}

.form-control {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.form-control:hover {
    border-color: var(--text-muted);
}

.form-control:focus {
    background: var(--bg-secondary);
    border-color: var(--accent-green);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-control:disabled,
.form-control[readonly] {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--border-color);
    color: var(--text-muted);
    opacity: 0.85;
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
}

select.form-control,
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
    -webkit-appearance: none;
}

.form-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.form-select:hover {
    border-color: var(--text-muted);
}

.form-select:focus {
    background-color: var(--bg-secondary);
    border-color: var(--accent-green);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-select:disabled {
    background-color: rgba(15, 23, 42, 0.6);
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
}

.form-check {
    margin-bottom: 0.5rem;
    padding-left: 1.75rem;
}

.form-check-input {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 1.05em;
    height: 1.05em;
    margin-top: 0.15em;
    margin-left: -1.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.form-check-input:hover {
    border-color: var(--text-muted);
}

.form-check-input:checked {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
}

.form-check-input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input[type="checkbox"] {
    border-radius: 4px;
}

.form-check-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
}

.form-check-label:hover {
    color: var(--text-primary);
}

.form-switch {
    padding-left: 2.75em;
}

.form-switch .form-check-input {
    width: 2.2em;
    height: 1.2em;
    margin-left: -2.75em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2394a3b8'/%3e%3c/svg%3e");
    border-radius: 2em;
}

.form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23062d1f'/%3e%3c/svg%3e");
}

.form-range {
    width: 100%;
    height: 1.4rem;
    padding: 0;
    background-color: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-track {
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-green);
    border-radius: 50%;
    margin-top: -6px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.form-range::-moz-range-track {
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
}

.form-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-green);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.input-group-text {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.input-group .form-control:focus,
.input-group .form-select:focus {
    z-index: 2;
}

.form-floating > label {
    color: var(--text-muted);
    padding: 0.75rem 0.75rem;
    font-size: 0.85rem;
}

.form-floating > .form-control,
.form-floating > .form-control-plaintext,
.form-floating > .form-select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--accent-green-light);
    opacity: 0.85;
}

.form-floating > .form-control:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-secondary) inset;
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-secondary) inset;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--text-primary);
}

.form-control-plaintext {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem 0;
}

.help-text,
.form-text {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.field-errors,
.invalid-feedback,
.text-danger small,
.text-danger.small {
    color: var(--accent-red);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.was-validated .form-control:invalid,
.form-control.is-invalid,
.was-validated .form-select:invalid,
.form-select.is-invalid {
    border-color: var(--accent-red);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid,
.form-control.is-valid,
.was-validated .form-select:valid,
.form-select.is-valid {
    border-color: var(--accent-green);
}

.form-file input[type="file"] {
    display: none;
}

.form-file .custom-file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.55rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.form-file .custom-file-label:hover {
    border-color: var(--accent-green);
    color: var(--accent-green-light);
    background: rgba(16, 185, 129, 0.05);
}

.form-file .custom-file-label i {
    font-size: 0.95rem;
}

.field-group {
    margin-bottom: 1rem;
}

.field-separator {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.25rem 0;
}

.section-title-form {
    color: var(--accent-green-light);
    font-weight: 600;
    font-size: 0.82rem;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(16, 185, 129, 0.12);
    letter-spacing: 0.02em;
}

.section-title-form:first-child {
    margin-top: 0;
}

.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #062d1f;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-green-light);
    border-color: var(--accent-green-light);
    color: #062d1f;
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-outline-primary {
    border-color: var(--accent-green);
    color: var(--accent-green-light);
}

.btn-outline-primary:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #062d1f;
}

.btn-danger {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.alert {
    border: none;
    border-radius: 10px;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.76rem;
}

.badge-new { background-color: var(--text-muted); color: #fff; }
.badge-contacted { background-color: var(--accent-cyan); color: #042f2e; }
.badge-qualified { background-color: var(--accent-blue); color: #fff; }
.badge-proposal_sent { background-color: var(--accent-orange); color: #3b1f03; }
.badge-negotiation { background-color: var(--accent-orange-light); color: #3b1f03; }
.badge-won { background-color: var(--accent-green); color: #062d1f; }
.badge-lost { background-color: var(--accent-red); color: #fff; }
.badge-on_hold { background-color: var(--accent-purple); color: #fff; }
.badge-follow_up { background-color: var(--accent-green-dark); color: #fff; }

.badge-high { background-color: var(--accent-red); color: #fff; }
.badge-medium { background-color: var(--accent-orange); color: #3b1f03; }
.badge-low { background-color: var(--accent-green); color: #062d1f; }

.badge-draft { background-color: var(--text-muted); color: #fff; }
.badge-sent { background-color: var(--accent-blue); color: #fff; }
.badge-viewed { background-color: var(--accent-cyan); color: #042f2e; }
.badge-accepted { background-color: var(--accent-green); color: #062d1f; }
.badge-rejected { background-color: var(--accent-red); color: #fff; }
.badge-expired { background-color: var(--accent-orange); color: #3b1f03; }

.input-group-text {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.modal-backdrop {
    background-color: rgba(2, 6, 23, 0.85) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop.show {
    opacity: 1 !important;
}

.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(16, 185, 129, 0.08);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
    border-bottom: 1px solid var(--border-color) !important;
    padding: 16px 20px;
}

.modal-title {
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 18px;
    background: var(--accent-green);
    border-radius: 2px;
}

.modal-body {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 20px;
}

.modal-body p,
.modal-body label,
.modal-body span,
.modal-body li {
    color: inherit;
}

.modal-body .text-muted {
    color: var(--text-muted) !important;
}

.modal-body .text-secondary {
    color: var(--text-secondary) !important;
}

.modal-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color) !important;
    padding: 14px 20px;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.7;
    border-radius: 6px;
    padding: 6px;
    transition: all 0.2s;
}

.btn-close:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15) !important;
    filter: invert(0) brightness(1) sepia(1) saturate(10) hue-rotate(-5deg) !important;
}

.modal-body .card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

.modal-body .card-header {
    background: var(--bg-card);
    border-bottom-color: var(--border-color);
    color: var(--text-primary);
}

.modal-body .card-body {
    color: var(--text-secondary);
}

.modal-body .spinner-border {
    color: var(--accent-green) !important;
}

.modal-dialog {
    transition: transform 0.25s cubic-bezier(.2,.8,.2,1), opacity 0.2s;
}

.modal.fade .modal-dialog {
    transform: translateY(20px) scale(0.98);
}

.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

.dropdown-menu.show {
    display: block;
    animation: dropdownFade 0.18s ease;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.offcanvas {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color) !important;
}

.offcanvas-title {
    color: var(--text-primary) !important;
}

.tooltip {
    --bs-tooltip-bg: var(--bg-card);
    --bs-tooltip-color: var(--text-primary);
    --bs-tooltip-border-color: var(--border-color);
    --bs-tooltip-opacity: 1;
}

.tooltip-inner {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    border-radius: 8px !important;
    padding: 6px 10px !important;
    box-shadow: var(--shadow-md);
}

.tooltip.bs-tooltip-top .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
    border-top-color: var(--border-color) !important;
}

.popover {
    --bs-popover-bg: var(--bg-card);
    --bs-popover-body-color: var(--text-primary);
    --bs-popover-header-bg: var(--bg-secondary);
    --bs-popover-header-color: var(--text-primary);
    --bs-popover-border-color: var(--border-color);
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow-lg);
}

.popover-header {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

.popover-body {
    color: var(--text-secondary) !important;
}

.accordion-button {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.accordion-button:not(.collapsed) {
    background: var(--bg-secondary) !important;
    color: var(--accent-green-light) !important;
    box-shadow: inset 0 calc(var(--bs-accordion-border-width) * -1) 0 var(--border-color);
}

.accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.accordion-item {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border-color: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
    isolation: isolate;
}

.nav-tabs .nav-link.active {
    color: var(--accent-green-light) !important;
    background: var(--bg-card) !important;
    border-color: var(--border-color) var(--border-color) var(--bg-card) !important;
}

.nav-tabs {
    border-bottom-color: var(--border-color) !important;
}

.list-group-item {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.list-group-item:hover {
    background: var(--bg-card-hover) !important;
}

.list-group-item.active {
    background: var(--accent-green) !important;
    border-color: var(--accent-green) !important;
    color: #062d1f !important;
}

.footer-bottom {
    padding: 16px 32px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

@media (max-width: 1600px) {
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 1400px) {
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    }
    .dashboard-grid {
        grid-template-columns: 1.5fr 1.2fr 1fr;
    }
    .dashboard-grid-row-2 {
        grid-template-columns: 1.5fr 1fr 1fr;
    }
}

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .dashboard-grid,
    .dashboard-grid-row-2 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content-wrapper {
        margin-left: 0 !important;
        max-width: 100vw !important;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid,
    .dashboard-grid-row-2 {
        grid-template-columns: 1fr;
    }
    .search-box {
        width: 180px;
    }
    .company-selector span:not(.shield-icon) {
        display: none;
    }
}

@media (max-width: 576px) {
    .content-area {
        padding: 12px;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .top-navbar {
        padding: 0 12px;
    }
    .search-box {
        display: none;
    }
    .welcome-section h1 {
        font-size: 1.1rem;
    }
}

@media (max-width: 400px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0a0f1c 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-card .card-header {
    text-align: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 28px 24px;
}

.login-card .card-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
}

.stat-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: 20px;
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-cyan) 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #f97316 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
}

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.88rem;
    opacity: 0.9;
}

.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--accent-green);
    box-shadow: 0 0 0 3px var(--bg-card);
}

.timeline-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
}

.progress-bar {
    background: var(--accent-green);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--accent-red);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-group-sm>.btn, .btn-group-sm .btn {
    padding: 5px 12px;
    font-size: 0.82rem;
}

.mb-0-imp { margin-bottom: 0 !important; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }

/* =====================================================
   DARK THEME — GLOBAL FORM & MODAL OVERRIDES
   Ensures Bootstrap defaults (white bg, dark text)
   are fully overridden across the entire app.
   ===================================================== */

/* ── Select <option> elements ── */
select option,
.form-select option,
select.form-control option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* ── input-group-text ── */
.input-group-text {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* ── All Bootstrap dropdown menus ── */
.dropdown-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    border-radius: var(--radius-md) !important;
}

.dropdown-item {
    color: var(--text-secondary) !important;
    font-size: 0.85rem;
    border-radius: 6px;
    margin: 1px 4px;
    padding: 8px 12px;
    transition: all 0.15s;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
}

.dropdown-item.text-danger {
    color: var(--accent-red) !important;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.12) !important;
}

.dropdown-divider {
    border-color: var(--border-color) !important;
    opacity: 1;
}

/* ── Badge subtle variants ── */
.bg-primary-subtle {
    background-color: rgba(59, 130, 246, 0.12) !important;
}
.text-primary {
    color: var(--accent-blue-light) !important;
}
.border-primary-subtle {
    border-color: rgba(59, 130, 246, 0.25) !important;
}
.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.12) !important;
}
.text-success {
    color: var(--accent-green-light) !important;
}
.bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.12) !important;
}
.text-danger {
    color: var(--accent-red) !important;
}
.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.12) !important;
}
.text-warning {
    color: var(--accent-orange-light) !important;
}
.bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.12) !important;
}
.text-info {
    color: var(--accent-cyan-light) !important;
}
.bg-secondary-subtle {
    background-color: rgba(148, 163, 184, 0.1) !important;
}
.text-secondary {
    color: var(--text-secondary) !important;
}

/* ── Modal — deep dark professional polish ── */
.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 25px 60px -10px rgba(0,0,0,0.7), 0 0 0 1px rgba(16,185,129,0.08) !important;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, rgba(16,185,129,0.08) 0%, rgba(16,185,129,0.02) 100%) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 18px 22px;
}

.modal-body {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    padding: 22px;
}

.modal-footer {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 14px 22px;
}

/* ── Form elements inside modals specifically ── */
.modal-body .form-control,
.modal-body .form-select,
.modal-body select,
.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body input[type="email"],
.modal-body input[type="password"],
.modal-body input[type="date"],
.modal-body input[type="tel"],
.modal-body input[type="url"],
.modal-body textarea {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus,
.modal-body select:focus,
.modal-body input:focus,
.modal-body textarea:focus {
    background: var(--bg-secondary) !important;
    border-color: var(--accent-green) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12) !important;
    outline: none;
}

.modal-body .form-control::placeholder,
.modal-body input::placeholder,
.modal-body textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

.modal-body .form-label,
.modal-body label {
    color: var(--text-secondary) !important;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.modal-body .input-group-text {
    background: var(--bg-primary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

.modal-body .form-text {
    color: var(--text-muted) !important;
    font-size: 0.76rem;
}

.modal-body .form-check-input {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

.modal-body .form-check-input:checked {
    background-color: var(--accent-green) !important;
    border-color: var(--accent-green) !important;
}

.modal-body .form-check-label {
    color: var(--text-secondary) !important;
}

.modal-body select option,
.modal-body .form-select option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* ── Alert inside modal ── */
.modal-body .alert {
    border-radius: var(--radius-md);
}

.modal-body .alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}

.modal-body .alert-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: var(--accent-green-light) !important;
}

.modal-body .alert-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: var(--accent-orange-light) !important;
}

/* ── Row separator inside modal form ── */
.modal-body hr,
.modal-body [style*="border-top"] {
    border-color: var(--border-color) !important;
}

/* ── Bootstrap .card inside modal ── */
.modal-body .card,
.modal-body .card-body {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* ── Bootstrap Alert (page-level) dark override ── */
.alert {
    border-radius: var(--radius-md);
}
.alert-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: var(--accent-green-light) !important;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}
.alert-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: var(--accent-orange-light) !important;
}
.alert-info {
    background: rgba(6, 182, 212, 0.1) !important;
    border-color: rgba(6, 182, 212, 0.25) !important;
    color: var(--accent-cyan-light) !important;
}
.alert .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}

/* ── Bootstrap table inside modal ── */
.modal-body .table,
.modal-body table {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.modal-body .table th,
.modal-body .table td {
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* ── Confirm-style modals ── */
.modal-body h5,
.modal-body h6 {
    color: var(--text-primary) !important;
}

/* ── Spinner ── */
.spinner-border {
    color: var(--accent-green) !important;
}

/* ── Btn-secondary global dark patch ── */
.btn-secondary {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
.btn-secondary:hover {
    background: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--text-muted) !important;
}

/* ── Btn-light global dark patch ── */
.btn-light {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
.btn-light:hover {
    background: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
}

/* ── btn-outline variants dark fix ── */
.btn-outline-primary {
    color: var(--accent-blue-light) !important;
    border-color: var(--accent-blue) !important;
}
.btn-outline-primary:hover {
    background: rgba(59,130,246,0.15) !important;
    color: var(--accent-blue-light) !important;
    border-color: var(--accent-blue-light) !important;
}
.btn-outline-secondary {
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}
.btn-outline-secondary:hover {
    background: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--text-muted) !important;
}
.btn-outline-danger {
    color: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
}
.btn-outline-danger:hover {
    background: rgba(239,68,68,0.15) !important;
    color: #fca5a5 !important;
}
.btn-outline-success {
    color: var(--accent-green-light) !important;
    border-color: var(--accent-green) !important;
}
.btn-outline-success:hover {
    background: rgba(16,185,129,0.15) !important;
    color: var(--accent-green-light) !important;
}

/* =====================================================
   LIGHT THEME OVERRIDES
   Provides a clean, high-contrast, professional
   Light Theme across Navbar, Sidebar, Cards, Modals, etc.
   ===================================================== */
body.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-topbar: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

body.light-theme .app-wrapper {
    background: #f8fafc !important;
}

body.light-theme .sidebar {
    background: #ffffff !important;
    border-right-color: #e2e8f0 !important;
}

body.light-theme .top-navbar {
    background: #ffffff !important;
    border-bottom-color: #e2e8f0 !important;
}

body.light-theme .current-page-title {
    color: #0f172a !important;
    font-weight: 700;
}

body.light-theme .search-box {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme .search-input {
    color: #0f172a !important;
}

body.light-theme .search-kbd {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

body.light-theme .nav-icon-btn {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .nav-icon-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-theme .company-selector {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .menu-link {
    color: #475569 !important;
}

body.light-theme .menu-link:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme .menu-link.active {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #047857 !important;
}

body.light-theme .card,
body.light-theme .products-table-card,
body.light-theme .invoices-table-card,
body.light-theme .audit-table-card,
body.light-theme .prod-stat-card,
body.light-theme .audit-stat-card,
body.light-theme .settings-section-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .prod-table thead th,
body.light-theme .audit-table thead th,
body.light-theme .inv-table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom-color: #e2e8f0 !important;
}

body.light-theme .prod-table tbody tr:hover,
body.light-theme .audit-table tbody tr:hover,
body.light-theme .inv-table tbody tr:hover {
    background: #f8fafc !important;
}

body.light-theme .prod-table tbody td,
body.light-theme .audit-table tbody td,
body.light-theme .inv-table tbody td {
    border-bottom-color: #f1f5f9 !important;
}

body.light-theme .form-control,
body.light-theme .form-select,
body.light-theme select {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .form-control:focus,
body.light-theme .form-select:focus,
body.light-theme select:focus {
    border-color: var(--accent-green) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

body.light-theme select option,
body.light-theme .form-select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

body.light-theme .modal-content {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .modal-header {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

body.light-theme .modal-body {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.light-theme .modal-footer {
    background: #f8fafc !important;
    border-top-color: #e2e8f0 !important;
}

body.light-theme .btn-close {
    filter: none !important;
    opacity: 0.7;
}

body.light-theme .table-pagination-footer,
body.light-theme .audit-footer,
body.light-theme .settings-save-bar {
    background: #f8fafc !important;
    border-top-color: #e2e8f0 !important;
    color: #64748b !important;
}

body.light-theme .dropdown-menu {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .dropdown-item {
    color: #334155 !important;
}

body.light-theme .dropdown-item:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}


/* ============================================================
   GLOBAL ANTI-OVERFLOW — Prevent horizontal scrollbars
   ============================================================ */

/* Bootstrap row has negative margins that cause overflow */
.content-area .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Columns should not exceed content area */
.content-area .col,
.content-area [class*="col-"] {
    padding-left: 6px;
    padding-right: 6px;
}

/* Tables: scroll internally only when genuinely needed */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.table {
    width: 100%;
    min-width: 0;
}

/* Cards and panels: never exceed their container */
.card,
.panel-card,
.kpi-card,
.stat-card {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Ensure no absolutely/flexed child breaks out of content-area */
.content-area > *,
.content-area > * > *,
.dashboard-grid > *,
.dashboard-grid-row-2 > *,
.kpi-grid > * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Prevent charts from forcing wide containers */
canvas {
    max-width: 100% !important;
}

/* ============================================================
   WHITE TABLES & WHITE POPUPS / MODALS (App Background Dark)
   ============================================================ */

/* ── 1. ALL TABLES & TABLE CARDS / WRAPPERS ── */
.table,
.data-table,
.inv-table,
.prod-table,
.audit-table,
.items-table,
.preview-table,
table {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
}

/* Cards & Containers wrapping tables */
.products-table-card,
.invoices-table-card,
.audit-table-card,
.table-responsive,
.card:has(table),
.card:has(.table),
.card:has(.data-table),
.card:has(.inv-table),
.card:has(.prod-table),
.card:has(.audit-table),
[data-list-page="true"] .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    border-radius: 12px !important;
}

/* Search bars & filter containers inside table cards */
.products-search-bar,
.invoices-search-bar,
.audit-search-bar,
.card-body:has(form[method="get"]),
.card:has(table) .card-body,
.products-table-card .products-search-bar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

/* Form controls, inputs, selects inside search/filter bars of white cards */
.products-table-card .form-control,
.products-table-card .form-select,
.invoices-table-card .form-control,
.invoices-table-card .form-select,
.audit-table-card .form-control,
.audit-table-card .form-select,
.card:has(table) .form-control,
.card:has(table) .form-select,
.card:has(table) select,
[data-list-page="true"] .form-control,
[data-list-page="true"] .form-select {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

.products-table-card .input-group-text,
.invoices-table-card .input-group-text,
.audit-table-card .input-group-text,
.card:has(table) .input-group-text {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
}

/* Table Headers (thead th) */
.table thead th,
.data-table thead th,
.inv-table thead th,
.prod-table thead th,
.audit-table thead th,
.items-table thead th,
.preview-table thead th,
table thead th {
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 12px 14px !important;
    vertical-align: middle !important;
}

/* Table Cells (tbody td, tbody th) */
.table tbody td,
.table tbody th,
.data-table tbody td,
.inv-table tbody td,
.prod-table tbody td,
.audit-table tbody td,
.items-table tbody td,
.preview-table tbody td,
table tbody td,
table tbody th {
    background: #ffffff !important;
    color: #0f172a !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 12px 14px !important;
    vertical-align: middle !important;
}

/* Table Row Hover */
.table tbody tr:hover,
.table tbody tr:hover td,
.data-table tbody tr:hover td,
.inv-table tbody tr:hover td,
.prod-table tbody tr:hover td,
.audit-table tbody tr:hover td,
table tbody tr:hover td {
    background-color: #f8fafc !important;
}

/* Striped tables */
.table-striped > tbody > tr:nth-of-type(odd) > *,
table.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

/* Text elements inside table cells */
.table tbody td *,
.data-table tbody td *,
.inv-table tbody td *,
.prod-table tbody td *,
.audit-table tbody td *,
table tbody td * {
    vertical-align: middle;
}

.table tbody td p,
.data-table tbody td p,
.inv-table tbody td p,
.prod-table tbody td p,
.audit-table tbody td p {
    margin: 0;
    color: inherit;
}

/* Text color overrides inside white tables */
.table .text-muted,
.data-table .text-muted,
.inv-table .text-muted,
.prod-table .text-muted,
.audit-table .text-muted,
table .text-muted,
.product-code-text,
.rank-cell {
    color: #64748b !important;
}

.table .text-secondary,
.data-table .text-secondary,
.inv-table .text-secondary,
.prod-table .text-secondary,
.audit-table .text-secondary,
table .text-secondary {
    color: #475569 !important;
}

.table a,
.data-table a,
.inv-table a,
.prod-table a,
.audit-table a,
table a {
    color: #2563eb !important;
    text-decoration: none;
    font-weight: 500;
}
.table a:hover,
.data-table a:hover,
.inv-table a:hover,
.prod-table a:hover,
.audit-table a:hover,
table a:hover {
    color: #1d4ed8 !important;
    text-decoration: underline;
}

.product-title-text,
.emp-name {
    color: #0f172a !important;
    font-weight: 600 !important;
}

/* High contrast badges inside white tables */
.table .badge,
.data-table .badge,
.inv-table .badge,
.prod-table .badge,
.audit-table .badge,
table .badge,
.badge-status {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
}

.badge-active, .badge-success, .badge-won, .badge-accepted, .badge-low {
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
}

.badge-sent, .badge-primary, .badge-info, .badge-medium {
    background-color: #dbeafe !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

.badge-pending, .badge-warning, .badge-draft, .badge-high {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

.badge-rejected, .badge-danger, .badge-lost, .badge-expired, .badge-critical {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

.badge-secondary, .badge-inactive, .badge-archived {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

/* Table Action Buttons Alignment */
.table td .btn,
.data-table td .btn,
.inv-table td .btn,
.prod-table td .btn,
.audit-table td .btn,
table td .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Table Pagination / Footer */
.table-pagination-footer,
.audit-footer,
.products-table-card .products-footer,
.invoices-table-card .invoices-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    padding: 12px 18px !important;
}


/* ── 2. ALL POPUPS & MODALS (COMPLETELY WHITE) ── */
.modal-content,
.popup-content,
.dialog-content {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    border-radius: 14px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden !important;
}

.modal-header,
.popup-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 16px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.modal-title,
.popup-title {
    color: #0f172a !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.btn-close {
    filter: none !important;
    opacity: 0.7 !important;
    color: #334155 !important;
    margin: 0 !important;
    padding: 6px !important;
    border-radius: 6px !important;
}

.btn-close:hover {
    opacity: 1 !important;
    background-color: #e2e8f0 !important;
}

.modal-body,
.popup-body {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 20px !important;
}

.modal-body p,
.modal-body span,
.modal-body div,
.modal-body li,
.modal-body h1,
.modal-body h2,
.modal-body h3,
.modal-body h4,
.modal-body h5,
.modal-body h6,
.modal-body strong,
.modal-body small {
    color: #0f172a !important;
}

.modal-body .text-muted {
    color: #64748b !important;
}

.modal-body .text-secondary {
    color: #475569 !important;
}

.modal-body .form-label,
.modal-body label {
    color: #1e293b !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    margin-bottom: 0.4rem !important;
    display: inline-block !important;
}

/* Inputs & Form Elements in Modals */
.modal-body .form-control,
.modal-body .form-select,
.modal-body select,
.modal-body input,
.modal-body textarea {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    padding: 0.5rem 0.75rem !important;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus,
.modal-body select:focus,
.modal-body input:focus,
.modal-body textarea:focus {
    background-color: #ffffff !important;
    border-color: #10b981 !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.modal-body .form-control::placeholder,
.modal-body input::placeholder,
.modal-body textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 0.8 !important;
}

.modal-body select option,
.modal-body .form-select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

.modal-body .input-group-text {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
}

.modal-body .card,
.modal-body .card-body {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

.modal-footer,
.popup-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 14px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}

.modal-footer .btn,
.popup-footer .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    vertical-align: middle !important;
    margin: 0 !important;
}

/* Universal alignment fix inside modals and tables */
.modal-body .d-flex,
.modal-body .row,
.modal-footer,
.table td,
.table th {
    align-items: center;
}

