/* ============================================
   CRM Design System — Monday.com / Linear Inspired
   ============================================ */
/* ---------- CSS Variables ---------- */
:root {
    /* Brand Colors */
    --primary: #c9a84c;
    --primary-hover: #b8923e;
    --primary-light: #faf3e0;
    --primary-dark: #7a5e1a;

    /* UI Colors */
    --sidebar-bg: #18120a;

    --sidebar-hover: #271c0e;
    --sidebar-active: #c9a84c;
    --sidebar-text: #bfab8a;
    --sidebar-text-active: #ffffff;
    --sidebar-border: #332514;

    /* App Background */
    --app-bg: #f4f3f0;
    --card-bg: #ffffff;
    --card-border: #ebebeb;
    --card-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
    --card-shadow-hover:
        0 2px 8px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);

    /* Typography */
    --text-primary: #1a1a1a;
    --text-secondary: #5c5c6e;
    --text-muted: #a0a0b0;
    --text-white: #ffffff;

    /* Status Colors */
    --success: #12a85a;
    --success-light: #e6f7ee;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #2563eb;
    
    --info-light: #dbeafe;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --orange: #ea580c;
    --orange-light: #ffedd5;

    /* Borders & Radius */
    --border-color: #e8e8e8;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --topbar-height: 58px;

    /* Transitions */
    --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font-sans:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Dark mode variables */
[data-theme="dark"] {
    --app-bg: #111827;
    --card-bg: #1f2937;
    --card-border: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--app-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    font-family: var(--font-sans);
}

/* ---------- Auth Layout ---------- */
.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-brand {
    background: linear-gradient(135deg, #c9a84c 0%, #8a6820 50%, #4a2e08 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    top: -200px;
    left: -200px;
}

.auth-brand::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    bottom: -100px;
    right: -100px;
}

.auth-sanskrit-invocation {
    font-family: "Noto Serif Devanagari", "Tiro Devanagari Sanskrit", serif;
    font-size: 22px;
    font-weight: 600;
    color: #ffd97a;
    text-align: center;
    margin-bottom: 24px;
    z-index: 1;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    line-height: 1.5;
}

.auth-ganesh-image {
    position: relative;
    width: 220px;
    height: 220px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.auth-ganesh-image::before {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 217, 122, 0.45) 0%,
        rgba(255, 217, 122, 0.18) 45%,
        rgba(255, 217, 122, 0) 70%
    );
    filter: blur(8px);
    z-index: -1;
    animation: ganesh-glow 4s ease-in-out infinite;
}

.auth-ganesh-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    padding: 8px;
    border: 2px solid rgba(255, 217, 122, 0.55);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 0 24px rgba(255, 217, 122, 0.15);
}

@keyframes ganesh-glow {
    0%,
    100% {
        opacity: 0.85;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.04);
    }
}

.auth-sanskrit-shloka {
    font-family: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", serif;
    font-size: 22px;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    line-height: 1.7;
    z-index: 1;
    margin-bottom: 22px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.3px;
    max-width: 460px;
}

.auth-sanskrit-meaning {
    font-size: 14px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
    line-height: 1.7;
    z-index: 1;
    max-width: 420px;
    margin-bottom: 48px;
}

.auth-brand-tagline {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    z-index: 1;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    width: 80%;
    max-width: 360px;
}

.auth-form-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
    width: 100%;
    max-width: 400px;
}

.auth-form-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    background: var(--card-bg);
    overflow-y: auto;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ---------- Form Components ---------- */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    transition: var(--transition);
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--app-bg);
    transition: var(--transition);
    outline: none;
    font-family: var(--font-sans);
}

.form-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    color: var(--primary);
}

.form-input.error {
    border-color: var(--danger);
    background: var(--danger-light);
}

.form-input.success {
    border-color: var(--success);
}

.form-input-icon {
    position: relative;
}

.form-input-icon .form-input {
    padding-left: 42px;
}

.form-input-icon .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.form-input-icon .icon-right {
    left: auto;
    right: 14px;
    cursor: pointer;
    pointer-events: all;
    color: var(--text-secondary);
}

.form-input-icon .icon-right:hover {
    color: var(--primary);
}

.form-error {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
    font-weight: 500;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check-input {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--primary);
}

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

