/* ============================================================================
   LEGALTECH — DESIGN SYSTEM (ADVBOX STYLE)
   ============================================================================
   Dark mode premium com sidebar, glassmorphism e micro-animações.
   ============================================================================ */

/* ==============================
   1. GOOGLE FONTS
   ============================== */
/* Font loaded via <link> in header.php */

/* ==============================
   2. CSS VARIABLES (DESIGN TOKENS)
   ============================== */
:root {
    /* Background */
    --bg-body: #080c14;
    --bg-sidebar: #0d1117;
    --bg-topbar: #0d1117;
    --bg-surface: rgba(17, 24, 39, 0.85);
    --bg-surface-hover: rgba(24, 33, 50, 0.9);
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(24, 33, 50, 0.8);
    --bg-input: rgba(15, 20, 35, 0.6);
    --bg-input-focus: rgba(20, 28, 48, 0.8);

    /* Primary Colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --primary-subtle: rgba(59, 130, 246, 0.1);

    /* Accent Colors */
    --teal: #06b6d4;
    --teal-glow: rgba(6, 182, 212, 0.2);
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.2);
    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.2);
    --amber: #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.2);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.2);

    /* Semantic Aliases */
    --danger: var(--red);
    --success: var(--green);
    --warning: var(--amber);
    --info: var(--teal);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;

    /* Borders */
    --border: rgba(148, 163, 184, 0.08);
    --border-hover: rgba(148, 163, 184, 0.15);
    --border-active: rgba(59, 130, 246, 0.4);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Spacing */
    --sidebar-width: 72px;
    --sidebar-expanded: 260px;
    --topbar-height: 120px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transition */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --theme-invert: invert(1) brightness(1.5);
}

/* ==============================
   2.1. LIGHT THEME OVERRIDES
   ============================== */
body.theme-light {
    /* Background */
    --bg-body: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-topbar: #ffffff;
    --bg-surface: rgba(255, 255, 255, 0.95);
    --bg-surface-hover: rgba(241, 245, 249, 0.9);
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(248, 250, 252, 0.95);
    --bg-input: rgba(241, 245, 249, 0.8);
    --bg-input-focus: rgba(226, 232, 240, 0.9);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;

    /* Borders */
    --border: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.15);
    --border-active: rgba(59, 130, 246, 0.3);

    /* Shadows (softer for light mode) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.15);
    --theme-invert: none;
}

/* ==============================
   3. RESET & BASE
   ============================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Subtle animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body.theme-light::before {
    background:
        radial-gradient(ellipse at 15% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.02) 0%, transparent 60%);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.3);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

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

a:hover {
    color: var(--teal);
}

/* ==============================
   3.1. SEMANTIC UTILITIES
   ============================== */
.theme-text-primary {
    color: var(--text-primary);
}

.theme-text-secondary {
    color: var(--text-secondary);
}

.theme-text-title {
    color: var(--text-title, var(--text-primary));
    /* Fallback */
}

/* Backgrounds */
.theme-bg-body {
    background-color: var(--bg-body);
}

.theme-bg-surface {
    background-color: var(--bg-surface);
}

.theme-bg-card {
    background-color: var(--bg-card);
}

