* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}



.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.6rem;
}

.login-container input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.login-container button {
    width: 100%;
    padding: 0.75rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.login-container button:hover { background: #2980b9; }

.error-msg {
    color: #e74c3c;
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* Navbar */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand { display: flex; align-items: center; }
.nav-brand img { height: 55px; }

.nav-links { display: flex; align-items: center; gap: 1rem; }

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover { color: white; }

.nav-links button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.nav-links button:hover { background: rgba(255,255,255,0.1); }

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

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

.header h1 { font-size: 1.5rem; color: #2c3e50; }

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

/* Buttons */
button {
    padding: 0.6rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

button:hover { background: #2980b9; }

button.secondary {
    background: #95a5a6;
}

button.secondary:hover { background: #7f8c8d; }

button.danger { background: #e74c3c; }
button.danger:hover { background: #c0392b; }

/* Services table */
.services-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.services-table th { text-align: left; padding: 0.4rem 0.5rem; font-size: 0.85rem; color: #7f8c8d; border-bottom: 1px solid #eee; }
.services-table td { padding: 0.3rem 0.5rem; vertical-align: middle; }
.services-table input[type="text"],
.services-table input[type="number"] { width: 100%; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
.services-table input[type="number"] { text-align: right; }
.remove-btn { background: none; border: none; color: #e74c3c; font-size: 1.3rem; cursor: pointer; padding: 0 0.3rem; line-height: 1; }
.remove-btn:hover { color: #c0392b; }
.price-col input { font-weight: 700; color: #3498db; }
.total-price { font-weight: 800; color: #3498db; font-size: 1.05em; }

/* Filters */
#filters { margin-bottom: 1rem; }

#filters select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
}

th, td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: #7f8c8d;
}

tr:hover td { background: #f8f9fa; }

.status {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-borrador { background: #ecf0f1; color: #7f8c8d; }
.status-generada { background: #dbeafe; color: #1d4ed8; }
.status-revisada { background: #fef3c7; color: #b45309; }
.status-enviada { background: #d1fae5; color: #047857; }
.status-ganada { background: #a7f3d0; color: #065f46; }
.status-perdida { background: #fee2e2; color: #b91c1c; }

/* Empty state */
.empty {
    text-align: center;
    padding: 4rem;
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
}

.modal-content h2 { margin-bottom: 1rem; }

.modal-content input,
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}

.modal-content textarea { resize: vertical; }

/* Form */
.form-container { max-width: 700px; }

.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.form-section h2 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.form-section input,
.form-section textarea,
.form-section select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}

.form-section textarea { resize: vertical; }

.info { color: #7f8c8d; margin-bottom: 0.5rem; }

.actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.actions button.primary {
    background: #2ecc71;
}

.actions button.primary:hover { background: #27ae60; }

/* Proposal editor */
.proposal-editor { max-width: 900px; }

.block-editor {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.block-editor h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.block-editor textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.pricing-preview {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.6;
    background: #fafafa;
    cursor: pointer;
    box-sizing: border-box;
}
.pricing-preview .hl-num { color: #3498db; font-weight: 700; }

.block-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.block-actions button {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    background: #95a5a6;
}

.block-actions button:hover { background: #7f8c8d; }

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    .header { flex-direction: column; align-items: start; gap: 1rem; }
    .header-actions { flex-wrap: wrap; }
}