/* Password strength */
.password-strength {
    margin-top: 8px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.strength-bar {
    height: 3px;
    flex: 1;
    background: var(--border-color);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.strength-bar.weak {
    background: var(--danger);
}
.strength-bar.fair {
    background: var(--warning);
}
.strength-bar.strong {
    background: var(--success);
}

.strength-text {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.45);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--app-bg);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover {
    background: var(--app-bg);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c73350;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    height: 48px;
    font-size: 15px;
    padding: 0 24px;
}
.btn-sm {
    height: 34px;
    font-size: 13px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
}

.btn-loading {
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ---------- Divider ---------- */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Social Login ---------- */
.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.btn-social:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-social svg,
.btn-social img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---------- Auth Footer ---------- */
.auth-footer-link {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-footer-link a {
    color: var(--primary);
    font-weight: 600;
}

/* ---------- Alert ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-danger {
    background: var(--danger-light);
    border-color: #f5bdc5;
    color: #8c1526;
}

.alert-success {
    background: var(--success-light);
    border-color: #a3e8c7;
    color: #026440;
}

.alert-info {
    background: var(--info-light);
    border-color: #a8d0ff;
    color: #1a4a8a;
}

/* ---------- DASHBOARD LAYOUT ---------- */
.crm-layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-slow);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: var(--topbar-height);
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    letter-spacing: -0.3px;
    opacity: 1;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-logo-text {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    background: var(--sidebar-hover);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--primary);
    color: white;
}

.sidebar.collapsed .sidebar-toggle {
    margin-left: auto;
    margin-right: auto;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 4px;
}

.sidebar-section {
    margin-bottom: 4px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 12px 16px 6px;
    white-space: nowrap;
    overflow: hidden;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-section-label {
    opacity: 0;
    padding: 8px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    height: 40px;
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    margin: 1px 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    font-size: 13.5px;
    font-weight: 500;
}

.sidebar-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 12px rgba(201, 168, 76, 0.35);
    font-weight: 600;
}

.sidebar-item-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-item-text {
    opacity: 0;
    width: 0;
}

.sidebar-item-badge {
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-item-badge {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .sidebar-item {
    justify-content: center;
}

.sidebar.collapsed .sidebar-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    background: #1e293b;
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: var(--transition);
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed .sidebar-item:hover::after {
    opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 12px 8px;
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    overflow: hidden;
}

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

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Topbar ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    z-index: 90;
    transition: left var(--transition-slow);
    gap: 16px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.topbar.sidebar-collapsed {
    left: var(--sidebar-collapsed);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.topbar-breadcrumb-item {
    font-size: 14px;
    color: var(--text-secondary);
}

.topbar-breadcrumb-item.current {
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-breadcrumb-sep {
    color: var(--text-muted);
    font-size: 14px;
}

/* Search */
.topbar-search {
    position: relative;
    flex: 0 0 280px;
}

.topbar-search input {
    width: 100%;
    height: 36px;
    padding: 0 14px 0 38px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--app-bg);
    outline: none;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.topbar-search input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.topbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.topbar-shortcut {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--border-color);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

/* Topbar Actions */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.topbar-btn:hover {
    background: var(--app-bg);
    color: var(--text-primary);
}

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

.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.profile-trigger:hover {
    background: var(--app-bg);
}

.profile-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-chevron {
    color: var(--text-muted);
    transition: var(--transition);
}

.profile-trigger:hover .profile-chevron {
    color: var(--text-primary);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    padding: 6px;
    z-index: 200;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: var(--transition);
}

.dropdown-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.dropdown-header {
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.dropdown-header-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-header-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    font-family: var(--font-sans);
}

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

.dropdown-item.danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 32px 30px;
    width: calc(100vw - var(--sidebar-width));
    min-height: calc(100vh - var(--topbar-height));
    box-sizing: border-box;
    transition:
        margin-left var(--transition-slow),
        width var(--transition-slow);
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.card-header {
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.card-body {
    padding: 20px 22px;
}

/* ---------- Stats Card ---------- */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: var(--primary-light);
    color: var(--primary);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.stat-change.up {
    color: var(--success);
    background: var(--success-light);
}

.stat-change.down {
    color: var(--danger);
    background: var(--danger-light);
}

/* ---------- Badge / Status Pill ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.badge-blue {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.badge-green {
    background: var(--success-light);
    color: var(--success);
}
.badge-yellow {
    background: var(--warning-light);
    color: var(--warning);
}
.badge-red {
    background: var(--danger-light);
    color: var(--danger);
}
.badge-purple {
    background: #f1f0f5;
    color: #5b4e78;
}
.badge-gray {
    background: #f0f0f0;
    color: #6b6b7b;
}
.badge-orange {
    background: #fff2e8;
    color: var(--orange);
}

/* ---------- Grid ---------- */
.grid {
    display: grid;
    gap: 20px;
}
.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ---------- Utility ---------- */
.flex {
    display: flex;
}
.flex-center {
    display: flex;
    align-items: center;
}
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.flex-col {
    display: flex;
    flex-direction: column;
}
.gap-4 {
    gap: 4px;
}
.gap-8 {
    gap: 8px;
}
.gap-12 {
    gap: 12px;
}
.gap-16 {
    gap: 16px;
}
.gap-20 {
    gap: 20px;
}
.gap-24 {
    gap: 24px;
}
.mt-4 {
    margin-top: 4px;
}
.mt-8 {
    margin-top: 8px;
}
.mt-16 {
    margin-top: 16px;
}
.mt-24 {
    margin-top: 24px;
}
.mb-4 {
    margin-bottom: 4px;
}
.mb-8 {
    margin-bottom: 8px;
}
.mb-16 {
    margin-bottom: 16px;
}
.mb-24 {
    margin-bottom: 24px;
}
.text-center {
    text-align: center;
}
.text-sm {
    font-size: 12px;
}
.text-secondary {
    color: var(--text-secondary);
}
.text-muted {
    color: var(--text-muted);
}
.font-bold {
    font-weight: 700;
}
.font-semibold {
    font-weight: 600;
}
.w-full {
    width: 100%;
}

/* ---------- Animations ---------- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ---------- Page Header ---------- */
.page-header {
    margin-bottom: 28px;
}

.page-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .topbar-search {
        flex: 0 0 200px;
    }
}

@media (max-width: 768px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
    }
    .auth-brand {
        display: none;
    }
    .auth-form-side {
        padding: 40px 24px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .topbar {
        left: 0 !important;
    }
    .main-content {
        margin-left: 0 !important;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .social-buttons {
        grid-template-columns: 1fr;
    }
    .topbar-search {
        display: none;
    }
    .profile-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-form-side {
        padding: 24px 16px;
    }
    .auth-form-title {
        font-size: 22px;
    }
    .main-content {
        padding: 16px;
    }
}

/* ---------- Notification Panel ---------- */
.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    width: 340px;
    z-index: 200;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: var(--transition);
}

.notif-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.notif-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.notif-item:hover {
    background: var(--app-bg);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.notif-dot.unread {
    background: var(--primary);
}
.notif-dot.read {
    background: var(--border-color);
}

.notif-content-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ---------- Mobile Overlay ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* ---------- Empty State ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--app-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 280px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ============================================
   Additional Components — ERP Extension
   ============================================ */

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* ---------- Data Table ---------- */
.data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead tr {
    background: var(--app-bg);
    border-bottom: 1px solid var(--card-border);
}

.data-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    white-space: nowrap;
    user-select: none;
    cursor: default;
}

.data-table th:first-child {
    padding-left: 20px;
}
.data-table th:last-child {
    padding-right: 20px;
}

.data-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table td:first-child {
    padding-left: 20px;
}
.data-table td:last-child {
    padding-right: 20px;
}

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

.data-table tbody tr {
    transition: var(--transition);
}

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

.data-table tfoot td {
    padding: 10px 16px;
    border-top: 2px solid var(--border-color);
    border-bottom: none;
}

/* ---------- Page Header ---------- */
.page-header {
    margin-bottom: 24px;
}

.page-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.7px;
    margin-bottom: 3px;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ---------- Card (ERP canonical) ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.card-body {
    padding: 18px 22px;
}

/* ---------- Stat Cards (ERP canonical) ---------- */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
}

.stat-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up {
    color: var(--success);
}
.stat-change.down {
    color: var(--danger);
}

/* ---------- Grid Utilities ---------- */
.grid {
    display: grid;
    gap: 20px;
}
.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 900px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ---------- Icon Button ---------- */
.icon-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ---------- Pagination ---------- */
.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Topbar (ERP canonical) ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 12px;
    z-index: 50;
    transition: left var(--transition-slow);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.sidebar.collapsed ~ * .topbar,
.sidebar.collapsed + * .topbar {
    left: var(--sidebar-collapsed);
}

.topbar-breadcrumb {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-breadcrumb-item {
    color: var(--text-muted);
}
.topbar-breadcrumb-item.current {
    color: var(--text-primary);
}
.topbar-breadcrumb-sep {
    margin: 0 6px;
    color: var(--text-muted);
    font-weight: 400;
}

.topbar-search {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.topbar-search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.topbar-search input {
    width: 100%;
    height: 34px;
    padding: 0 36px 0 32px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--app-bg);
    outline: none;
    font-family: var(--font-sans);
    transition: var(--transition);
}

.topbar-search input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.topbar-shortcut {
    position: absolute;
    right: 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--border-color);
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 500;
    pointer-events: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.topbar-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.topbar-btn:hover {
    background: var(--app-bg);
    color: var(--text-primary);
}

.topbar-notif-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid white;
}

.topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

/* ---------- Main Content (canonical) ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 32px 30px;
    width: calc(100vw - var(--sidebar-width));
    min-height: calc(100vh - var(--topbar-height));
    box-sizing: border-box;
    transition:
        margin-left var(--transition-slow),
        width var(--transition-slow);
}

.sidebar.collapsed ~ .main-content,
body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
    width: calc(100vw - var(--sidebar-collapsed));
}

/* ---------- Profile / Dropdown ---------- */
.profile-dropdown {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.profile-trigger:hover {
    background: var(--app-bg);
    border-color: var(--primary);
}

.profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-chevron {
    color: var(--text-muted);
    transition: transform var(--transition);
}

.profile-dropdown.open .profile-chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 200;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: var(--transition);
}

.dropdown-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--app-bg);
}

.dropdown-header-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.dropdown-header-email {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: var(--transition);
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ---------- Notification Panel ---------- */
.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 200;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: var(--transition);
}

.notif-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* ---------- Sidebar User Footer ---------- */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
    overflow: hidden;
}

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

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
    transition: var(--transition);
}
.sidebar-user-name {
    font-size: 12px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 10px;
    color: var(--sidebar-text);
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
}
.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
}