/* Inputs and Selects */
.theme-input {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.theme-input:focus {
    background-color: var(--bg-input-focus);
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem var(--primary-glow);
    color: var(--text-primary);
}

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

/* Specific overrides for select drop-downs where styling is limited */
select.theme-input option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

/* Icon / Avatar backgrounds */
.theme-icon-bg {
    background-color: var(--bg-input);
    border: 1px solid var(--border);
}

/* ==============================
   4. SIDEBAR
   ============================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    overflow: visible;
}

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

/* Logo */
.sidebar-logo {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-logo:hover {
    background: var(--bg-surface);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-fast);
    letter-spacing: -0.02em;
}

.sidebar.expanded .sidebar-logo-text {
    opacity: 1;
}

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

.sidebar-nav-section {
    padding: 0;
    margin-bottom: 8px;
}

.sidebar-nav-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 8px 12px 4px;
    white-space: nowrap;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.sidebar.expanded .sidebar-nav-title {
    opacity: 1;
    height: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px 0;
    margin: 2px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
    position: relative;
    text-decoration: none;
    min-height: 40px;
}

.sidebar.expanded .sidebar-link {
    justify-content: flex-start;
    padding: 10px 16px;
    gap: 14px;
    margin: 2px 12px;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 17px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.sidebar-link .sidebar-link-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity var(--transition-fast), width var(--transition-fast);
    display: block;
    /* Ensure it exists for height logic in transition */
}

.sidebar.expanded .sidebar-link .sidebar-link-text {
    opacity: 1;
    width: auto;
}

/* Override para a Sidebar Direita (Tribunais) - Sempre Estática e Condensada */
.sidebar-right .sidebar-link {
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    margin: 4px;
}

.sidebar-right .sidebar-link i {
    width: auto;
    font-size: 18px;
}

.sidebar-right .sidebar-link .sidebar-link-text {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    opacity: 1 !important;
    width: auto !important;
    display: block !important;
}

.sidebar-link:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-link:hover i {
    color: var(--primary);
}

.sidebar-link.active {
    background: var(--primary-subtle);
    color: var(--primary);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.sidebar-link.active i {
    color: var(--primary);
}

/* Sidebar Toggle */
.sidebar-toggle {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
}

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

.sidebar-toggle-btn i {
    transition: transform var(--transition-normal);
}

.sidebar.expanded .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

/* Sidebar Tooltip (collapsed state) */
.sidebar:not(.expanded) .sidebar-link {
    position: relative;
}

.sidebar-link .sidebar-tooltip {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    left: 0;
    top: 0;
    background: #1e293b;
    color: #f1f5f9;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.sidebar-link .sidebar-tooltip::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent #1e293b transparent transparent;
}

.sidebar:not(.expanded) .sidebar-link:hover .sidebar-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.sidebar.expanded .sidebar-link .sidebar-tooltip {
    display: none !important;
}

/* ==============================
   5. TOP BAR
   ============================== */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 120px !important;
    min-height: 120px !important;
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1040;
    transition: left var(--transition-normal);
    gap: 16px;
}

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

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 120px !important;
    padding: 24px;
    min-height: calc(100vh - 120px) !important;
    transition: margin-left var(--transition-normal);
    position: relative;
    /* Removed z-index: 1 to prevent modal backdrop overlap */
}

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

/* Persistent Summary Bar */
.sticky-summary-bar {
    position: sticky;
    top: var(--topbar-height);
    background: var(--bg-body);
    z-index: 1000;
    padding: 15px 0;
    margin: -24px -24px 24px -24px;
    /* Offset main-content padding */
    padding-left: 24px;
    padding-right: 24px;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-normal);
}

body.theme-light .sticky-summary-bar {
    background: #f8fafc;
}

body:not(.theme-light) .sticky-summary-bar {
    background: var(--bg-body);
}

/* Search Bar */
.topbar-search {
    flex: 0 1 480px;
    /* Grow to 480px, shrink if needed but with preference */
    width: 100%;
    min-width: 300px;
    position: relative;
}

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

.topbar-search input {
    width: 100%;
    padding: 9px 14px 9px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

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

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.topbar-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    font-size: 16px;
}

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

.topbar-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid var(--bg-topbar);
}

/* Add Button */
.topbar-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px var(--primary-glow);
    margin-left: 4px;
    margin-right: 8px;
}

.topbar-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

/* User Profile */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid transparent;
}

.topbar-user:hover {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-primary);
}

.topbar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

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

.topbar-user-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.topbar-user-role {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.topbar-separator {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 8px;
}

.topbar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.topbar-logout:hover {
    background: var(--red-glow);
    color: var(--red);
}

/* Topbar Dropdowns */
.topbar-dropdown {
    position: relative;
}

.topbar-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(148, 163, 184, 0.05) inset;
    z-index: 9999;
    overflow: hidden;
    animation: dropdownSlideIn 0.15s ease;
}

