/* ============================================
   DSI Technology Services - Gestion de ordenes
   Hoja de estilos compartida
   ============================================ */

:root {
    --dsi-black: #000000;
    --dsi-bg: #f5f6f8;
    --dsi-surface: #ffffff;
    --dsi-border: #e5e7eb;
    --dsi-text: #1f2328;
    --dsi-text-muted: #6b7280;
    --dsi-accent: #2563eb;
    --dsi-accent-dark: #1d4ed8;

    --dsi-danger-bg: #fcebeb;
    --dsi-danger-text: #a32d2d;
    --dsi-danger-border: #e24b4a;

    --dsi-success-bg: #eaf3de;
    --dsi-success-text: #27500a;

    --dsi-warning-bg: #faeeda;
    --dsi-warning-text: #854f0b;

    --dsi-purple-bg: #eeedfe;
    --dsi-purple-text: #3c3489;

    --dsi-blue-bg: #e6f1fb;
    --dsi-blue-text: #0c447c;

    --dsi-gray-bg: #f1efe8;
    --dsi-gray-text: #444441;

    --radius: 10px;
    --radius-lg: 14px;
}

body {
    background: var(--dsi-bg);
    color: var(--dsi-text);
}

a { text-decoration: none; }

/* ---------- Header / navbar ---------- */

.dsi-navbar {
    background: var(--dsi-surface);
    border-bottom: 1px solid var(--dsi-border);
    padding: 10px 20px;
}

/* Logo real (lockup completo: marca + wordmark, proporcion ancha).
   No se fuerza a un cuadrado ni se le pone fondo, se respeta su forma. */
.dsi-logo-header {
    height: 20px;
    width: auto;
    display: block;
}

.dsi-logo-login {
    height: 52px;
    width: auto;
    display: block;
}

.dsi-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dsi-blue-bg);
    color: var(--dsi-blue-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.dsi-user-menu {
    position: relative;
}

.dsi-user-menu .dropdown-menu {
    border-radius: var(--radius);
    border: 1px solid var(--dsi-border);
}

/* ---------- Cards generales ---------- */

.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--dsi-border);
}

/* ---------- KPI stat cards ---------- */

.stat-card {
    border-radius: var(--radius);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    background: var(--dsi-surface);
    border: 1px solid var(--dsi-border);
}

.dashboard-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.dashboard-card:hover .stat-card,
.stat-card.is-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.stat-card.stat-danger {
    background: var(--dsi-danger-bg);
    border-left: 3px solid var(--dsi-danger-border);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.stat-card.stat-danger .stat-title,
.stat-card.stat-danger .stat-number {
    color: var(--dsi-danger-text);
}

.stat-card.stat-success {
    background: var(--dsi-success-bg);
}

.stat-card.stat-success .stat-title,
.stat-card.stat-success .stat-number {
    color: var(--dsi-success-text);
}

.stat-title {
    color: var(--dsi-text-muted);
    font-size: 13px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-number {
    font-size: 26px;
    font-weight: 600;
    color: var(--dsi-text);
}

/* ---------- Accesos rapidos (grid con iconos) ---------- */

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.quick-btn {
    background: var(--dsi-surface);
    border: 1px solid var(--dsi-border);
    border-radius: var(--radius);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    color: var(--dsi-text);
    transition: 0.15s ease;
}

.quick-btn:hover {
    border-color: var(--dsi-accent);
    background: var(--dsi-blue-bg);
    color: var(--dsi-text);
}

.quick-btn i {
    font-size: 22px;
    color: var(--dsi-accent);
}

.quick-btn span {
    font-size: 13.5px;
    font-weight: 500;
}

/* ---------- Section titles ---------- */

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dsi-text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Ultimas ordenes (dashboard) ---------- */

.ultima-item {
    border-bottom: 1px solid var(--dsi-border);
    padding: 12px 0;
}

.ultima-item:last-child {
    border-bottom: none;
}

/* ---------- Badges de estado (color fijo, consistente en toda la app) ---------- */

.badge-estado {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 999px;
    display: inline-block;
}

.badge-estado.ingresado   { background: var(--dsi-gray-bg);    color: var(--dsi-gray-text); }
.badge-estado.abierta,
.badge-estado.presupuesto { background: var(--dsi-blue-bg);    color: var(--dsi-blue-text); }
.badge-estado.espera      { background: var(--dsi-warning-bg); color: var(--dsi-warning-text); }
.badge-estado.arribo      { background: #E0F2F1; color: #00695C; }
.badge-estado.reparado    { background: var(--dsi-success-bg); color: var(--dsi-success-text); }
.badge-estado.entregado   { background: var(--dsi-purple-bg);  color: var(--dsi-purple-text); }

.badge-prioridad {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 999px;
    display: inline-block;
}

.badge-prioridad.alta    { background: var(--dsi-danger-bg);  color: var(--dsi-danger-text); }
.badge-prioridad.urgente { background: var(--dsi-danger-bg);  color: var(--dsi-danger-text); font-weight:700; }
.badge-prioridad.normal  { background: var(--dsi-warning-bg); color: var(--dsi-warning-text); }
.badge-prioridad.baja    { background: var(--dsi-success-bg); color: var(--dsi-success-text); }

.badge-proyecto {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-block;
}

.badge-proyecto.pendiente         { background: var(--dsi-gray-bg);    color: var(--dsi-gray-text); }
.badge-proyecto.en-proceso        { background: var(--dsi-warning-bg); color: var(--dsi-warning-text); }
.badge-proyecto.pausado            { background: var(--dsi-gray-bg);    color: var(--dsi-gray-text); }
.badge-proyecto.finalizado         { background: var(--dsi-success-bg); color: var(--dsi-success-text); }
.badge-proyecto.esperando-cliente  { background: var(--dsi-blue-bg);    color: var(--dsi-blue-text); }

.badge-tipo-cliente {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-block;
}

.badge-tipo-cliente.normal  { background: var(--dsi-blue-bg);    color: var(--dsi-blue-text); }
.badge-tipo-cliente.abonado { background: var(--dsi-warning-bg); color: var(--dsi-warning-text); }

/* ---------- Cliente cards (listado) ---------- */

.cliente-card {
    background: var(--dsi-surface);
    border: 1px solid var(--dsi-border);
    border-left: 4px solid var(--dsi-blue-text);
    border-radius: var(--radius-lg);
    height: 100%;
    transition: 0.15s ease;
}

.cliente-card.abonado {
    border-left-color: #b8860b;
}

.cliente-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.cliente-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dsi-blue-bg);
    color: var(--dsi-blue-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

.cliente-card.abonado .cliente-avatar {
    background: var(--dsi-warning-bg);
    color: var(--dsi-warning-text);
}

.cliente-ordenes-link {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--dsi-blue-bg);
    color: var(--dsi-blue-text);
    border: 1px solid transparent;
}

.cliente-ordenes-link:hover {
    background: var(--dsi-black);
    color: #fff;
}

.cliente-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--dsi-text);
}