/* ---------- Deal Card Hover ---------- */
.deal-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
}
.contact-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
}

/* ---------- Responsive: topbar / main adjust for sidebar collapse ---------- */
#mainContent,
.main-content {
    transition: margin-left var(--transition-slow);
}

/* ---------- Responsive Mobile ---------- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

    .topbar {
        left: 0 !important;
        padding: 0 16px;
    }
    .main-content {
        margin-left: 0 !important;
        width: 100vw !important;
        padding: 20px 16px;
    }

    #mobileMenuBtn {
        display: flex !important;
    }
}

/* ---------- Animations ---------- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ---------- Sidebar Collapse: topbar ---------- */
#topbar {
    left: var(--sidebar-width);
    transition: left var(--transition-slow);
}
body.sidebar-collapsed #topbar {
    left: var(--sidebar-collapsed);
}

/* ============================================
   LEADS MODULE
   ============================================ */

/* ── Shared dropdown (fixed-position) ──────── */
.ld-dd {
    position: fixed;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.14),
        0 2px 8px rgba(0, 0, 0, 0.06);
    width: 216px;
    z-index: 9999;
    display: none;
    overflow: hidden;
    padding: 4px 0;
}
.ld-dd.open {
    display: block;
    animation: ldIn 0.13s ease-out;
}
@keyframes ldIn {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.ld-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
    text-decoration: none;
    transition: background 0.1s;
    line-height: 1;
}
.ld-item:hover {
    background: var(--app-bg);
    color: var(--text-primary);
}
.ld-item.primary {
    color: var(--primary);
    font-weight: 600;
}
.ld-item.primary:hover {
    background: var(--primary-light);
}
.ld-item.success {
    color: var(--success);
}
.ld-item.success:hover {
    background: var(--success-light);
}
.ld-item.danger {
    color: var(--danger);
}
.ld-item.danger:hover {
    background: var(--danger-light);
}
.ld-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ── Off-canvas backdrop ────────────────────── */
.oc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.22s,
        visibility 0.22s;
    backdrop-filter: blur(2px);
}
.oc-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* ── Off-canvas panel ───────────────────────── */
.oc-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 530px;
    max-width: 96vw;
    height: 100vh;
    background: #fff;
    z-index: 3001;
    display: flex;
    flex-direction: column;
    box-shadow: -6px 0 40px rgba(0, 0, 0, 0.13);
    border-radius: 16px 0 0 16px;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.oc-panel.open {
    transform: translateX(0);
}

