/* app/static/css/style.css */

/* --- VARIABLES GLOBALES DE CSS (PALETA UNIFICADA) --- */
:root {
    --dark-bg: #1a1a1a;
    --dark-bg-secondary: #121212; /* Fondo principal original */
    --surface-color: #1e1e1e; /* Para cajas y contenedores */
    --input-bg: #2c2c2c;
    --border-color: #444;
    
    --primary-accent: #fec500; /* Amarillo de la landing */
    --primary-accent-hover: #ffde59;
    
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-muted: #aaa;
    
    --error-color: #cf6679;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--dark-bg-secondary);
    color: var(--text-light);
    margin: 0;
    padding: 20px;
}

.container {
    width: 95%;
    max-width: 1800px;
    margin: auto;
}

h1, h2 {
    color: var(--primary-accent); /* <-- CAMBIO */
    border-bottom: 2px solid var(--border-color); /* <-- CAMBIO */
    padding-bottom: 10px;
}

small {
    color: var(--text-muted);
    font-weight: normal;
}

.app-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-content {
    flex: 3;
    min-width: 0;
}

.sidebar {
    flex: 2;
    position: sticky;
    top: 20px;
    min-width: 0;
}

.search-box, .customer-details, .order-summary {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--surface-color); /* <-- CAMBIO */
    border-radius: 8px;
}

#search-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    background-color: var(--input-bg); /* <-- CAMBIO */
    border: 1px solid var(--border-color); /* <-- CAMBIO */
    color: var(--text-light);
    border-radius: 4px;
    box-sizing: border-box;
}

.table-container {
    overflow-x: auto;
    max-height: 50vh;
}

.sidebar .table-container {
    max-height: 45vh;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: fixed;
}

thead tr, tbody tr {
    display: flex;
    width: 100%;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-search-sku { flex: 0 0 120px; }
.col-search-desc { flex: 1; }
.col-search-marca { flex: 0 0 130px; }
.col-search-stock { flex: 0 0 90px; justify-content: center; }
.col-search-precio { flex: 0 0 120px; justify-content: flex-end; padding-right: 20px !important; }

.col-pedido-sku { flex: 0 0 80px; }
.col-pedido-desc { flex: 1; }
.col-pedido-cant { flex: 0 0 50px; justify-content: center; }
.col-pedido-precio { flex: 0 0 100px; justify-content: flex-end; padding-right: 20px !important; }
.col-pedido-importe { flex: 0 0 100px; justify-content: flex-end; padding-right: 20px !important; }

thead {
    background-color: #333;
    position: sticky;
    top: 0;
}

#results-body tr:hover {
    cursor: pointer;
    background-color: #3a3a3a;
}

.form-grid textarea, .login-form textarea {
    height: auto;
    min-height: 120px;
    resize: vertical; 
    width: 100%; 
    padding: 10px; 
    font-size: 14px;
    background-color: var(--input-bg); /* <-- CAMBIO */
    border: 1px solid var(--border-color); /* <-- CAMBIO */
    color: var(--text-light);
    border-radius: 4px; 
    box-sizing: border-box; 
    font-family: inherit;
}

#submit-order-btn, .action-button {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-dark); /* <-- CAMBIO */
    background-color: var(--primary-accent); /* <-- CAMBIO */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    text-align: center;
}

#submit-order-btn:hover, .action-button:hover {
    background-color: var(--primary-accent-hover); /* <-- CAMBIO */
    color: var(--text-dark);
}

.order-total {
    margin-top: 20px;
    padding: 15px;
    background-color: #2a2a2a;
    border-radius: 8px;
    text-align: right;
    border-top: 2px solid var(--primary-accent); /* <-- CAMBIO */
}

.order-total h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--text-light);
}

.order-total span {
    color: var(--primary-accent); /* <-- CAMBIO */
    font-weight: bold;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.main-header h1 {
    margin: 0;
    border-bottom: none;
}

.header-links {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-left: auto;
}

.header-links a {
    color: var(--primary-accent); /* <-- CAMBIO */
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
    border: 1px solid var(--primary-accent); /* <-- CAMBIO */
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.header-links a:hover {
    background-color: var(--primary-accent); /* <-- CAMBIO */
    color: var(--text-dark); /* <-- CAMBIO */
}

.header-links a.admin-link {
    background-color: var(--primary-accent); /* <-- CAMBIO */
    color: var(--text-dark); /* <-- CAMBIO */
}
.header-links a.admin-link:hover {
    background-color: var(--primary-accent-hover); /* <-- CAMBIO */
}

.admin-nav {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color); /* <-- CAMBIO */
    padding-bottom: 15px;
}
.admin-nav a {
    margin-right: 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.1em;
    padding: 5px 10px;
    border-radius: 4px;
}
.admin-nav a.active {
    color: var(--text-light);
    background-color: #333;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-accent); /* <-- CAMBIO */
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.admin-header h1 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.logout-button {
    background-color: #333;
    color: var(--text-light);
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;
}

.logout-button:hover {
    background-color: var(--border-color); /* <-- CAMBIO */
}

.button-danger {
    background-color: var(--error-color) !important;
    color: var(--dark-bg-secondary) !important;
    font-weight: bold;
}
.button-danger:hover {
    background-color: #b00020 !important;
}

.col-user-id { flex: 0 0 50px; }
.col-user-nombre { flex: 1; }
.col-user-email { flex: 1.2; }
.col-user-cuit { flex: 0 0 120px; }
.col-user-tel { flex: 0 0 120px; }
.col-user-admin { flex: 0 0 60px; justify-content: center; }
.col-user-acciones { flex: 0 0 80px; justify-content: center; }

.col-item-sku { flex: 0 0 150px; }
.col-item-desc { flex: 1; }
.col-item-qty { flex: 0 0 80px; justify-content: center; }
.col-item-price { flex: 0 0 200px; justify-content: flex-end; }
.col-item-subtotal { flex: 0 0 150px; justify-content: flex-end; }

.col-order-id { flex: 0 0 90px; }
.col-order-date { flex: 0 0 180px; }
.col-order-client { flex: 1; }
.col-order-email { flex: 1.2; }
.col-order-total { flex: 0 0 150px; justify-content: flex-end; }
.col-order-actions { flex: 0 0 120px; justify-content: center; }

.admin-header .header-buttons {
    display: flex;
    gap: 15px;
}