.topbar-dropdown-menu.topbar-dropdown-sm {
    width: 280px;
}

.topbar-dropdown.open .topbar-dropdown-menu {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.badge-count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.dropdown-body {
    max-height: 320px;
    overflow-y: auto;
}

.dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

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

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

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

.dropdown-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: 8px;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}

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

.dropdown-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.dropdown-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.dropdown-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--text-muted);
    gap: 8px;
}

.dropdown-empty i {
    font-size: 24px;
    opacity: 0.5;
}

.dropdown-empty span {
    font-size: 13px;
}

.dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: background 0.15s ease;
}

.dropdown-footer:hover {
    background: var(--bg-surface-hover);
    color: var(--primary);
}

/* ==============================
   6. MAIN CONTENT AREA
   ============================== */
/* Page Header section (main-content positioning handled above) */
.sidebar.expanded~.topbar~.main-content,
.sidebar.expanded~.main-content {
    margin-left: var(--sidebar-expanded);
}

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

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

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==============================
   7. BOOTSTRAP OVERRIDES — DARK MODE
   ============================== */

/* Container */
.container-fluid {
    padding: 0;
}

.container-fluid.mt-4 {
    margin-top: 0 !important;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

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

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

.card-title {
    color: var(--text-primary);
    font-weight: 600;
}

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

.card-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Tables */
.table {
    color: var(--text-primary);
    border-color: var(--border);
}

.table> :not(caption)>*>* {
    background-color: transparent;
    border-bottom-color: var(--border);
    color: var(--text-primary);
    padding: 12px 16px;
}

.table>thead>tr>th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

.table>tbody>tr {
    transition: background var(--transition-fast);
}

.table>tbody>tr:hover {
    background: var(--bg-surface) !important;
}

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

.table-hover>tbody>tr:hover>* {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    border: none;
    color: white;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px var(--primary-glow);
    font-size: 13px;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 16px var(--primary-glow);
    transform: translateY(-1px);
    color: white;
}

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

.btn-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 500;
    border-radius: var(--radius-sm);
}

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

.btn-success {
    background: linear-gradient(135deg, var(--green), #16a34a);
    border: none;
    color: white;
    box-shadow: 0 2px 8px var(--green-glow);
}

.btn-success:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 4px 16px var(--green-glow);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), #dc2626);
    border: none;
    color: white;
    box-shadow: 0 2px 8px var(--red-glow);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 16px var(--red-glow);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--amber), #d97706);
    border: none;
    color: white;
    box-shadow: 0 2px 8px var(--amber-glow);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--teal), #0891b2);
    border: none;
    color: white;
    box-shadow: 0 2px 8px var(--teal-glow);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: white;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

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

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

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

.btn-outline-light {
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-outline-light:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-light {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

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

.btn-sm {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.btn-close {
    filter: invert(1);
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* Forms */
.form-control,
.form-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 13px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-input-focus);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

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

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

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border);
}

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

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

.input-group-text {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 100px;
}

/* Modals */
.modal-content {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
}

.modal-backdrop.show {
    opacity: 0.7;
}

/* Alerts */
.alert {
    border-radius: var(--radius-md);
    border: none;
    font-size: 13px;
    padding: 12px 16px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
    border-left: 3px solid var(--green);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border-left: 3px solid var(--red);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
    border-left: 3px solid var(--amber);
}

.alert-info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--teal);
    border-left: 3px solid var(--teal);
}

/* Badges */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

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

.badge.bg-success {
    background: var(--green-glow) !important;
    color: var(--green);
}

.badge.bg-warning {
    background: var(--amber-glow) !important;
    color: var(--amber);
}

.badge.bg-danger {
    background: var(--red-glow) !important;
    color: var(--red);
}

.badge.bg-info {
    background: var(--teal-glow) !important;
    color: var(--teal);
}