.oc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.oc-head-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.oc-head-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}
.oc-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--app-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}
.oc-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.oc-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.oc-body::-webkit-scrollbar {
    width: 4px;
}
.oc-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.oc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--app-bg);
    flex-shrink: 0;
}

/* ── Off-canvas form internals ──────────────── */
.oc-section {
    margin-bottom: 26px;
}
.oc-section:last-child {
    margin-bottom: 0;
}

.oc-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.oc-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.oc-fg {
    margin-bottom: 14px;
}
.oc-fg:last-child {
    margin-bottom: 0;
}

.oc-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.oc-label sup {
    color: var(--danger);
    font-size: 11px;
    margin-left: 2px;
}

.oc-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--app-bg);
    transition: var(--transition);
    outline: none;
    font-family: var(--font-sans);
}
.oc-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}
.oc-input::placeholder {
    color: var(--text-muted);
}
textarea.oc-input {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}
select.oc-input {
    cursor: pointer;
}

/* Gender toggle */
.gender-toggle {
    display: flex;
    gap: 8px;
}
.gender-opt {
    flex: 1;
    height: 40px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    background: var(--app-bg);
    font-family: var(--font-sans);
}
.gender-opt.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* ── Leads filter bar ───────────────────────── */
.leads-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.leads-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
}
.leads-search-wrap svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.leads-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--app-bg);
    outline: none;
    font-family: var(--font-sans);
    transition: var(--transition);
}
.leads-search-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}
.leads-search-input::placeholder {
    color: var(--text-muted);
}

