/* CSS Variable System and Design Tokens */
:root {
    --bg-base: 224 71% 4%;
    --bg-surface: 222 47% 9%;
    --bg-surface-hover: 223 47% 13%;
    --bg-sidebar: 224 71% 5%;
    --border: 217 32% 16%;
    --border-hover: 217 32% 24%;
    --border-focus: 270 76% 59%;
    
    --primary: 270 76% 59%; /* Cyberpunk Violet */
    --primary-rgb: 157, 78, 221;
    --success: 160 84% 39%; /* Emerald Green */
    --success-rgb: 16, 185, 129;
    --warning: 38 92% 50%; /* Amber Orange */
    --warning-rgb: 245, 158, 11;
    --danger: 342 75% 50%; /* Crimson Red */
    --danger-rgb: 239, 68, 68;
    
    --text-main: 210 40% 98%;
    --text-muted: 215 20% 65%;
    --text-title: 210 40% 98%;
    
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-title: 'Outfit', var(--font-sans);
    
    --shadow-sm: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.4), 0 4px 12px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 8px 20px -6px rgba(0, 0, 0, 0.4);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 1px 1px 0 rgba(255, 255, 255, 0.05);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
    
    --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.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: hsl(var(--bg-base));
    background-image: 
        radial-gradient(at 0% 0%, rgba(var(--primary-rgb), 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(var(--success-rgb), 0.02) 0px, transparent 50%);
    color: hsl(var(--text-main));
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-x: hidden;
    height: 100vh;
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.5);
}

/* App Container Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(8, 12, 24, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2rem 1.25rem;
    position: relative;
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 3rem;
    padding-left: 0.5rem;
}

.brand-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(0, 242, 254, 0.3));
}

.brand-text h1 {
    font-family: var(--font-title);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 0.75rem;
    color: hsl(var(--text-muted));
    font-weight: 600;
    display: block;
    margin-top: -1px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: hsl(var(--text-muted));
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: all var(--transition-normal);
}

.nav-item i {
    font-size: 1.35rem;
    transition: transform var(--transition-normal);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: hsl(var(--text-main));
    border-color: rgba(255, 255, 255, 0.02);
}

.nav-item:hover i {
    transform: translateX(3px) scale(1.1);
    color: hsl(var(--primary));
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.12) 0%, rgba(var(--primary-rgb), 0.02) 100%);
    color: #38bdf8;
    border-left: 3px solid #38bdf8;
    border-right: 1px solid rgba(56, 189, 248, 0.1);
    border-top: 1px solid rgba(56, 189, 248, 0.1);
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    box-shadow: 0 4px 20px -5px rgba(var(--primary-rgb), 0.2);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.daemon-indicator {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: hsl(var(--text-muted));
    padding: 0.25rem 0.5rem;
}

.indicator-dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-full);
    display: inline-block;
}

@keyframes indicatorPulse {
    0% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 rgba(var(--success-rgb), 0.7); }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(var(--success-rgb), 0); }
    100% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 rgba(var(--success-rgb), 0); }
}

@keyframes indicatorPulseOffline {
    0% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 rgba(var(--danger-rgb), 0.7); }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(var(--danger-rgb), 0); }
    100% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 rgba(var(--danger-rgb), 0); }
}

.indicator-dot.online {
    background-color: #10b981;
    animation: indicatorPulse 2s infinite ease-in-out;
}

.indicator-dot.offline {
    background-color: #ef4444;
    animation: indicatorPulseOffline 2s infinite ease-in-out;
}

.btn-stop-server {
    background-color: rgba(239, 68, 68, 0.05);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.15);
    width: 100%;
}
.btn-stop-server:hover {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background-color: hsl(var(--bg-base));
    position: relative;
    z-index: 1;
}

/* Header styling */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 2.5rem;
    border-bottom: 1px solid hsl(var(--border));
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.header-pretitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #38bdf8;
    font-weight: 700;
}

