/* ================================
   Design System & Variables
   ================================ */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    --color-blue: #667eea;
    --color-purple: #764ba2;
    --color-pink: #f093fb;
    --color-green: #10b981;
    --color-orange: #f59e0b;
    --color-red: #ef4444;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 72px;
}

/* --- THEME DEFINITIONS --- */


/* 5. WINDOWS 11 LIGHT (Mica/Fluent Design) */
.theme-win11-light {
    /* Mica Effect Colors */
    --bg-primary: #f3f3f3;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.85);
    --text-primary: #1a1a1a;
    --text-secondary: #5e5e5e;
    --text-muted: #707070;
    
    --color-blue: #0078d4; /* Win11 Brand Blue */
    --color-purple: #4f6bed;
    --gradient-primary: linear-gradient(135deg, #0078d4 0%, #00c6ff 100%);
    
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 12px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(0, 120, 212, 0.15);
    
    --font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --backdrop-blur: blur(20px);
}

/* 6. WINDOWS 11 DARK (Dark Mica) */
.theme-win11-dark {
    /* Dark Mica Effect Colors */
    --bg-primary: #202020;
    --bg-secondary: #1a1a1a;
    --bg-card: rgba(32, 32, 32, 0.7);
    --bg-card-hover: rgba(45, 45, 45, 0.85);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    
    --color-blue: #0078d4;
    --color-purple: #4f6bed;
    --gradient-primary: linear-gradient(135deg, #0078d4 0%, #00c6ff 100%);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 12px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(0, 120, 212, 0.2);
    
    --font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --backdrop-blur: blur(25px);
}

/* 7. WINDOWS 11 EMERALD (Dark Mica Emerald) */
.theme-win11-emerald {
    --bg-primary: #0a140f;
    --bg-secondary: #050a08;
    --bg-card: rgba(16, 185, 129, 0.08);
    --bg-card-hover: rgba(16, 185, 129, 0.15);
    --text-primary: #e6f7ef;
    --text-secondary: rgba(230, 247, 239, 0.7);
    --text-muted: rgba(230, 247, 239, 0.4);
    
    --color-blue: #10b981; /* Primary Emerald */
    --color-purple: #059669;
    --color-green: #10b981;
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --border-color: rgba(16, 185, 129, 0.15);
    --border-hover: rgba(16, 185, 129, 0.3);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 12px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(16, 185, 129, 0.1);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
    
    --font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --backdrop-blur: blur(25px);
}

/* 8. WINDOWS 11 BLUE (Dark Mica Blue) */
.theme-win11-blue {
    --bg-primary: #0a1120;
    --bg-secondary: #050810;
    --bg-card: rgba(59, 130, 246, 0.08);
    --bg-card-hover: rgba(59, 130, 246, 0.15);
    --text-primary: #e0f2fe;
    --text-secondary: rgba(224, 242, 254, 0.7);
    --text-muted: rgba(224, 242, 254, 0.4);
    
    --color-blue: #3b82f6; /* Primary Vibrant Blue */
    --color-purple: #1d4ed8;
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    
    --border-color: rgba(59, 130, 246, 0.15);
    --border-hover: rgba(59, 130, 246, 0.3);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 12px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(59, 130, 246, 0.1);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);
    
    --font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --backdrop-blur: blur(25px);
}

/* Windows 11 Shared Component Overrides */
.theme-win11-light .stat-card, .theme-win11-dark .stat-card,
.theme-win11-emerald .stat-card, .theme-win11-blue .stat-card,
.theme-win11-light .chart-card, .theme-win11-dark .chart-card,
.theme-win11-emerald .chart-card, .theme-win11-blue .chart-card,
.theme-win11-light .financial-edit-area, .theme-win11-dark .financial-edit-area,
.theme-win11-emerald .financial-edit-area, .theme-win11-blue .financial-edit-area,
.theme-win11-light .modal-content, .theme-win11-dark .modal-content,
.theme-win11-emerald .modal-content, .theme-win11-blue .modal-content,
.theme-win11-light .message-item, .theme-win11-dark .message-item,
.theme-win11-emerald .message-item, .theme-win11-blue .message-item,
.theme-win11-light .top-header, .theme-win11-dark .top-header,
.theme-win11-emerald .top-header, .theme-win11-blue .top-header,
.theme-win11-light .filter-box, .theme-win11-dark .filter-box,
.theme-win11-emerald .filter-box, .theme-win11-blue .filter-box,
.theme-win11-light .data-section, .theme-win11-dark .data-section,
.theme-win11-emerald .data-section, .theme-win11-blue .data-section,
.theme-win11-light .process-horizontal-card, .theme-win11-dark .process-horizontal-card,
.theme-win11-emerald .process-horizontal-card, .theme-win11-blue .process-horizontal-card,
.theme-win11-light .item-block, .theme-win11-dark .item-block,
.theme-win11-emerald .item-block, .theme-win11-blue .item-block {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
}

.theme-win11-light .sidebar, .theme-win11-dark .sidebar,
.theme-win11-emerald .sidebar, .theme-win11-blue .sidebar {
    background: var(--bg-primary);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--border-color);
}