.leads-select {
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--app-bg);
    outline: none;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    min-width: 130px;
}
.leads-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Back link ──────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 18px;
    text-decoration: none;
    transition: color 0.15s;
}
.back-link:hover {
    color: var(--primary);
}

/* ── Lead header card ───────────────────────── */
.lead-hdr {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    padding: 24px 28px;
    margin-bottom: 20px;
}
.lead-hdr-inner {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.lead-avatar {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.lead-info {
    flex: 1;
    min-width: 0;
}
.lead-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.lead-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.lead-source-pill {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    background: #fff;
}
.lead-id-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    font-family: monospace;
    padding: 2px 8px;
    background: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.lead-contacts {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.lead-contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.lead-contact-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
}
.lead-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.lead-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
    white-space: nowrap;
    text-decoration: none;
}
.lead-act-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.lead-act-btn.gold {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.lead-act-btn.gold:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ── Lead profile two-column layout ─────────── */
.lead-prof-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 20px;
    align-items: start;
}
.lead-prof-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Tab card ───────────────────────────────── */
.tab-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.tab-nav {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 13px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition:
        color 0.15s,
        border-color 0.15s;
    font-family: var(--font-sans);
    margin-bottom: -1px;
}
.tab-btn:hover {
    color: var(--text-primary);
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    line-height: 1;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

/* ── Activity feed ──────────────────────────── */
.act-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.act-item:last-child {
    border-bottom: none;
}
.act-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.act-body {
    flex: 1;
    min-width: 0;
}
.act-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.act-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Detail rows ────────────────────────────── */
.det-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}
.det-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.det-key {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 110px;
}
.det-val {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

/* ── Overview grid ──────────────────────────── */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.overview-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ── Sidebar card ───────────────────────────── */
.sc-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.sc-head {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
.sc-body {
    padding: 16px 20px;
}

/* ── Notes box ──────────────────────────────── */
.notes-box {
    background: var(--primary-light);
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.notes-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
}

/* ── Conversion journey ─────────────────────── */
.j-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    position: relative;
}
.j-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 34px;
    width: 2px;
    height: 14px;
    background: var(--border-color);
    border-radius: 1px;
}
.j-step.done::after {
    background: var(--success);
}
.j-step.current::after {
    background: var(--primary);
}

.j-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.j-step.done .j-dot {
    background: var(--success);
    border-color: var(--success);
}
.j-step.current .j-dot {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.j-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
.j-step.done .j-label {
    color: var(--success);
}
.j-step.current .j-label {
    color: var(--primary);
}

/* ── File rows ──────────────────────────────── */
.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.file-row:last-child {
    margin-bottom: 0;
}
.file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.file-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Reminder rows ──────────────────────────── */
.reminder-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: #fff;
}
.reminder-row:last-child {
    margin-bottom: 0;
}
.reminder-info {
    flex: 1;
    min-width: 0;
}
.reminder-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.reminder-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Messages ───────────────────────────────── */
.msg-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}
.msg-thread::-webkit-scrollbar {
    width: 4px;
}
.msg-thread::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.msg-row.out {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
.msg-content {
    max-width: 72%;
}
.msg-bubble {
    padding: 10px 13px;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}
.msg-row.out .msg-bubble {
    background: var(--primary-light);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px 12px 4px 12px;
}
.msg-row.inc .msg-bubble {
    background: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px 12px 12px 4px;
}
.msg-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}
.msg-row.out .msg-time {
    text-align: right;
}
.msg-row.inc .msg-time {
    text-align: left;
}

.msg-compose {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}
.msg-input {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
    font-family: var(--font-sans);
    background: var(--app-bg);
    transition: var(--transition);
}
.msg-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Send profile form ──────────────────────── */
.sp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.sp-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.sp-select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--app-bg);
    outline: none;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
}
.sp-select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}
.sp-drop-zone {
    background: var(--app-bg);
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.sp-drop-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* ── Tab empty state ────────────────────────── */
.tab-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 12px;
}
.tab-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--app-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.tab-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.tab-empty-desc {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 260px;
    line-height: 1.6;
}

/* ── Responsive: Leads module ───────────────── */

/* ≤1200px: tighten sidebar column */
@media (max-width: 1200px) {
    .lead-prof-layout {
        grid-template-columns: 1fr 280px;
    }
}