.header-maintitle {
    font-family: var(--font-title);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-top: 0.15rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Tab Content Visibility */
.tab-content {
    display: none;
    padding: 2.5rem;
    animation: fadeIn var(--transition-slow) forwards;
}

.tab-content.active {
    display: block;
}

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

/* General Layout Cards */
.card {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 1px 0 rgba(255, 255, 255, 0.08);
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(255, 255, 255, 0.01);
}

.card-title {
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.card-title i {
    color: hsl(var(--primary));
    font-size: 1.4rem;
}

.card-subtitle {
    font-size: 0.8rem;
    color: hsl(var(--text-muted));
    display: block;
    margin-top: 0.3rem;
    font-weight: 500;
}

.card-body {
    padding: 2rem;
}

/* Dashboard Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: all var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(var(--primary-rgb), 0.05);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.bg-soft-primary { background: linear-gradient(135deg, rgba(157, 78, 221, 0.2) 0%, rgba(157, 78, 221, 0.05) 100%); color: #9d4edd; border: 1px solid rgba(157, 78, 221, 0.2); }
.bg-soft-success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.05) 100%); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.bg-soft-info { background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.05) 100%); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.2); }
.bg-soft-warning { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.05) 100%); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }

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

.metric-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: hsl(var(--text-muted));
    text-transform: uppercase;
    letter-spacing: 0.075em;
}

.metric-value {
    font-family: var(--font-title);
    font-size: 1.85rem;
    font-weight: 800;
    color: #ffffff;
    margin-top: 0.15rem;
    line-height: 1.1;
}
.metric-value.font-sm {
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: hsl(var(--text-main));
    word-break: break-all;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Dashboard Body & Feed */
.dashboard-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.alerts-list-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Tender alert card */
.tender-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.tender-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 4px;
    background-color: hsl(var(--primary));
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

.tender-card.notified::before {
    background-color: hsl(var(--success));
    box-shadow: 0 0 10px rgba(var(--success-rgb), 0.5);
}

.tender-card:hover {
    transform: translateY(-2px);
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(var(--primary-rgb), 0.02);
}

.tender-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.tender-card-title {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.4;
}

.tender-meta-badges {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.725rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary { background-color: rgba(157, 78, 221, 0.12); color: #c084fc; border: 1px solid rgba(157, 78, 221, 0.15); }
.badge-success { background-color: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.15); }
.badge-warning { background-color: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.15); }
.badge-danger { background-color: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.15); }
.badge-muted { background-color: rgba(148, 163, 184, 0.12); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.15); }

/* ── Dashboard Filters Panel ─────────────────────────────── */
.dashboard-filters-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.5rem;
    padding: 14px 16px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
}

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

.filter-row-main {
    gap: 10px;
}

.filter-row-secondary {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

/* Search wrapper */
.filter-search-wrap {
    flex: 2;
    min-width: 240px;
    position: relative;
}
.filter-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: hsl(var(--text-muted));
    font-size: 1.05rem;
    pointer-events: none;
}
.filter-search-input {
    padding-left: 36px !important;
    height: 38px;
}

/* Selects */
.filter-select {
    height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
    font-family: var(--font-sans);
    background-color: hsl(222, 47%, 9%);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    cursor: pointer;
    transition: border-color 0.18s;
}
.filter-select:focus {
    outline: none;
    border-color: #38bdf8;
    background-color: hsl(222, 47%, 11%);
}
.filter-select option {
    background: #0f172a;
    color: #e2e8f0;
}
.filter-view-select {
    flex: 1;
    min-width: 180px;
    height: 38px;
    font-size: 0.88rem;
    font-weight: 500;
}
.filter-select-sm {
    min-width: unset;
    width: auto;
}

/* Filter groups (label + control) */
.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.filter-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: hsl(var(--text-muted));
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Keyword pills row */
.filter-pills-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* Archive toggle */
.filter-toggle-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: hsl(var(--text-muted));
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    flex-shrink: 0;
    margin-bottom: 0;
}
.filter-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: hsl(var(--primary));
    flex-shrink: 0;
}


.keyword-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: hsl(var(--text-muted));
    transition: all 0.18s ease;
    user-select: none;
    white-space: nowrap;
}
.keyword-filter-pill:hover {
    background: rgba(157, 78, 221, 0.12);
    border-color: rgba(157, 78, 221, 0.3);
    color: #c084fc;
}
.keyword-filter-pill.active {
    background: rgba(157, 78, 221, 0.18);
    border-color: rgba(157, 78, 221, 0.5);
    color: #c084fc;
    box-shadow: 0 0 8px rgba(157, 78, 221, 0.15);
}
.keyword-filter-pill.active i {
    color: #38bdf8;
}
.keyword-filter-pill.historical {
    border-style: dashed;
    opacity: 0.65;
}
.keyword-filter-pill.historical:hover {
    opacity: 1;
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
}
.keyword-filter-pill.historical.active {
    opacity: 1;
    background: rgba(157, 78, 221, 0.18);
    border-color: rgba(157, 78, 221, 0.5);
    border-style: dashed;
    color: #c084fc;
}

.tender-card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    font-size: 0.875rem;
    color: hsl(var(--text-muted));
    margin-bottom: 1.25rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.tender-info-item strong {
    color: #f1f5f9;
}

.tender-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

/* Empty State Styling */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: hsl(var(--text-muted));
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.1);
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.05) 0%, transparent 70%);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    max-width: 340px;
}

.empty-state-mini {
    text-align: center;
    padding: 2rem 1.5rem;
    color: hsl(var(--text-muted));
    font-size: 0.85rem;
}
.empty-state-mini p {
    margin-bottom: 1rem;
}

