:root {
    /* Premium Dark Theme Palette */
    --bg-app: #0f0f11;
    --bg-surface: #1E1E24;
    --bg-surface-hover: #2a2a32;
    --bg-panel: #16161d;

    --color-primary: #FF5252;
    /* Vibrant Red */
    --color-primary-hover: #ff7b7b;
    --color-secondary: #536DFE;
    /* Indigo/Navy */
    --color-secondary-hover: #758aff;

    --text-main: #E0E0E0;
    --text-muted: #A0A0A0;
    --text-on-primary: #ffffff;

    --border-subtle: #333333;
    --border-focus: #536DFE;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-glow-red: 0 0 10px rgba(255, 82, 82, 0.3);

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

@media (prefers-reduced-motion: no-preference) {
    :root {
        --animation-scale: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --animation-scale: 0;
        --transition-fast: 0s;
        --transition-normal: 0s;
    }
}

/* Reset covers */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* Layout */
#app {
    display: flex;
    flex-direction: column;
    /* Mobile first */
    flex: 1;
    height: 100vh;
    overflow: hidden;
}

@media (min-width: 768px) {
    #app {
        flex-direction: row;
    }
}

/* Sidebar */
.sidebar {
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    padding: 1rem;
    display: flex;
    flex-direction: row;
    /* Mobile bar */
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

@media (min-width: 768px) {
    .sidebar {
        flex-direction: column;
        width: 250px;
        justify-content: flex-start;
        align-items: stretch;
        gap: 2rem;
    }
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

@media (min-width: 768px) {
    .nav-links {
        flex-direction: column;
        width: 100%;
    }
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
    transform: translateY(-1px);
}

.nav-item.active {
    background-color: rgba(255, 82, 82, 0.1);
    color: var(--color-primary);
    border-left: 3px solid var(--color-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background-color: var(--bg-app);
}

/* Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.justify-between {
    justify-content: space-between;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--color-primary);
}

.text-muted {
    color: var(--text-muted);
}

.font-bold {
    font-weight: 700;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-prospecting {
    background: rgba(83, 109, 254, 0.2);
    color: #8c9eff;
    border: 1px solid rgba(83, 109, 254, 0.4);
}

.badge-loi {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

.badge-proposal {
    background: rgba(33, 150, 243, 0.2);
    color: #64b5f6;
    border: 1px solid rgba(33, 150, 243, 0.4);
}

.badge-awarded {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.badge-declined {
    background: rgba(244, 67, 54, 0.2);
    color: #e57373;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.badge-reporting {
    background: rgba(156, 39, 176, 0.2);
    color: #ba68c8;
    border: 1px solid rgba(156, 39, 176, 0.4);
}

/* Deadline Urgency */
.border-urgent {
    border-left: 4px solid var(--color-primary);
}

.border-soon {
    border-left: 4px solid #FFC107;
}

.border-future {
    border-left: 4px solid #4CAF50;
}

/* Components: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--text-on-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    box-shadow: var(--shadow-glow-red);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-main);
    background-color: var(--bg-surface-hover);
}

/* Components: Cards */
.card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    backdrop-filter: blur(2px);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
    border: 1px solid var(--border-subtle);
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}