:root {
    --primary: #1F4E79;
    --primary-light: #2c6eab;
    --secondary: #375623;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --border: rgba(255, 255, 255, 0.5);
    --text-main: #333333;
    --text-muted: #666666;
    --shadow: 0 8px 32px rgba(31, 78, 121, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    z-index: 10;
}

.sidebar-title {
    font-size: 1.2rem;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

.section-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 5px;
}

/* Inputs and Forms */
.file-group, .input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"], input[type="file"], select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.1);
}

.presupuesto-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    margin-bottom: 5px;
}

/* Buttons */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.w-100 { width: 100%; }

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px dashed var(--primary);
}
.btn-secondary:hover {
    background: rgba(31, 78, 121, 0.05);
}

.btn-success { background: #28a745; color: white; }
.btn-success:hover { background: #218838; }

.btn-warning { background: #ffc107; color: #333; }
.btn-warning:hover { background: #e0a800; }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.topbar h1 {
    font-size: 1.5rem;
    color: var(--primary);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    background: #e9ecef;
    color: #495057;
}

/* Workspace */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0; /* for flex scrolling */
}

.workspace-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.supervisor-select {
    flex: 1;
    max-width: 300px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* Preview pane */
.preview-container {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ddd;
}

.preview-header {
    background: #f1f3f4;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
}
.dot:nth-child(1) { background: #ff5f56; }
.dot:nth-child(2) { background: #ffbd2e; }
.dot:nth-child(3) { background: #27c93f; }

.preview-subject {
    margin-left: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.preview-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #ffffff;
}

.empty-state {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}