/* Forms and Inputs styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
}

.form-control {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    background-color: rgba(15, 23, 42, 0.95);
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Force dark background on all select elements — prevent browser yellow autofill */
select.form-control,
select {
    background-color: hsl(222, 47%, 9%);
    color: #e2e8f0;
    -webkit-appearance: auto;
    appearance: auto;
}
select.form-control option,
select option {
    background-color: #0f172a;
    color: #e2e8f0;
}
select.form-control:focus,
select:focus {
    background-color: hsl(222, 47%, 11%);
}

.form-help {
    display: block;
    font-size: 0.75rem;
    color: hsl(var(--text-muted));
    margin-top: 0.5rem;
    line-height: 1.4;
}

.form-divider {
    font-family: var(--font-title);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin: 2rem 0 1.25rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.form-row {
    display: flex;
    gap: 1.25rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

/* Buttons styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all var(--transition-normal);
}

.btn:active {
    transform: scale(0.97);
}

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

.btn-primary {
    background: linear-gradient(135deg, #f72585 0%, #9d4edd 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px -3px rgba(157, 78, 221, 0.3);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff007f 0%, #7209b7 100%);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.5), 0 0 10px rgba(247, 37, 133, 0.2);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #062f21;
    box-shadow: 0 4px 15px -3px rgba(16, 185, 129, 0.3);
}
.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #3b2300;
}

.btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: #3e0707;
}

.btn-outline-primary {
    border-color: #38bdf8;
    color: #38bdf8;
    background: transparent;
}
.btn-outline-primary:hover {
    background-color: rgba(56, 189, 248, 0.08);
}

.btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.1);
    color: hsl(var(--text-muted));
    background: transparent;
}
.btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 0.95rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

/* Buscador Form Layout */
.search-panel {
    margin-bottom: 2rem;
}

.search-form-row {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
}

.search-divider {
    text-align: center;
    position: relative;
    margin: 1.5rem 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: hsl(var(--text-muted));
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.search-divider::before, .search-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.05);
}

.search-divider::before { left: 0; }
.search-divider::after { right: 0; }

/* Grid layout for search result items */
.search-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2.5rem;
    align-items: start;
}

.config-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Keyword tags container */
.keyword-input-row {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.keywords-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.keyword-tag {
    background-color: rgba(157, 78, 221, 0.08);
    border: 1px solid rgba(157, 78, 221, 0.25);
    color: #c084fc;
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all var(--transition-fast);
}

.keyword-tag:hover {
    border-color: rgba(157, 78, 221, 0.5);
    background-color: rgba(157, 78, 221, 0.12);
}

.btn-remove-tag {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 0;
    transition: color var(--transition-fast);
}
.btn-remove-tag:hover {
    color: #ef4444;
}

/* Checkbox Toggle styling */
.checkbox-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-toggle input[type="checkbox"] {
    appearance: none;
    width: 40px;
    height: 22px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.checkbox-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background-color: #ffffff;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-fast);
}

.checkbox-toggle input[type="checkbox"]:checked {
    background-color: #9d4edd;
}

.checkbox-toggle input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

/* Asistente Layout */
.asistente-layout {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr;
    gap: 2.5rem;
    align-items: start;
}

.asistente-left, .asistente-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* File Upload drag and drop zone */
.file-drop-area {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all var(--transition-normal);
}

.file-drop-area:hover, .file-drop-area.dragover {
    border-color: #c084fc;
    background-color: rgba(157, 78, 221, 0.03);
    box-shadow: 0 0 25px rgba(157, 78, 221, 0.05);
}

.upload-icon {
    font-size: 2.5rem;
    color: #c084fc;
    margin-bottom: 0.75rem;
    display: block;
}

.file-message {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.file-sub-message {
    display: block;
    font-size: 0.75rem;
    color: hsl(var(--text-muted));
    margin-top: 0.35rem;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-top: 0.75rem;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #38bdf8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 82%;
}

.btn-clear-file {
    background: transparent;
    border: none;
    color: hsl(var(--text-muted));
    font-size: 1.25rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.btn-clear-file:hover {
    color: #ef4444;
}

/* Requirements Result tab system */
.req-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.25rem;
    gap: 0.5rem;
}

.req-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: hsl(var(--text-muted));
    padding: 0.8rem 0.5rem;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    transition: all var(--transition-fast);
}

.req-tab-btn:hover {
    color: #ffffff;
}

.req-tab-btn.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
}

