/* ============================================================
   assets/style.css – Urbanna CRM
   Idéntico al diseño de v.3 + mejoras para PHP + GoDaddy
   ============================================================ */

/* RESET & BASE */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body { background-color: #f5f6fa; color: #333; }

/* ── LAYOUT ── */
.dashboard-container { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
    width: 250px;
    background-color: #1a1e2d;
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.logo-section { display: flex; align-items: center; gap: 10px; padding: 20px; }
.logo-icon i  {
    background-color: #2563eb;
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 18px;
}
.logo-text h2 { font-size: 16px; }
.logo-text span { font-size: 11px; color: #8a92a6; }
.project-selector { padding: 0 20px 20px; }
.project-select-row { display: flex; gap: 6px; align-items: center; }
.project-select-row select {
    flex: 1;
    padding: 8px;
    background-color: #2a2f45;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.btn-icon-sidebar {
    background-color: #2a2f45;
    color: #8a92a6;
    width: 32px; height: 32px; min-width: 32px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 12px;
    border: none; cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-icon-sidebar:hover { background-color: #2563eb; color: white; }

.menu { display: flex; flex-direction: column; gap: 5px; padding: 0 10px; }
.menu-item {
    padding: 12px 16px;
    color: #8a92a6;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    display: flex; gap: 10px; align-items: center;
    transition: background 0.2s, color 0.2s;
}
.menu-item.active, .menu-item:hover { background-color: #2563eb; color: white; }

/* ── TOPBAR ── */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    height: 70px;
    background: white;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px;
    margin: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    flex-shrink: 0;
}
.system-badge {
    background: #2563eb; color: white;
    padding: 8px 16px; border-radius: 8px; font-size: 13px;
}
.user-profile { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 35px; height: 35px;
    background: #e0e7ff; color: #2563eb;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}
.user-info { display: flex; flex-direction: column; font-size: 12px; }
.name { font-weight: bold; }

/* ── CONTENIDO ── */
.content-area { padding: 20px; flex: 1; overflow-y: auto; }
.module-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.module-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.month-display { font-size: 20px; font-weight: bold; }

/* ── BOTONES ── */
button { cursor: pointer; border: none; font-weight: 500; transition: opacity 0.15s; }
button:hover { opacity: 0.85; }
.btn-primary  { background: #2563eb; color: white; padding: 8px 16px; border-radius: 6px; }
.btn-success  { background: #10b981; color: white; padding: 8px 15px; border-radius: 6px; }
.btn-danger   { background: #ef4444; color: white; padding: 8px 15px; border-radius: 6px; }
.btn-secondary{ background: #e5e7eb; color: #374151; padding: 8px 15px; border-radius: 6px; }
.btn-liquidar { background: #475569; color: white; padding: 8px 15px; border-radius: 6px; }

/* ── TABLAS ── */
.table-container { background: white; padding: 20px; border-radius: 12px; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; min-width: 800px; }
.data-table th, .data-table td { border: 1px solid #e5e7eb; padding: 8px; }
.data-table th { background: #f9fafb; font-weight: 600; }
.text-left { text-align: left !important; min-width: 120px; }

/* ── ASISTENCIA ── */
.cell-stack {
    display: flex; flex-direction: column; gap: 4px;
    align-items: center; min-width: 58px;
}
.time-input {
    width: 100%; padding: 3px 2px;
    border: 1px solid #d1d5db; border-radius: 4px;
    font-size: 11px; text-align: center; color: #374151;
    background: white;
}
.time-input:disabled { background: #e5e7eb; color: #9ca3af; border-color: #e5e7eb; cursor: not-allowed; }
.status-select {
    width: 100%; padding: 4px;
    border: 1px solid #ddd; border-radius: 4px;
    text-align: center; font-weight: bold;
    appearance: none; cursor: pointer;
}
.status-select:disabled { background: #e5e7eb; color: #9ca3af; border-color: #e5e7eb; cursor: not-allowed; opacity: 0.8; }
.status-a { background: #d1fae5; color: #065f46; border-color: #34d399; }
.status-f { background: #fee2e2; color: #991b1b; border-color: #f87171; }
.status-t { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
.status-p { background: #dbeafe; color: #1e40af; border-color: #60a5fa; }
.fila-liquidada td { background-color: #e5e7eb; color: #6b7280; }
.badge-liquidado {
    background: #6b7280; color: white;
    font-size: 10px; padding: 2px 7px; border-radius: 4px;
    margin-left: 6px; font-weight: 700; letter-spacing: 0.3px;
    vertical-align: middle;
}

/* ── ALMACÉN ── */
.stock-badge { font-weight: bold; font-size: 15px; color: #1e3a8a; }
.link-material {
    color: #2563eb; text-decoration: none; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
.nombre-material-wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn-edit-icon {
    background: transparent; color: #9ca3af;
    padding: 4px 7px; border-radius: 4px; font-size: 12px;
}
.btn-edit-icon:hover { background: #e5e7eb; color: #2563eb; }
.btn-icon { padding: 5px 10px; border-radius: 4px; color: white; margin: 0 2px; }
.btn-add { background: #10b981; }
.btn-sub { background: #ef4444; }

.category-nav { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.cat-btn {
    background: white; border: 1px solid #e5e7eb; color: #4b5563;
    padding: 8px 14px; border-radius: 20px; font-size: 13px;
    display: flex; align-items: center; gap: 6px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cat-btn:hover { background: #f3f4f6; }
.cat-btn.active { background: #2563eb; color: white; border-color: #2563eb; }

/* ── HISTORIAL ── */
.historial-row td { background-color: #f8fafc; padding: 15px; }
.lista-historial { list-style: none; text-align: left; max-width: 600px; margin: 0 auto; }
.lista-historial li {
    padding: 8px; border-bottom: 1px dashed #cbd5e1;
    display: flex; gap: 15px; align-items: center; flex-wrap: wrap;
}
.lista-historial li:last-child { border-bottom: none; }
.fecha { font-weight: bold; color: #64748b; font-size: 12px; width: 80px; }
.badge-ingreso { background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 4px; font-weight: bold; font-size: 12px; }
.badge-salida  { background: #fee2e2; color: #991b1b; padding: 2px 8px; border-radius: 4px; font-weight: bold; font-size: 12px; }
em { color: #94a3b8; font-size: 12px; font-style: normal; }

/* ── MODALES ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-overlay.activo { display: flex; }
.modal-box {
    background: white; padding: 24px; border-radius: 12px;
    width: 380px; max-width: 92%;
    display: flex; flex-direction: column; gap: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.modal-box h3 { margin-bottom: 10px; font-size: 17px; }
.modal-box label {
    font-size: 11px; color: #6b7280; font-weight: 700;
    text-transform: uppercase; margin-top: 8px;
}
.modal-box input, .modal-box select {
    padding: 9px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 14px;
    width: 100%;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── LOADING ── */
.loading-spinner { text-align: center; padding: 30px; color: #6b7280; }

/* ── TOAST ── */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: #1e293b; color: white;
    padding: 12px 20px; border-radius: 8px;
    font-size: 14px; font-weight: 500;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
    z-index: 9999;
}
.toast.activo { opacity: 1; transform: translateY(0); }
.toast.toast-error { background: #ef4444; }
.toast.toast-ok    { background: #10b981; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .month-display { font-size: 15px; }
    .module-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 540px) {
    .dashboard-container { flex-direction: column; height: auto; }
    .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 10px; }
    .menu { flex-direction: row; padding: 0; }
    .content-area { padding: 10px; }
}