/* ≤1024px: single-column layout, aside becomes a two-col grid */
@media (max-width: 1024px) {
    .lead-prof-layout {
        grid-template-columns: 1fr;
    }
    .lead-prof-aside {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .overview-grid {
        gap: 16px;
    }
}

/* ≤900px: off-canvas narrower, form rows single-col */
@media (max-width: 900px) {
    .oc-panel {
        width: 480px;
    }
    .oc-row2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .sp-row {
        grid-template-columns: 1fr;
    }
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

/* ≤768px: off-canvas becomes bottom sheet, header stacks */
@media (max-width: 768px) {
    .lead-hdr {
        padding: 18px 20px;
    }
    .lead-hdr-inner {
        flex-direction: column;
        gap: 14px;
    }
    .lead-avatar {
        width: 60px;
        height: 60px;
        font-size: 20px;
        border-radius: 12px;
    }
    .lead-actions {
        width: 100%;
    }
    .lead-prof-aside {
        grid-template-columns: 1fr;
    }

    .oc-panel {
        width: 100%;
        border-radius: 20px 20px 0 0;
        top: auto;
        bottom: 0;
        height: 90vh;
        transform: translateY(100%);
    }
    .oc-panel.open {
        transform: translateY(0);
    }

    .tab-btn {
        padding: 11px 10px;
        font-size: 12px;
        gap: 4px;
    }
}

/* ≤640px */
@media (max-width: 640px) {
    .lead-name {
        font-size: 18px;
    }
    .lead-contacts {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .lead-act-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 12px;
    }
    .lead-actions {
        gap: 6px;
    }
    .tab-nav {
        padding: 0 12px;
    }
    .leads-filter-bar {
        gap: 8px;
    }
    .leads-search-wrap {
        max-width: 100%;
    }
    .leads-select {
        min-width: 0;
        flex: 1;
    }
}

/* ≤480px */
@media (max-width: 480px) {
    .lead-hdr {
        padding: 14px 16px;
    }
    .lead-name {
        font-size: 16px;
    }
    .oc-head {
        padding: 16px 18px 14px;
    }
    .oc-body {
        padding: 16px 18px;
    }
    .oc-foot {
        padding: 12px 18px;
    }
    .sc-body {
        padding: 14px 16px;
    }
    .tab-btn {
        padding: 10px 8px;
        font-size: 11px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CLIENTS MODULE
   ════════════════════════════════════════════════════════════════════════ */

/* ── Shared table name link ─────────────────────────────────────────────── */
.lead-table-name {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.lead-table-name:hover {
    text-decoration: none;
}

/* ── Clients table helpers ──────────────────────────────────────────────── */
.cl-table-row:hover {
    background: var(--hover-bg);
}
.cl-row-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* ── Gradient header bar ────────────────────────────────────────────────── */
.cl-hdr-bar {
    height: 80px;
    background: linear-gradient(120deg, #c9a84c 0%, #b07ae0 60%, #7c3aed 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}
.cl-hdr-bar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='30'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
        repeat;
}
.cl-hdr-bar-inner {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 14px 20px;
    position: relative;
    z-index: 1;
}
.cl-hdr-badge-row {
    display: flex;
    gap: 8px;
}
.cl-status-badge,
.cl-plan-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
}
.cl-status-badge.active {
    background: rgba(0, 200, 117, 0.25);
    color: #00e898;
    border: 1px solid rgba(0, 200, 117, 0.35);
}
.cl-plan-badge.gold {
    background: rgba(201, 168, 76, 0.25);
    color: #f5d580;
    border: 1px solid rgba(201, 168, 76, 0.35);
}
.cl-plan-badge.platinum {
    background: rgba(162, 93, 220, 0.3);
    color: #d4a8ff;
    border: 1px solid rgba(162, 93, 220, 0.4);
}
.cl-plan-badge.silver {
    background: rgba(87, 155, 252, 0.25);
    color: #aad0ff;
    border: 1px solid rgba(87, 155, 252, 0.35);
}

/* ── Profile card ───────────────────────────────────────────────────────── */
.cl-prof-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: visible;
}
.cl-prof-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 0 24px 20px;
    position: relative;
    flex-wrap: wrap;
}

/* ── Avatar with star badge ─────────────────────────────────────────────── */
.cl-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    margin-top: -28px;
}
.cl-avatar {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: white;
    border: 4px solid var(--card-bg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.cl-star-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 2px solid var(--card-bg);
    box-shadow: 0 2px 6px rgba(201, 168, 76, 0.4);
}

/* ── Name, pills, contacts ──────────────────────────────────────────────── */
.cl-prof-info {
    flex: 1;
    min-width: 0;
    padding-top: 10px;
}
.cl-prof-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.cl-prof-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    margin: 0;
}
.cl-prof-id {
    font-size: 11px;
    background: var(--app-bg);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono, monospace);
}

.cl-prof-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.cl-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 4px 10px;
}
.cl-prof-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* ── Actions area ───────────────────────────────────────────────────────── */
.cl-prof-actions {
    padding-top: 16px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
    position: relative;
}

