/* public/css/styles.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;1,600&display=swap');

:root {
    /* Palette - Porsche / Technical Dark */
    --bg-main: #0B0E14;
    --bg-secondary: #141820;
    --bg-tertiary: #1C222D;
    
    --accent-primary: #F59E0B; /* Gold/Amber */
    --accent-primary-glow: rgba(245, 158, 11, 0.15);
    --accent-secondary: #3B82F6; /* Blue */
    --accent-success: #10B981;
    --accent-danger: #EF4444;
    
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(255, 255, 255, 0.15);
    
    --font-sans: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
    
    --glass-bg: rgba(20, 24, 32, 0.7);
    --glass-blur: blur(12px);
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px; /* High density */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Layout Utilities */
.container {
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

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

.page-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--accent-primary);
    font-size: 1rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
}

.logout-link {
    color: var(--accent-danger);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.glass-panel.no-padding { padding: 0; }

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

.panel-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-title.highlight { color: var(--accent-primary); }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    text-align: left;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-bright);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table.small td { padding: 0.6rem 1rem; }

.folio-text { color: var(--accent-primary); font-weight: 700; font-size: 0.9rem; }
.odoo-link { font-size: 0.6rem; color: var(--accent-secondary); text-decoration: none; font-weight: 700; text-transform: uppercase; }
.client-name { font-weight: 600; color: #fff; font-size: 0.85rem; }
.client-contact { font-size: 0.75rem; color: var(--text-muted); }

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-borrador { background: rgba(100, 116, 139, 0.1); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.2); }
.badge-enviada { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-aceptada { background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-archivada { background: rgba(0, 0, 0, 0.2); color: #64748b; border: 1px solid rgba(255, 255, 255, 0.05); }

/* Buttons */
.btn-primary {
    background: var(--accent-primary);
    color: #000;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px var(--accent-primary-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-bright);
    color: #fff;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
}

.btn-icon:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

.btn-action {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border-bright);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.btn-action:hover { border-color: #fff; color: #fff; }

/* Inputs */
.form-control {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.8rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
}

.form-control:focus { outline: none; border-color: var(--accent-primary); }

.input-minimal {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.4rem 0;
    font-family: inherit;
    font-size: 0.8rem;
}

.input-minimal.bold { font-weight: 700; }
.input-minimal.text-right { text-align: right; }

.price-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.currency-tag { font-size: 0.6rem; color: var(--text-muted); font-weight: 700; }
.highlight-price { color: var(--accent-primary); font-weight: 800; font-size: 0.9rem; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-title { font-size: 1.1rem; margin-bottom: 1.5rem; font-family: var(--font-serif); letter-spacing: 0.5px; }
.modal-footer { margin-top: 2rem; text-align: right; display: flex; gap: 1rem; justify-content: flex-end; }

/* Dashboard Specific */
.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.date-col { font-size: 0.7rem; color: var(--text-secondary); }
.acceptance-date { color: var(--accent-success); margin-top: 3px; font-weight: 600; }

/* Split Layout */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.5rem;
    align-items: start;
}

.side-column { position: sticky; top: 100px; }

/* Sections Picker */
.sections-picker { margin-top: 1.5rem; border-top: 1px solid var(--border-color); padding-top: 1.5rem; }
.picker-scroll { max-height: 200px; overflow-y: auto; margin-top: 0.8rem; }
.picker-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0; cursor: pointer; font-size: 0.75rem; }
.picker-item input { accent-color: var(--accent-primary); }

/* Tabs */
.tabs-nav { display: flex; gap: 1rem; border-bottom: 1px solid var(--border-color); margin-bottom: 2rem; }
.tab-link {
    padding: 0.8rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.tab-link.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }

/* Section Edit */
.section-edit-panel { background: rgba(255,255,255,0.02); border: 1px solid var(--border-color); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-title-input { background: transparent; border: none; color: #fff; font-size: 1rem; font-weight: 700; width: 60%; }
.quill-editor { height: 200px; background: var(--bg-tertiary); border: none !important; border-radius: 0 0 6px 6px; }
.ql-toolbar { background: #f8fafc !important; border-radius: 6px 6px 0 0 !important; }

/* Backup specific */
.backup-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2rem 0; }
.backup-card { 
    background: var(--bg-tertiary); border: 1px solid var(--border-color); padding: 1.5rem; border-radius: 8px; 
    text-align: center; text-decoration: none; transition: all 0.2s;
}
.backup-card:hover { border-color: var(--accent-secondary); transform: translateY(-2px); }
.file-label { display: block; font-size: 0.6rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.action-text { font-weight: 700; color: var(--accent-secondary); font-size: 0.7rem; }