.badge.bg-secondary {
    background: rgba(148, 163, 184, 0.15) !important;
    color: var(--text-secondary);
}

/* Dropdown */
.dropdown-menu {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
}

.dropdown-item {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    transition: all var(--transition-fast);
}

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

.dropdown-item.active,
.dropdown-item:active {
    background: var(--primary-subtle);
    color: var(--primary);
}

.dropdown-divider {
    border-color: var(--border);
}

/* Custom Dropdown Overrides for Theme Adaptation */
.dropdown-menu.theme-bg-surface {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
}

.dropdown-menu.theme-bg-surface .dropdown-item {
    color: var(--text-primary);
}

.dropdown-menu.theme-bg-surface .dropdown-item:hover,
.dropdown-menu.theme-bg-surface .dropdown-item:focus {
    background-color: var(--bg-surface-hover);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

/* Nav Tabs */
.nav-tabs {
    border-bottom: 1px solid var(--border);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

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

.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--primary);
    border-color: transparent;
    border-bottom-color: var(--primary);
}

/* Nav Pills */
.nav-pills .nav-link {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-pills .nav-link:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.nav-pills .nav-link.active {
    background: var(--primary);
    color: white;
}

/* Pagination */
.page-link {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-secondary);
}

.page-link:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* Progress Bar */
.progress {
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--teal));
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 16px;
}

.breadcrumb-item {
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--text-muted);
}

/* Lists */
.list-group-item {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
    padding: 12px 16px;
}

.list-group-item:hover {
    background: var(--bg-surface);
}