.cliente-info-row i {
    color: var(--dsi-accent);
    width: 16px;
}

/* ---------- Workspace / centro de tareas ---------- */

.task-card {
    background: var(--dsi-surface);
    border: 1px solid var(--dsi-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.task-card .task-title {
    font-weight: 500;
    font-size: 14px;
}

.task-card .task-meta {
    font-size: 12px;
    color: var(--dsi-text-muted);
}

.badge-tarea {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-block;
}

.badge-tarea.pendiente   { background: var(--dsi-gray-bg);    color: var(--dsi-gray-text); }
.badge-tarea.en-proceso  { background: var(--dsi-warning-bg); color: var(--dsi-warning-text); }
.badge-tarea.completada  { background: var(--dsi-success-bg); color: var(--dsi-success-text); }

/* ---------- Botones ---------- */

.btn-back {
    border-color: var(--dsi-border);
    color: var(--dsi-text-muted);
}

.btn-dsi-primary {
    background: var(--dsi-black);
    border-color: var(--dsi-black);
    color: #fff;
}

.btn-dsi-primary:hover {
    background: #262626;
    border-color: #262626;
    color: #fff;
}

/* ---------- Formularios (nuevo cliente / nueva orden) ---------- */

.form-label {
    font-size: 13px;
    color: var(--dsi-text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--dsi-border);
}

.form-control:focus, .form-select:focus {
    border-color: var(--dsi-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.password-wrap {
    position: relative;
}

.password-wrap .toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dsi-text-muted);
    cursor: pointer;
    background: none;
    border: none;
}

/* ---------- Ordenes: tarjetas tipo acordeon ---------- */

.orden-card {
    background: var(--dsi-surface);
    border: 1px solid var(--dsi-border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 10px;
}

.orden-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 10px;
    flex-wrap: wrap;
}

.orden-card-header .orden-titulo {
    font-weight: 600;
    font-size: 14.5px;
}

.orden-card-chevron {
    transition: transform 0.15s ease;
    color: var(--dsi-text-muted);
}

.orden-card.is-open .orden-card-chevron {
    transform: rotate(180deg);
}

.orden-card-body {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--dsi-border);
}

.orden-detalle-box {
    background: var(--dsi-bg);
    border: 1px solid var(--dsi-border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.timeline {
    border-left: 2px solid var(--dsi-border);
    padding-left: 15px;
}

.timeline-item {
    margin-bottom: 12px;
}

.timeline-title {
    font-weight: 600;
    font-size: 13.5px;
}

.timeline-date {
    font-size: 12px;
    color: var(--dsi-text-muted);
}

/* ---------- Filtros ---------- */

.filtros-bar {
    background: var(--dsi-surface);
    border: 1px solid var(--dsi-border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}

/* ---------- Login ---------- */

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('../../img/login-bg.jpg');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.login-wrap > * {
    position: relative;
    z-index: 1;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.login-brand .wordmark p {
    margin: 0;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.login-card {
    width: 360px;
    background: var(--dsi-surface);
    border: 1px solid var(--dsi-border);
    border-radius: var(--radius-lg);
    padding: 28px;
}