.theme-win11-light .nav-item.active, .theme-win11-dark .nav-item.active,
.theme-win11-emerald .nav-item.active, .theme-win11-blue .nav-item.active {
    background: rgba(0, 120, 212, 0.15);
    color: var(--color-blue);
    border-left: 4px solid var(--color-blue);
    border-radius: 4px;
}

.theme-win11-emerald .nav-item.active {
    background: rgba(16, 185, 129, 0.15);
}

.theme-win11-blue .nav-item.active {
    background: rgba(59, 130, 246, 0.15);
}

.theme-win11-light .nav-item.active::before, .theme-win11-dark .nav-item.active::before {
    display: none;
}

.theme-win11-light .btn-primary, .theme-win11-dark .btn-primary,
.theme-win11-emerald .btn-primary, .theme-win11-blue .btn-primary {
    background: var(--color-blue);
    color: #fff;
    border-radius: 4px;
    font-weight: 500;
}

.theme-win11-light .btn-primary:hover, .theme-win11-dark .btn-primary:hover,
.theme-win11-emerald .btn-primary:hover, .theme-win11-blue .btn-primary:hover {
    filter: brightness(1.1);
}

.theme-win11-light .financial-input, .theme-win11-dark .financial-input,
.theme-win11-emerald .financial-input, .theme-win11-blue .financial-input {
    background: var(--bg-secondary);
    border: 1px solid #d1d1d1;
    border-bottom: 2px solid #858585;
    border-radius: 4px;
}

.theme-win11-dark .financial-input, .theme-win11-emerald .financial-input, .theme-win11-blue .financial-input {
    border-color: #444;
    border-bottom-color: #666;
}

.theme-win11-light .financial-input:focus, .theme-win11-dark .financial-input:focus,
.theme-win11-emerald .financial-input:focus, .theme-win11-blue .financial-input:focus {
    border-bottom-color: var(--color-blue);
}

.theme-win11-light .background-effects {
    background: linear-gradient(135deg, #e6f3ff 0%, #ffffff 100%);
}

.theme-win11-dark .background-effects, .theme-win11-emerald .background-effects, .theme-win11-blue .background-effects {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.theme-win11-light .gradient-orb, .theme-win11-dark .gradient-orb,
.theme-win11-emerald .gradient-orb, .theme-win11-blue .gradient-orb {
    opacity: 0.15;
    filter: blur(120px);
}

/* Theme Button Styles */
.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.theme-btn:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.theme-btn.active {
    background: var(--bg-card-hover);
    border-color: var(--color-blue);
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px var(--color-blue), var(--shadow-md);
}

/* Checkmark indicator for active theme */
.theme-btn.active::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--color-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.theme-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.theme-btn:hover .theme-preview {
    transform: scale(1.1) rotate(5deg);
}

.theme-btn span {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}



/* ================================
   Reset & Base Styles
   ================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--color-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-purple);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
}

/* ================================
   Background Effects
   ================================ */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--color-blue);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--color-purple);
    bottom: -150px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--color-pink);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* ================================
   Login Page Styles
   ================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-lg);
}

.login-container {
    width: 100%;
    max-width: 440px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.logo {
    margin-bottom: var(--space-lg);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    color: var(--text-muted);
    transition: color var(--transition-fast);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-base);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.input-wrapper input:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--color-blue);
}

.toggle-password {
    position: absolute;
    right: var(--space-md);
    color: var(--text-muted);
    padding: var(--space-xs);
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--text-primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all var(--transition-fast);
    position: relative;
}

.checkbox-wrapper input:checked+.checkmark {
    background: var(--gradient-primary);
    border-color: transparent;
}

.checkbox-wrapper input:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.forgot-link:hover {
    color: var(--color-blue);
}

.btn-login {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.error-message {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--color-red);
    font-size: 0.875rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.login-footer {
    margin-top: var(--space-xl);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ================================
   Dashboard Page Styles
   ================================ */
.dashboard-page {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(18, 18, 26, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl);
    border-bottom: 1px solid transparent;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--color-blue);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--color-blue);
    border-radius: var(--radius-full);
    box-shadow: 0 0 10px var(--color-blue);
}