/* ── Stats bar ──────────────────────────────────────────────────────────── */
.cl-stats-bar {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding: 14px 24px;
    gap: 0;
    flex-wrap: wrap;
}
.cl-stat-item {
    flex: 1;
    text-align: center;
    padding: 6px 10px;
    min-width: 100px;
}
.cl-stat-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.cl-stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 3px;
}
.cl-stat-sep {
    width: 1px;
    height: 36px;
    background: var(--border-color);
    align-self: center;
}

/* ── Personal details grid ──────────────────────────────────────────────── */
.cl-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.cl-details-grid .det-row {
    padding: 10px 14px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}
.cl-details-grid .det-row:nth-last-child(-n + 2) {
    border-bottom: none;
}

/* ── Service package card ───────────────────────────────────────────────── */
.pkg-card {
    background: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}
.pkg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}
.pkg-plan-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}
.pkg-plan-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 2px;
}
.pkg-plan-price span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}
.pkg-inv {
    text-align: right;
}
.pkg-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.pkg-lbl {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.pkg-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 4px;
}
.pkg-days {
    color: var(--primary);
}
.pkg-progress-wrap {
    margin-top: 4px;
}
.pkg-progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}
.pkg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #e0b84a);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ── Services checklist ─────────────────────────────────────────────────── */
.svc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.svc-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.svc-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.svc-check.done {
    background: #00c875;
}
.svc-check.no {
    background: var(--border-color);
}
.svc-lbl {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}
.svc-lbl.muted {
    color: var(--text-muted);
}

/* ── Kundali details grid ───────────────────────────────────────────────── */
.kundali-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}
.kd-item {
    background: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.kd-key {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.kd-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ── Match filter tabs ──────────────────────────────────────────────────── */
.match-filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 3px;
}
.mft-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    background: transparent;
    border-radius: 5px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}
.mft-btn.active,
.mft-btn:hover {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.mft-btn.active {
    color: var(--primary);
}

/* ── Match cards ────────────────────────────────────────────────────────── */
.match-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.match-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: var(--transition);
}
.match-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.1);
}
.match-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.match-info {
    flex: 1;
    min-width: 0;
}
.match-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.match-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ── Gunas bar ──────────────────────────────────────────────────────────── */
.match-gunas {
    display: flex;
    align-items: center;
    gap: 8px;
}
.gunas-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}
.gunas-bar-wrap {
    flex: 1;
    max-width: 100px;
}
.gunas-bar {
    height: 5px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}
.gunas-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #e0b84a);
    border-radius: 3px;
}
.gunas-score {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* ── Match score badge ──────────────────────────────────────────────────── */
.match-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    min-width: 60px;
    text-align: center;
}
.match-pct {
    font-size: 22px;
    font-weight: 800;
    color: var(--clr, #00c875);
    letter-spacing: -1px;
    line-height: 1;
}
.match-pct-lbl {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.match-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    margin-top: 4px;
}
.match-tag.new {
    background: #d7f5e8;
    color: #00c875;
}
.match-tag.sent {
    background: #fff5cc;
    color: #b38600;
}
.match-tag.match {
    background: #efe6f8;
    color: #a25ddc;
}

/* ── Referral lead rows ─────────────────────────────────────────────────── */
.ref-lead-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--app-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: var(--transition);
}
.ref-lead-row:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.08);
}
.ref-lead-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
}
.ref-lead-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 5, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.ai-modal {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 32px 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    transform: scale(0.94) translateY(12px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .ai-modal {
    transform: scale(1) translateY(0);
}

.found-modal {
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
}

.ai-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 28px;
}
.ai-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 6px;
}
.ai-modal-sub {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ── AI steps ───────────────────────────────────────────────────────────── */
.ai-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 24px;
}
.ai-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    position: relative;
    font-size: 13px;
    color: var(--text-muted);
}
.ai-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 30px;
    width: 2px;
    height: 14px;
    background: var(--border-color);
    border-radius: 1px;
}
.ai-step.done::after {
    background: var(--success);
}
.ai-step.current::after {
    background: var(--primary);
}

.ai-step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.ai-step.done .ai-step-dot {
    background: var(--success);
    border-color: var(--success);
}
.ai-step.current .ai-step-dot {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}
.ai-step.current {
    color: var(--text-primary);
    font-weight: 600;
}
.ai-step.done {
    color: var(--success);
    font-weight: 600;
}

.ai-spinner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── AI progress ────────────────────────────────────────────────────────── */
.ai-progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ai-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}
.ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #e0b84a);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}
.ai-progress-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    min-width: 36px;
    text-align: right;
}

