:root {
    /* Color Palette */
    --bs-primary: #5FAAD9;
    --bs-primary-rgb: 95, 170, 217;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;

    --color-primary: #5FAAD9;
    --color-background: #F8F9FB;
    --color-text: #2D3748;
    --color-text-secondary: #718096;
    --color-text-muted-ui: #A0AEC0;
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;
    --color-border-soft: #E2E8F0;
    --color-primary-soft: #EAF4FB;
    --color-success-soft: #38A169;
    --color-warning-soft: #D69E2E;
    --color-danger-soft: #E53E3E;
    --color-info-soft: #3182CE;

    /* Typography */
    --font-family-base: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    --line-height-base: 1.75;
}

.navbar {
    min-height: 5.25rem !important;
}

.navbar-brand {
    font-size: 1.25rem !important;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-family-base);
    line-height: var(--line-height-base);
}

.bg-primary-custom {
    background-color: var(--color-primary) !important;
}

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

/* Sidebar */
.sidebar {
    background-color: #ffffff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    padding-top: 5.25rem; /* Increased height */
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 5.25rem);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link .feather {
    margin-right: 4px;
    color: #999;
}

.sidebar .nav-link.active {
    color: var(--color-primary);
    background-color: rgba(95, 170, 217, 0.1);
}

.sidebar .nav-link:hover {
    color: var(--color-primary);
    background-color: rgba(95, 170, 217, 0.05);
}

/* Main Content */
main {
    padding-top: 5.25rem; /* Base offset from navbar */
}

main > div.d-flex:first-of-type {
    padding-top: 0.5rem; /* Match .sidebar-sticky padding-top */
}

main h1.h2 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0.75rem; /* Match .nav-link top padding for text alignment */
    line-height: 1.2;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,.05);
    font-weight: 600;
}

/* Global badge tone alignment (design token based) */
.badge.bg-primary {
    background-color: var(--color-primary) !important;
}

.badge.bg-success {
    background-color: #E6F6EE !important;
    color: #2F855A !important;
}

.badge.bg-danger {
    background-color: #FDECEC !important;
    color: #C53030 !important;
}

.badge.bg-secondary {
    background-color: #EDF2F7 !important;
    color: #4A5568 !important;
}

.badge.bg-warning {
    background-color: #F6E7AF !important;
}

.badge.text-dark {
    color: #7B5A00 !important;
}

/* Navbar Enhancements */
.animate-pulse {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); text-shadow: 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { transform: scale(1); text-shadow: 0 0 10px rgba(220, 53, 69, 0); }
    100% { transform: scale(0.95); text-shadow: 0 0 0 rgba(220, 53, 69, 0); }
}

.x-small {
    font-size: 0.75rem;
}

/* Privacy Mode (Extreme Protection) */
body.privacy-active .search-target,
body.privacy-active .client-name,
body.privacy-active .contact-info,
body.privacy-active .maskable,
body.privacy-active .avatar-sm,
body.privacy-active table td:first-child,
body.privacy-active table td a {
    filter: blur(12px) !important;
    opacity: 0.3 !important;
    user-select: none !important;
    pointer-events: none !important;
    transition: all 0.2s ease-in-out !important;
}

body.privacy-active #privacyToggle i {
    color: #ffc107 !important;
    filter: none !important;
    opacity: 1 !important;
}

.animate-pulse {
    animation: pulse-red 2s infinite;
}

.dashboard-home {
    font-family: var(--font-family-base);
    color: var(--color-text);
}

.dashboard-home .dashboard-hero {
    background:
        radial-gradient(circle at top right, rgba(95, 170, 217, 0.14), transparent 50%),
        linear-gradient(180deg, #FFFFFF 0%, var(--color-background) 100%);
    border: 1px solid rgba(95, 170, 217, 0.18);
    border-radius: 14px;
}

.dashboard-home .dashboard-hero .card-title {
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dashboard-home .dashboard-hero .btn {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 500;
}

.dashboard-home .stat-card {
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dashboard-home .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .6rem 1.2rem rgba(45, 55, 72, 0.08) !important;
    border-color: rgba(95, 170, 217, 0.3) !important;
}

.dashboard-home .stat-icon {
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-soft) !important;
    border: 1px solid rgba(95, 170, 217, 0.16);
}

.dashboard-home .stat-icon i {
    font-size: 1.2rem;
}

.dashboard-home .stat-label {
    color: var(--color-text-secondary) !important;
    font-weight: 500;
}

.dashboard-home .stat-value {
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dashboard-home .stat-change {
    line-height: 1.5;
}

.dashboard-home .dashboard-panel {
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    overflow: hidden;
}

.dashboard-home .dashboard-panel .card-header {
    background: linear-gradient(180deg, #FFFFFF 0%, #FBFCFE 100%) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7) !important;
    padding-top: 1rem;
    padding-bottom: 0.75rem !important;
}

.dashboard-home .dashboard-panel .card-header h6 {
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.dashboard-home .dashboard-panel .card-header p,
.dashboard-home .text-muted {
    color: var(--color-text-secondary) !important;
}

.dashboard-home .dashboard-panel .btn.btn-sm {
    min-height: 36px;
    border-radius: 8px;
}

.dashboard-home .table thead th {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    border-bottom-width: 1px;
}

.dashboard-home .table tbody td {
    color: var(--color-text);
    border-color: rgba(226, 232, 240, 0.75);
    vertical-align: middle;
}

.dashboard-home .list-group-item {
    border-color: rgba(226, 232, 240, 0.7);
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    background: transparent;
}

.dashboard-home .list-group-item:first-child {
    padding-top: 0;
}

.dashboard-home .list-group-item:last-child {
    padding-bottom: 0;
}

.dashboard-home .list-group-item .fw-semibold {
    color: var(--color-text);
}

.dashboard-home .badge {
    border-radius: 999px;
    font-weight: 500;
    padding: 0.45em 0.7em;
}

.dashboard-home .text-primary { color: var(--color-primary) !important; }
.dashboard-home .text-info { color: var(--color-info-soft) !important; }
.dashboard-home .text-success { color: var(--color-success-soft) !important; }
.dashboard-home .text-danger { color: var(--color-danger-soft) !important; }
.dashboard-home .text-warning { color: var(--color-warning-soft) !important; }

@media (max-width: 991.98px) {
    .dashboard-home .dashboard-hero .btn {
        min-height: 44px;
    }

    .dashboard-home .stat-value {
        font-size: 1.6rem;
    }
}