.sidebar-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-red);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-xl);
    min-height: 100vh;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    background: transparent;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.menu-toggle {
    display: none;
    padding: var(--space-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-greeting {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Search Section */
.search-section {
    margin-bottom: var(--space-xl);
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.search-box {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0 var(--space-lg);
    border-radius: var(--radius-full);
    height: 50px;
    width: 380px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 8px 32px rgba(0, 0, 0, 0.2);
    background: var(--bg-card-hover);
}

.search-icon {
    color: var(--text-muted);
    margin-right: var(--space-md);
    transition: color var(--transition-fast);
}

.search-box:focus-within .search-icon {
    color: var(--color-blue);
}

.search-input {
    flex: 1;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-shortcut {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: inherit;
}

.search-clear {
    margin-left: var(--space-sm);
    padding: var(--space-xs);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.search-clear:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-filters {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all var(--transition-base);
}

.filter-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

/* Results Section */
.results-section {
    margin-bottom: var(--space-xl);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.results-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.results-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    min-height: 200px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: var(--space-lg);
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 300px;
}

.results-list {
    padding: var(--space-md);
}

.result-item {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
}

/* Base Filter Box Style (Used in Dashboard & Database) */
.filter-box {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0 var(--space-lg);
    border-radius: var(--radius-full);
    height: 44px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-lg);
}

.filter-box:focus-within {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    background: var(--bg-card-hover);
}

.filter-icon {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.filter-box:focus-within .filter-icon {
    color: var(--color-blue);
}

.filter-input {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.result-item:hover {
    background: var(--bg-card-hover);
}

.result-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon.document {
    background: rgba(102, 126, 234, 0.15);
    color: var(--color-blue);
}

.result-icon.user {
    background: rgba(118, 75, 162, 0.15);
    color: var(--color-purple);
}

.result-icon.setting {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-green);
}

.result-content {
    flex: 1;
}

.result-title {
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.result-title mark {
    background: rgba(102, 126, 234, 0.3);
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

.result-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Stats Section */
.stats-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: all var(--transition-base);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: rgba(102, 126, 234, 0.15);
    color: var(--color-blue);
}

.stat-icon.purple {
    background: rgba(118, 75, 162, 0.15);
    color: var(--color-purple);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-green);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-orange);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ================================
   Action Button Section
   ================================ */
.action-section {
    margin-top: var(--space-xl);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--gradient-primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;

    /* 3D Depth Shadow */
    box-shadow:
        0 3px 0 rgba(0, 0, 0, 0.4),
        0 6px 15px rgba(102, 126, 234, 0.3);
    top: 0;
}

.btn-action:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.4),
        0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-action:active {
    transform: translateY(2px);
    box-shadow:
        0 0 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* ================================
   Processos Section
   ================================ */
.processos-section {
    margin-top: var(--space-xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.processos-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.processos-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.processos-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

.processos-empty svg {
    margin-bottom: var(--space-lg);
    opacity: 0.3;
}

.processos-empty h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.processos-empty p {
    font-size: 0.9rem;
}

.processos-table-wrapper {
    overflow-x: auto;
}

.processos-table {
    width: 100%;
    border-collapse: collapse;
}

.processos-table th,
.processos-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.processos-table th {
    background: var(--bg-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.processos-table tbody tr {
    transition: background var(--transition-fast);
}

.processos-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.processos-table tbody tr:last-child td {
    border-bottom: none;
}

.processos-table td {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.parcelamento-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(102, 126, 234, 0.15);
    color: var(--color-blue);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.action-buttons {
    display: flex;
    gap: var(--space-sm);
}

.btn-icon {
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-icon.view:hover {
    color: var(--color-blue);
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-red);
}

/* ================================
   Settings & User Management
   ================================ */
.settings-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.settings-tab-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all var(--transition-base);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.settings-tab-btn.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--color-blue);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.1);
}

.settings-tab-content {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-mgmt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.users-table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    text-align: left;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.users-table td {
    border-bottom: 1px solid var(--border-color);
}

.users-table tr:last-child td {
    border-bottom: none;
}

.user-form-overlay {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

/* ================================
   Modal Styles
   ================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    padding: var(--space-xs);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-form {
    padding: var(--space-xl);
}

.parcelamento-submenu {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    animation: submenuFadeIn 0.3s ease;
}

@keyframes submenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0 var(--space-md);
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-base);
    line-height: 44px;
}

/* Adjust padding for textarea since it shouldn't have fixed height */
.form-group textarea {
    height: auto;
    padding: var(--space-md);
    min-height: 80px;
    line-height: 1.6;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Specific Select Option Styles for Readability */
.form-group select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-md);
}

/* Tema Claro overrides for select options */
.theme-light .form-group select option {
    background-color: #ffffff;
    color: #334155;
}

.financial-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Parcelamento Radio Options */
.parcelamento-options {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.radio-option:hover {
    color: var(--text-primary);
}

.radio-option input {
    display: none;
}

.radio-checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    position: relative;
    transition: all var(--transition-fast);
}

.radio-option input:checked+.radio-checkmark {
    border-color: var(--color-blue);
    background: transparent;
}

.radio-option input:checked+.radio-checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.radio-option input:checked~span:last-child {
    color: var(--text-primary);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    top: 0;

    /* 3D Depth Shadow */
    box-shadow:
        0 2px 0 rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow:
        0 3px 0 rgba(0, 0, 0, 0.4),
        0 5px 10px rgba(0, 0, 0, 0.3);
}

.btn-secondary:active {
    transform: translateY(2px);
    box-shadow:
        0 0 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--gradient-primary);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    top: 0;

    /* 3D Depth Shadow */
    box-shadow:
        0 3px 0 rgba(0, 0, 0, 0.4),
        0 6px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.4),
        0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow:
        0 0 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* ================================
   Toast Notification
   ================================ */
.toast {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--color-green);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    color: var(--color-green);
    animation: slideInRight 0.3s ease;
    z-index: 1001;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Dashboard Main Grid Layout */
.dashboard-body-grid {
    display: grid;
    grid-template-columns: 1fr 540px;
    gap: var(--space-xl);
    align-items: flex-start;
}

.main-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Messages Section */
.messages-section {
    margin-top: var(--space-xl);
}

.messages-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.section-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.btn-clear-all {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 4px 10px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-clear-all:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-red);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-remove-item {
    padding: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
    /* Hidden until hover */
}

.message-item:hover .btn-remove-item,
.deadline-alert-card:hover .btn-remove-item {
    opacity: 1;
}

.btn-remove-item:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-red);
}

.messages-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-height: 400px;
    overflow-y: auto;
}

.message-item {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.message-item.alert-critical {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    border-left: 4px solid var(--color-red);
}

.message-item.alert-confirmed {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    border-left: 4px solid var(--color-blue);
}

/* Deadline Alerts */
.deadline-alerts-area {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.deadline-alert-card {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--color-orange);
    border-left: 5px solid var(--color-orange);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    animation: slideInDown 0.4s ease;
}

.deadline-alert-icon {
    color: var(--color-orange);
    flex-shrink: 0;
}

.deadline-alert-content {
    flex: 1;
}

.deadline-alert-title {
    font-weight: 700;
    color: var(--color-orange);
    margin-bottom: 4px;
    display: block;
}

.deadline-alert-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.deadline-alert-details b {
    color: var(--text-primary);
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Donut Chart Styles */
.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

/* 3D Disc Chart Styles */
.pie-3d-scene {
    perspective: 1500px;
    width: 750px;
    height: 750px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: var(--space-2xl) 0;
}

.pie-3d-container {
    position: relative;
    width: 640px;
    height: 640px;
    transform-style: preserve-3d;
    transform: rotateX(55deg) rotateZ(0deg);
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.pie-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.pie-top {
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 60%),
        conic-gradient(var(--color-blue) 0deg var(--pie-angle, 0deg),
            rgba(255, 255, 255, 0.05) var(--pie-angle, 0deg) 360deg);
    transform: translateZ(90px);
    box-shadow:
        inset 0 0 0 4px rgba(255, 255, 255, 0.1),
        inset 0 0 80px rgba(0, 0, 0, 0.4),
        0 0 100px rgba(102, 126, 234, 0.1),
        0 8px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pie-bottom {
    background: rgba(0, 0, 0, 0.4);
    transform: translateZ(0px);
    filter: blur(10px);
}

/* Simulated side panels with improved texture */
.pie-top::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    transform: translateZ(-90px);
    filter: brightness(0.4) contrast(1.1);
    z-index: -1;
    border: 2px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.pie-bottom {
    background: rgba(0, 0, 0, 0.6);
    transform: translateZ(-5px);
    filter: blur(25px);
    width: 110%;
    height: 110%;
    left: -5%;
    top: -5%;
}

.pie-percentage-overlay {
    transform: rotateX(-55deg) translate3d(var(--label-x, 0), var(--label-y, 0), 10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-primary);
    pointer-events: none;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    width: 240px;
    height: 160px;
    top: calc(50% - 80px);
    left: calc(50% - 120px);
}

.pie-percentage-overlay span {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    background: linear-gradient(180deg, #fff 0%, #cbd5e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pie-percentage-overlay small {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-primary);
    font-weight: 700;
    margin-top: 8px;
    opacity: 0.9;
}

.message-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
}

.message-item.alert-critical {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    animation: pulse-red 2s infinite ease-in-out;
}

.message-item.alert-critical:hover {
    border-color: var(--color-red);
}

.message-item.alert-confirmed {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
}

.message-item.alert-confirmed:hover {
    border-color: var(--color-blue);
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-blue);
    transform: translateX(4px);
}

.item-notification-entry.unread {
    animation: pulse-red 2s infinite ease-in-out;
}

@keyframes pulse-red {

    0%,
    100% {
        background-color: rgba(239, 68, 68, 0.08);
    }

    50% {
        background-color: rgba(239, 68, 68, 0.25);
    }
}

.item-notification-entry {
    pointer-events: auto;
}

.btn-delete-notif {
    pointer-events: auto !important;
    z-index: 10;
    position: relative;
}

.btn-confirm-activity {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-confirm-activity:hover {
    color: var(--color-blue);
    transform: scale(1.1);
}

.message-item.alert-confirmed .btn-confirm-activity {
    color: var(--color-blue);
    opacity: 0.5;
    pointer-events: none;
}

.message-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-green);
}

.message-icon.info {
    background: rgba(102, 126, 234, 0.1);
    color: var(--color-blue);
}

.message-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-orange);
}

.message-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    overflow: hidden;
}

.message-text {
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.message-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
    gap: var(--space-md);
}

.message-empty svg {
    opacity: 0.2;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

@media (max-width: 1200px) {
    .dashboard-body-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================
   Detail Dashboard Section (Tabs)
   ================================ */
.detail-dashboard-section {
    animation: fadeIn 0.4s ease;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.detail-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-base);
}

.btn-back:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateX(-4px);
}

.detail-status-badge {
    padding: var(--space-xs) var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Horizontal Summary Card */
.process-horizontal-card {
    position: relative;
    z-index: 100;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.horizontal-info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
}

.info-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-block label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 2px;
}

.info-block span {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Financial Edit Area */
.financial-edit-area {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    transition: all 0.3s ease;
}

.financial-edit-area.homologacao-partial-dimmed {
    opacity: 0.6;
    filter: grayscale(0.8);
    pointer-events: none;
    /* Previne edição nos campos enquanto esmaecido, as the buttons need to be clickable, we'll override pointer-events for them */
}

.financial-edit-area.homologacao-partial-dimmed .btn-homologacao-parcial {
    pointer-events: auto;
    /* Garante que o botão em si continue clicável para poder 'Remover' */
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.items-table-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    border: 1px solid var(--border-color);
}

.header-col {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.financial-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: var(--space-md);
    align-items: center;
}

.financial-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.financial-field label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-currency-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-prefix {
    position: absolute;
    left: var(--space-sm);
    color: var(--color-blue);
    font-weight: 600;
    font-size: 0.85rem;
    pointer-events: none;
}

.financial-input {
    width: 100%;
    padding: var(--space-sm) var(--space-sm) var(--space-sm) 38px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--color-blue);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    height: 34px;
    transition: all var(--transition-base);
}

.financial-input.readonly {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-blue);
    cursor: default;
    border-left: 3px solid transparent;
}

.financial-input.positive {
    color: var(--color-green);
}

.financial-input.negative {
    color: var(--color-red);
}

.financial-input.deadline-expired {
    color: var(--color-red) !important;
    font-weight: 700;
}

.financial-input:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.validation-summary {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: none;
}

/* Document Status Buttons (3D Enhanced) */
.btn-status-doc {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 110px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    line-height: 1.1;

    /* 3D Depth Shadow */
    box-shadow:
        0 3px 0 rgba(0, 0, 0, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    top: 0;
}

.btn-status-doc:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
    box-shadow:
        0 3px 0 rgba(0, 0, 0, 0.4),
        0 5px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-status-doc:active {
    transform: translateY(2px);
    box-shadow:
        0 0 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-status-doc.active {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-status-doc:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1);
    box-shadow: none;
    transform: none;
    background: var(--bg-secondary);
}

/* Specific colors for 3D state */
.btn-status-doc.homologacao-ativa {
    background: linear-gradient(180deg, #9f7aea 0%, #805ad5 100%);
    box-shadow:
        0 3px 0 #553c9a,
        0 6px 20px rgba(128, 90, 213, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-status-doc[data-type="propostaOk"].active {
    background: linear-gradient(180deg, #4facfe 0%, #00f2fe 100%);
    box-shadow:
        0 3px 0 #0099cc,
        0 6px 20px rgba(79, 172, 254, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-status-doc[data-type="habilitacaoOk"].active {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    box-shadow:
        0 3px 0 #047857,
        0 6px 20px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Pressed state for active buttons */
.btn-status-doc.active:active {
    box-shadow:
        0 0 0 transparent,
        inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Specific highlight for Documentação buttons (Group 2) - Solid Gradient */
.btn-status-doc[data-type="propostaOk"].active,
.btn-status-doc[data-type="habilitacaoOk"].active,
.btn-status-doc[data-type="amostraOk"].active {
    background: linear-gradient(180deg, #4facfe 0%, #00f2fe 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 3px 0 #0099cc,
        0 6px 15px rgba(79, 172, 254, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* Specific highlight for Resultado buttons (Group 3) - Solid Gradient */
.btn-status-doc[data-type="aceitoHabilitadoOk"].active,
.btn-status-doc[data-type="homologadoOk"].active,
.btn-status-doc[data-type="desertoOk"].active,
.btn-status-doc[data-type="fracassadoOk"].active {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 3px 0 #047857,
        0 6px 15px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* Estado suave de destaque para Homologação Parcial com dados preenchidos */
.btn-status-doc.homologacao-ativa {
    background: linear-gradient(180deg, #d8b4e2 0%, #b886c9 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 3px 0 #8c5d9e,
        0 6px 15px rgba(184, 134, 201, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Specific highlight for Recursos buttons - Blue Gradient */
.btn-status-doc[data-type="intencaoOk"].active,
.btn-status-doc[data-type="recursoOk"].active,
.btn-status-doc[data-type="orgaoOk"].active,
.btn-status-doc[data-type="prolicOk"].active {
    background: linear-gradient(180deg, #4facfe 0%, #00f2fe 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 3px 0 #0099cc,
        0 6px 15px rgba(79, 172, 254, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    color: #fff;
    font-weight: 800;
}


/* Unificação Global Absoluta dos Botões de Gestão (Header) */
#header-status-buttons .btn-status-doc {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    opacity: 1 !important;
    top: 0 !important;
    font-weight: 700 !important;
}

/* Estado Ativo: ULTRA-SUTIL e TOTALMENTE UNIFICADO (Fundo e Sombra Idênticos) */
#header-status-buttons .btn-status-doc.active,
#header-status-buttons .btn-status-doc.homologacao-ativa {
    background: var(--bg-card) !important; /* Fundo idêntico */
    color: var(--color-blue) !important;   /* Texto muda de cor */
    border: 1px solid var(--color-blue) !important; /* Borda idêntica (1px) */
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.1) !important; /* Sombra idêntica */
    text-shadow: none !important;
    opacity: 1 !important;
}

/* Estado Desabilitado Unificado para o Grupo de Gestão */
#header-status-buttons .btn-status-doc:disabled {
    background: var(--bg-card) !important;
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    border: 1px solid var(--border-color) !important;
}

/* Hover consistente (Apenas para não-desabilitados) */
#header-status-buttons .btn-status-doc:not(:disabled):hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
    background: var(--bg-card-hover) !important;
}

.recorrente-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-base);
}

.recorrente-item:hover {
    border-color: var(--color-blue);
    background: var(--bg-card-hover);
}

.recorrente-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recorrente-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
}

.recorrente-doc {
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* Dispute Type Buttons (3D Enhanced) */
.btn-tipo-disputa {
    min-width: 160px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    position: relative;
    top: 0;
    box-shadow:
        0 3px 0 rgba(0, 0, 0, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn-tipo-disputa:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.3);
}

.btn-tipo-disputa:active {
    transform: translateY(2px);
    box-shadow:
        0 0 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-tipo-disputa.tipo-ampla {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 3px 0 #047857, 0 6px 12px rgba(16, 185, 129, 0.3);
}

.btn-tipo-disputa.tipo-cota {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    box-shadow: 0 3px 0 #b45309, 0 6px 12px rgba(245, 158, 11, 0.3);
}

.btn-tipo-disputa.tipo-exclusiva {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    box-shadow: 0 3px 0 #6d28d9, 0 6px 12px rgba(139, 92, 246, 0.3);
}

/* Custom Dropdowns for Status Buttons */
.status-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-secondary) !important;
    background: var(--bg-secondary) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000 !important;
    display: none;
    min-width: 220px;
    margin-top: 8px;
    /* overflow: hidden; -- Removed to allow submenus */
    padding: 5px 0;
}

.dropdown-menu.show {
    display: block;
    animation: fadeInScale 0.2s ease-out;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Firefox and standards */
input[type=number] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

.alert-pregao {
    border-left: 4px solid var(--color-red) !important;
}

.blink {
    animation: blink-alert 1.5s ease-in-out infinite;
}

@keyframes blink-alert {
    0%, 100% {
        background-color: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.3);
    }
    50% {
        background-color: rgba(239, 68, 68, 0.4);
        border-color: rgba(239, 68, 68, 0.8);
    }
}

@keyframes blink-bg {

    0%,
    100% {
        background-color: rgba(239, 68, 68, 0.2);
    }

    50% {
        background-color: rgba(239, 68, 68, 0.5);
    }
}

.deadline-expired {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #fff !important;
    font-weight: 800 !important;
    border: 1px solid var(--color-red) !important;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-weight: 600;
    white-space: nowrap;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--color-blue);
    padding-left: 20px;
}

.dropdown-item.selected {
    color: var(--color-blue);
    background: rgba(102, 126, 234, 0.1);
}

/* Submenu Styles */
.dropdown-item {
    position: relative;
}

.has-submenu::after {
    content: ' ▶';
    font-size: 0.6rem;
    float: right;
    margin-left: 10px;
    opacity: 0.7;
}

.submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 10001;
    padding: 5px 0;
    margin-left: 2px;
}

.has-submenu.active-submenu > .submenu {
    display: block;
    animation: fadeInScale 0.2s ease-out;
}

.submenu .dropdown-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.submenu .dropdown-item:last-child {
    border-bottom: none;
}

.validation-summary.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: block;
}

/* ================================
   Tipo de Disputa Dropdown
   ================================ */
.btn-tipo-disputa:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-tipo-disputa:active {
    transform: translateY(0);
}

.tipo-disputa-menu {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tipo-disputa-menu .dropdown-item:hover {
    background: var(--bg-card-hover);
    padding-left: 18px;
}

.tipo-disputa-menu .dropdown-item:active {
    background: var(--bg-card-hover);
}

/* ================================
   Responsive Styles
   ================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: var(--space-xl);
    }

    .search-shortcut {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-greeting {
        display: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        max-height: 85vh;
    }

    .parcelamento-options {
        flex-direction: column;
        gap: var(--space-md);
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .btn-secondary,
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: var(--space-lg);
    }

    .form-options {
        flex-direction: column;
        gap: var(--space-md);
        align-items: flex-start;
    }

    .filter-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.8rem;
    }

    .toast {
        left: var(--space-md);
        right: var(--space-md);
        bottom: var(--space-md);
    }
}

/* Back to Top Button */
.btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: var(--radius-full);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-back-to-top:hover {
    background: var(--gradient-primary);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    border-color: transparent;
}

.btn-back-to-top:active {
    transform: translateY(0);
}

/* ==========================================================================
   Document Editor (A4 Paper) Styles
   ========================================================================== */
.document-editor-section {
    animation: fadeIn 0.4s ease-out;
}

.paper-container {
    display: flex;
    justify-content: center;
    background: #1e1e26;
    /* Darker background to contrast paper */
    padding: 60px 40px;
    border-radius: 16px;
    overflow-y: auto;
    max-height: 85vh;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
    scrollbar-width: thin;
    scrollbar-color: var(--color-blue) var(--bg-secondary);
}

.paper-a4 {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    color: #000;
    padding: 25mm 20mm;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.6;
    outline: none;
    box-sizing: border-box;
    overflow-wrap: break-word;
    transition: all 0.3s ease;
}

/* --- Clean Slate Mode: For Imported Models --- */
.paper-a4.model-mode {
    padding: 0 !important;
    /* Allow the imported content to define margins */
    font-family: initial !important;
    line-height: initial !important;
}

.paper-a4.model-mode * {
    all: revert;
    /* Attempt to reset to browser defaults for imported content */
    box-sizing: border-box;
}

/* Preserve specific utility classes for mammoth.js */
.paper-a4.model-mode .text-center {
    text-align: center !important;
    display: block;
}

.paper-a4.model-mode .text-right {
    text-align: right !important;
    display: block;
}

.paper-a4.model-mode .text-left {
    text-align: left !important;
    display: block;
}

.paper-a4.model-mode .text-justify {
    text-align: justify !important;
    display: block;
}

/* Ensure images and tables don't break the A4 width */
.paper-a4.model-mode img,
.paper-a4.model-mode table {
    max-width: 100% !important;
    height: auto !important;
}

/* Reset for plain text imports */
.paper-a4.model-mode pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
}

/* Ensure imported content maintains its structure */
.paper-a4 * {
    max-width: 100%;
}

.paper-a4 table {
    width: 100% !important;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.paper-a4 td,
.paper-a4 th {
    border: 1px solid #000;
    padding: 8px;
}

.paper-a4 img {
    max-width: 100%;
    height: auto;
}

/* Editable Field Enhancements */
.editable-field {
    background: rgba(139, 92, 246, 0.05);
    border-bottom: 1px dashed #8b5cf6;
    color: inherit;
    padding: 0 4px;
    transition: all 0.2s ease;
    cursor: text;
    display: inline-block;
    min-width: 20px;
}

.editable-field:hover {
    background: rgba(139, 92, 246, 0.1);
}

.editable-field:focus {
    background: rgba(139, 92, 246, 0.15);
    border-bottom-style: solid;
    outline: none;
}

/* Mammoth.js Alignment Fixes (since mammoth uses tags/classes for alignment) */
.paper-a4 .text-center {
    text-align: center !important;
}

.paper-a4 .text-right {
    text-align: right !important;
}

.paper-a4 .text-left {
    text-align: left !important;
}

.paper-a4 .text-justify {
    text-align: justify !important;
}

@media print {

    .sidebar,
    .top-header,
    .editor-header,
    .btn-back-to-top,
    .toast {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .paper-container {
        padding: 0 !important;
        background: #fff !important;
        overflow: visible !important;
        max-height: none !important;
        box-shadow: none !important;
    }

    .paper-a4 {
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        /* Let printer handle margins */
    }
}

/* Server Status Banner */
.server-status-banner {
    display: none;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #9b1c1c;
    padding: 12px 20px;
    margin: 15px 20px 0 20px;
    border-radius: 10px;
    border-left: 5px solid #9b1c1c;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(155, 28, 28, 0.1);
    animation: slideDown 0.4s ease-out;
}

.server-status-banner.visible {
    display: flex;
}

.server-status-banner svg {
    flex-shrink: 0;
    color: #9b1c1c;
}

.server-status-banner .btn-retry-server {
    background: #9b1c1c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: auto;
    transition: all 0.3s ease;
}

.server-status-banner .btn-retry-server:hover {
    background: #7f1d1d;
    transform: translateY(-2px);
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Processes & Database Table */
.database-table-wrapper .processos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.database-table-wrapper .processos-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.database-table-wrapper .processos-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.database-table-wrapper .processos-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.database-table-wrapper .processos-table tr:last-child td {
    border-bottom: none;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
        background: var(--color-red);
        color: white;
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
        background: #991b1b;
        color: rgba(255, 255, 255, 0.9);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        background: var(--color-red);
        color: white;
    }
}

.deadline-alert {
    animation: pulse-red 2s infinite !important;
    background: var(--color-red) !important;
    color: white !important;
    border: none !important;
    font-weight: 700 !important;
}

.alert-critical {
    background: rgba(239, 68, 68, 0.15) !important;
    border-left: 4px solid var(--color-red) !important;
}

.alert-confirmed {
    background: rgba(16, 185, 129, 0.1) !important;
    border-left: 4px solid var(--color-green) !important;
    opacity: 0.8;
}

.btn-delete-activity:hover {
    color: var(--color-red) !important;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* ================================
   Restored Header Specific Styles
   ================================ */
.horizontal-info-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    row-gap: 8px;
    width: 100%;
}

.info-block {
    display: flex;
    flex-direction: column;
    /* Optional: min-width to prevent squishing too much */
    min-width: max-content;
}

.info-block label {
    font-size: 0.75rem;
    /* slightly smaller label */
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 2px;
}

.info-block span {
    font-size: 0.95rem;
    /* slightly larger value for readability */
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
}


/* Click-to-Copy Badge */
.copyable-badge {
    cursor: pointer;
    padding: 2px 6px;
    background: rgba(var(--color-primary-rgb), 0.1);
    border-radius: 4px;
    border: 1px dashed var(--color-primary);
    transition: all 0.2s;
    display: inline-block;
    color: var(--color-primary);
    font-weight: 700;
}

.copyable-badge:hover {
    background: rgba(var(--color-primary-rgb), 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.copyable-badge:active {
    transform: translateY(0);
}

/* End of File */