.req-tab-content {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.req-tab-content.active {
    display: block;
}

.info-row {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}
.info-row strong {
    display: block;
    color: #38bdf8;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.info-list-item {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.875rem;
}

.info-list-item strong {
    color: #ffffff;
    display: block;
    margin-bottom: 0.35rem;
}

/* Variables Dynamic Form Grid */
.variables-form-container {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.section-title-sm {
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 800;
    color: hsl(var(--text-muted));
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.variables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.variables-grid .form-group {
    margin-bottom: 0;
}

/* Document Live Preview and Editor */
.doc-preview-section {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    animation: fadeIn var(--transition-slow) forwards;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.preview-header h5 {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-actions {
    display: flex;
    gap: 0.65rem;
}

.preview-content-box {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.editor-textarea {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.25);
    color: #f1f5f9;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    padding: 1.25rem;
    border: none;
    resize: vertical;
    outline: none;
    line-height: 1.6;
}

/* Toast System styling */
.toast {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.75rem;
    display: flex;
    align-items: center;
    animation: slideIn var(--transition-normal);
}

.toast.hide {
    display: none !important;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.toast-icon {
    font-size: 1.4rem;
}
.toast-icon.success { color: #10b981; }
.toast-icon.error { color: #ef4444; }
.toast-icon.info { color: #9d4edd; }

.toast-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

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

/* Modal Window styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background-color: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-fast);
}

.modal.hide {
    display: none;
}

.modal-dialog {
    width: 100%;
    max-width: 520px;
    padding: 1.5rem;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h4 {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: hsl(var(--text-muted));
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-close-modal:hover {
    color: #ffffff;
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
    background-color: rgba(0, 0, 0, 0.15);
}

/* Utilities Class helper */
.hide {
    display: none !important;
}

.mt-3 { margin-top: 1rem; }
.mt-2 { margin-top: 0.5rem; }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .config-grid, .asistente-layout, .charts-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Charts Grid Layout */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
}
.chart-card {
    transition: all var(--transition-normal);
}

/* Kanban Board Styling */
.kanban-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 1.25rem;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(250px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.kanban-column {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    max-height: 78vh;
    box-shadow: var(--shadow-sm);
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid transparent;
    margin-bottom: 1.25rem;
}

.kanban-column-header h3 {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.kanban-badge {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.kanban-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 200px;
    padding: 0.25rem;
}

/* Column headers color accents */
.col-por-analizar { border-bottom-color: #9d4edd !important; }
.col-en-redaccion { border-bottom-color: #fbbf24 !important; }
.col-presentada { border-bottom-color: #06b6d4 !important; }
.col-adjudicada { border-bottom-color: #10b981 !important; }
.col-perdida { border-bottom-color: #ef4444 !important; }

/* Kanban Cards */
.kanban-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all var(--transition-normal);
    position: relative;
}

.kanban-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 3px;
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
    background-color: transparent;
}

/* Accented borders on cards matching status */
.col-por-analizar .kanban-card::before { background-color: #9d4edd; }
.col-en-redaccion .kanban-card::before { background-color: #fbbf24; }
.col-presentada .kanban-card::before { background-color: #06b6d4; }
.col-adjudicada .kanban-card::before { background-color: #10b981; }
.col-perdida .kanban-card::before { background-color: #ef4444; }

.kanban-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    background: rgba(30, 41, 59, 0.65);
}

.kanban-card-title {
    font-family: var(--font-title);
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 0.45rem;
}

.kanban-card-id {
    font-size: 0.725rem;
    font-family: monospace;
    color: #38bdf8;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.kanban-card-meta {
    font-size: 0.775rem;
    color: hsl(var(--text-muted));
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.kanban-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.kanban-select-status {
    background-color: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    outline: none;
    max-width: 120px;
    transition: all var(--transition-fast);
}
.kanban-select-status:focus {
    border-color: #38bdf8;
    color: #ffffff;
}

/* Generated Documents List Styling */
.generated-docs-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

.generated-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.generated-doc-item:hover {
    border-color: rgba(157, 78, 221, 0.35);
    background-color: rgba(157, 78, 221, 0.03);
}

.doc-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.doc-item-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-item-title i {
    color: #38bdf8;
    font-size: 1.1rem;
}

.doc-item-meta {
    font-size: 0.75rem;
    color: hsl(var(--text-muted));
}

.doc-item-actions {
    display: flex;
    gap: 0.45rem;
    flex-shrink: 0;
}

/* Checklist Styling */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.checklist-item.completed {
    background-color: rgba(16, 185, 129, 0.03);
    border-color: rgba(16, 185, 129, 0.15);
    text-decoration: line-through;
    color: #64748b;
}

.checklist-item label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    margin-bottom: 0;
    width: 100%;
}

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #10b981;
}

/* Custom Template Manager Card Styling */
.custom-template-item {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.65rem;
    transition: all var(--transition-fast);
}

.custom-template-item:hover {
    border-color: rgba(157, 78, 221, 0.35);
    background-color: rgba(157, 78, 221, 0.02);
}

.template-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.template-item-desc {
    font-size: 0.8rem;
    color: hsl(var(--text-muted));
    line-height: 1.4;
}