/* ── Responsive: Clients module ─────────────────────────────────────────── */
@media (max-width: 1200px) {
    .kundali-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .cl-details-grid {
        grid-template-columns: 1fr;
    }
    .cl-details-grid .det-row:last-child {
        border-bottom: none;
    }
    .pkg-dates {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .kundali-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .svc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .cl-hdr-bar {
        height: 60px;
    }
    .cl-avatar {
        width: 64px;
        height: 64px;
        font-size: 20px;
        border-radius: 14px;
    }
    .cl-prof-name {
        font-size: 18px;
    }
    .cl-prof-actions {
        width: 100%;
    }
    .cl-stats-bar {
        gap: 0;
    }
    .cl-stat-item {
        min-width: 80px;
    }
    .match-filter-tabs {
        flex-wrap: wrap;
    }
    .pkg-dates {
        grid-template-columns: 1fr;
    }
    .ai-modal {
        padding: 24px 20px;
        margin: 0 12px;
    }
}

@media (max-width: 640px) {
    .cl-prof-card-inner {
        flex-direction: column;
        gap: 12px;
    }
    .cl-avatar-wrap {
        margin-top: -28px;
        align-self: flex-start;
    }
    .cl-prof-pills {
        gap: 6px;
    }
    .cl-stats-bar {
        padding: 10px 14px;
    }
    .cl-stat-sep {
        display: none;
    }
    .kundali-grid {
        grid-template-columns: 1fr 1fr;
    }
    .match-card {
        align-items: flex-start;
    }
    .match-right {
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .cl-hdr-bar {
        height: 50px;
        border-radius: 0;
    }
    .cl-prof-card {
        border-radius: 0;
    }
    .cl-prof-card-inner {
        padding: 0 14px 16px;
    }
    .kundali-grid {
        grid-template-columns: 1fr;
    }
    .match-card {
        padding: 12px;
    }
    .ai-modal {
        border-radius: 16px;
    }
}

/* ============================================
   PREMIUM HR SYSTEM — Extended Design
   ============================================ */

/* Premium Stat Card */
.pstat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.pstat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--pstat-accent, var(--primary));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.pstat-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
}
.pstat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pstat-body {
    flex: 1;
    min-width: 0;
}
.pstat-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}
.pstat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.pstat-sub {
    font-size: 11px;
    color: var(--text-muted);
}
.pstat-trend {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
}
.pstat-trend.up {
    color: var(--success);
}
.pstat-trend.down {
    color: var(--danger);
}

/* Chart Card */
.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}
.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.chart-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.chart-card-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Leave Balance Bar */
.lb-bar-wrap {
    background: var(--app-bg);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
    flex: 1;
}
.lb-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Announcement card */
.ann-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    border-left: 4px solid var(--ann-color, var(--primary));
    transition: var(--transition);
}
.ann-card:hover {
    box-shadow: var(--card-shadow-hover);
}
.ann-card.pinned {
    background: linear-gradient(
        135deg,
        var(--card-bg) 0%,
        color-mix(in srgb, var(--ann-color, var(--primary)) 5%, white) 100%
    );
}
.ann-pin-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
}

/* Toast notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    pointer-events: all;
    min-width: 280px;
    max-width: 380px;
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    border-left: 4px solid var(--toast-color, var(--primary));
}
.toast.hiding {
    animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}
.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.toast-msg {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    line-height: 1.4;
}
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    flex-shrink: 0;
}
.toast-close:hover {
    background: var(--app-bg);
}

/* Avatar */
.emp-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}
.emp-avatar-initials-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: white;
    border: 3px solid var(--primary);
}
.emp-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.emp-avatar-initials-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* Progress ring */
.progress-ring {
    transform: rotate(-90deg);
}
.progress-ring-bg {
    fill: none;
    stroke: var(--border-color);
}
.progress-ring-fill {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Org chart */
.org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.org-node {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    text-align: center;
    min-width: 160px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    cursor: default;
}
.org-node:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary);
}
.org-node.root {
    border-color: var(--primary);
    border-width: 2px;
}
.org-connector {
    width: 2px;
    height: 24px;
    background: var(--border-color);
    margin: 0 auto;
}
.org-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
}
.org-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Skeleton loader */
@keyframes shimmer {
    0% {
        background-position: -400px 0;
    }
    100% {
        background-position: 400px 0;
    }
}
.skeleton {
    background: linear-gradient(
        90deg,
        var(--border-color) 25%,
        var(--app-bg) 50%,
        var(--border-color) 75%
    );
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* HR grid helpers */
.hr-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.hr-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.hr-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Summary pill */
.sum-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