.list-group-item.active {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

/* Text Utility Overrides */
.text-muted {
    color: var(--text-muted) !important;
}

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

.text-success {
    color: var(--green) !important;
}

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

.text-warning {
    color: var(--amber) !important;
}

.text-info {
    color: var(--teal) !important;
}

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

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

/* Bg Overrides */
.bg-light {
    background: var(--bg-body) !important;
}

.bg-white {
    background: var(--bg-sidebar) !important;
}

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

/* Borders */
.border {
    border-color: var(--border) !important;
}

.border-top {
    border-top-color: var(--border) !important;
}

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

/* Shadows */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* ==============================
   8. STAT CARDS (Dashboard Metrics)
   ============================== */
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.stat-blue::before {
    background: linear-gradient(90deg, var(--primary), var(--teal));
}

.stat-card.stat-green::before {
    background: linear-gradient(90deg, var(--green), #4ade80);
}

.stat-card.stat-purple::before {
    background: linear-gradient(90deg, var(--purple), #a78bfa);
}

.stat-card.stat-amber::before {
    background: linear-gradient(90deg, var(--amber), #fbbf24);
}

.stat-card.stat-red::before {
    background: linear-gradient(90deg, var(--red), #f87171);
}

.stat-card.stat-teal::before {
    background: linear-gradient(90deg, var(--teal), #22d3ee);
}

.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.stat-blue .stat-card-icon {
    background: var(--primary-subtle);
    color: var(--primary);
}

.stat-green .stat-card-icon {
    background: var(--green-glow);
    color: var(--green);
}

.stat-purple .stat-card-icon {
    background: var(--purple-glow);
    color: var(--purple);
}

.stat-amber .stat-card-icon {
    background: var(--amber-glow);
    color: var(--amber);
}

.stat-red .stat-card-icon {
    background: var(--red-glow);
    color: var(--red);
}

.stat-teal .stat-card-icon {
    background: var(--teal-glow);
    color: var(--teal);
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

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

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

.stat-card-trend.up {
    background: var(--green-glow);
    color: var(--green);
}

.stat-card-trend.down {
    background: var(--red-glow);
    color: var(--red);
}

/* ==============================
   9. LOGIN PAGE
   ============================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
    animation: loginGlow 25s ease infinite alternate;
}

@keyframes loginGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-3%, -3%) scale(1.05);
    }
}

.login-container {
    max-width: 420px;
    width: 100%;
    margin: 0;
    padding: 40px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(59, 130, 246, 0.05);
    position: relative;
    z-index: 1;
    animation: loginFadeIn 0.5s ease;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container .form-label {
    color: var(--text-secondary);
}

.login-container .form-control {
    background: var(--bg-input);
    border-color: var(--border);
    color: var(--text-primary);
    padding: 11px 14px;
}

.login-container .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-container .input-group-text {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
    color: var(--text-muted);
}

.login-container .btn-primary {
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.login-container h1,
.login-container .h3 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.login-container .text-muted {
    color: var(--text-muted) !important;
}

/* ==============================
   10. FOOTER
   ============================== */
.footer {
    margin-left: var(--sidebar-width);
    background: var(--bg-sidebar) !important;
    border-top: 1px solid var(--border) !important;
    padding: 16px 24px !important;
    transition: margin-left var(--transition-normal);
}

.sidebar.expanded~.topbar~.main-content~.footer,
.sidebar.expanded~.footer {
    margin-left: var(--sidebar-expanded);
}

.footer .text-muted {
    color: var(--text-muted) !important;
    font-size: 12px;
}

/* ==============================
   11. RESPONSIVE
   ============================== */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
        width: var(--sidebar-expanded);
    }

    .sidebar.mobile-open .sidebar-logo-text,
    .sidebar.mobile-open .sidebar-link-text,
    .sidebar.mobile-open .sidebar-nav-title {
        opacity: 1;
        height: auto;
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .footer {
        margin-left: 0;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1045;
    }

    .sidebar.mobile-open~.mobile-overlay {
        display: block;
    }

    .topbar-user-name,
    .topbar-user-role {
        display: none;
    }

    .topbar-add-btn span:not(.btn-icon) {
        display: none;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 16px;
    }

    .topbar {
        padding: 0 12px;
    }

    .topbar-search {
        display: none;
    }
}

/* ==============================
   12. ANIMATIONS
   ============================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-slideUp {
    animation: slideInUp 0.3s ease;
}

/* ==============================
   13. KANBAN OVERRIDES
   ============================== */
.kanban-column {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
}

.kanban-item {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
}

.kanban-item:hover {
    border-color: var(--border-hover) !important;
    box-shadow: var(--shadow-md) !important;
}

/* ==============================
   14. MISC HELPERS
   ============================== */
.glassmorphism {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.glow-blue {
    box-shadow: var(--shadow-glow);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

@media (max-width: 991px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* ==============================
   ACTIONS DROPDOWN (3 DOTS)
   ============================== */
.actions-dropdown .btn-actions {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.actions-dropdown .btn-actions:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

/* Theme-aware dropdown menu */
.dropdown-menu {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    border-radius: var(--radius-md);
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

/* =========================================
   GLOBAL SEARCH DROPDOWN
   ========================================= */
.global-search-container {
    position: relative;
    width: 100%;
}

#searchResultsDropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    min-width: 350px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 480px;
    overflow-y: auto;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.25s ease;
}

#searchResultsDropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.search-category-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 10px 16px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 4px;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: var(--primary-subtle);
    border-radius: 6px;
    margin: 0 4px;
}

.search-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 14px;
}

.search-result-content {
    flex-grow: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* =========================================
   WEATHER WIDGET
   ========================================= */
.topbar-weather {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-right: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
    cursor: default;
}

.topbar-weather:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.topbar-weather i {
    font-size: 15px;
}

.topbar-weather .weather-city {
    opacity: 0.8;
}

.topbar-weather .weather-temp {
    font-weight: 600;
    color: var(--text-primary);
}
/* =========================================
   GLOBAL OVERRIDES (FIX LOGO OVERFLOW)
   ========================================= */
.topbar {
    height: 120px !important;
    min-height: 120px !important;
}

.main-content {
    margin-top: 120px !important;
}

.sidebar-logo {
    height: 120px !important;
}

body.sidebar-expanded .topbar {
    left: var(--sidebar-expanded) !important;
}
