/* ═══════════════════════════════════════════════════════════════════════════
   FastNet Portal — Design System Profesional
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --primary:        #0047AB;
    --primary-dark:   #003080;
    --primary-light:  #E8F0FE;
    --accent:         #FF5722;
    --success:        #00C853;
    --warning:        #FFB300;
    --danger:         #E53935;
    --info:           #00B0FF;

    --bg:             #F1F4F9;
    --bg-2:           #E8EDF5;
    --card:           #FFFFFF;
    --sidebar-bg:     #0D1B3E;
    --sidebar-text:   rgba(255,255,255,.75);
    --sidebar-hover:  rgba(255,255,255,.08);
    --sidebar-active: rgba(255,255,255,.14);
    --sidebar-width:  240px;

    --text-dark:      #1A2340;
    --text-muted:     #6B7A99;
    --border:         #E2E8F0;

    --radius-sm:      8px;
    --radius:         14px;
    --radius-lg:      20px;

    --shadow-sm:      0 1px 4px rgba(0,0,0,.06);
    --shadow:         0 4px 20px rgba(0,0,0,.08);
    --shadow-lg:      0 12px 40px rgba(0,0,0,.12);
    --shadow-primary: 0 8px 24px rgba(0,71,171,.30);
}

/* ── Reset / Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    font-size: .9375rem;
    line-height: 1.6;
    margin: 0;
}
a { text-decoration: none; }

/* ════════════════════════════════════════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.login-hero {
    background: linear-gradient(150deg, #0D1B3E 0%, #0047AB 60%, #0072FF 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.login-hero::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    top: -120px; right: -120px;
}
.login-hero::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    bottom: -80px; left: -80px;
}
.login-hero-logo {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 4px;
    text-align: center;
    position: relative;
    z-index: 1;
}
.login-hero-logo span {
    display: block;
    font-size: .85rem;
    font-weight: 400;
    letter-spacing: 3px;
    color: rgba(255,255,255,.6);
    margin-top: .5rem;
}
.login-features {
    list-style: none;
    padding: 0; margin: 2.5rem 0 0;
    position: relative; z-index: 1;
}
.login-features li {
    color: rgba(255,255,255,.75);
    font-size: .875rem;
    padding: .5rem 0;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.login-features li i { color: var(--success); font-size: 1rem; }

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: #fff;
}
.login-form-inner { width: 100%; max-width: 380px; }
.login-form-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: .25rem;
}
.login-form-sub {
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 2rem;
}
.login-form-inner .form-control {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .9375rem;
    transition: border-color .2s, box-shadow .2s;
}
.login-form-inner .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,71,171,.12);
    outline: none;
}
.btn-login {
    background: linear-gradient(135deg, var(--primary), #0072FF);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 600;
    padding: .85rem;
    width: 100%;
    font-size: 1rem;
    box-shadow: var(--shadow-primary);
    transition: opacity .2s, transform .15s;
}
.btn-login:hover { opacity: .92; transform: translateY(-1px); color: #fff; }
@media (max-width: 768px) {
    .login-page { grid-template-columns: 1fr; }
    .login-hero  { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   SIDEBAR + APP SHELL
   ════════════════════════════════════════════════════════════════════════════ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform .3s ease;
}
.sidebar-brand {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    display: block;
}
.sidebar-brand-sub {
    font-size: .68rem;
    color: rgba(255,255,255,.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,.3);
    text-transform: uppercase;
    padding: 1rem 1.25rem .4rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.25rem;
    color: var(--sidebar-text);
    font-size: .875rem;
    font-weight: 500;
    transition: background .18s, color .18s;
    margin: .1rem .5rem;
    border-radius: var(--radius-sm);
}
.sidebar-link i { font-size: 1.1rem; min-width: 1.1rem; }
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar-link.active i { color: var(--info); }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,.07);
}
.btn-logout {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .65rem 1rem;
    background: rgba(229,57,53,.15);
    color: #ff8a80;
    border: 1px solid rgba(229,57,53,.25);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    transition: background .2s;
}
.btn-logout:hover { background: rgba(229,57,53,.28); color: #ff8a80; }

.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-title { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); margin: 0; }
.topbar-date  { font-size: .78rem; color: var(--text-muted); }
.topbar-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: .25rem;
}
.page-content { padding: 1.75rem; flex: 1; }
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
}
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main-wrapper { margin-left: 0; }
    .topbar-hamburger { display: block; }
    .page-content { padding: 1.25rem; }
}

/* ════════════════════════════════════════════════════════════════════════════
   DASHBOARD
   ════════════════════════════════════════════════════════════════════════════ */
.module-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border);
    transition: box-shadow .25s, transform .25s, border-color .25s;
    height: 100%;
}
.module-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    color: var(--text-dark);
    border-color: transparent;
}
.module-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.module-title { font-size: 1rem; font-weight: 700; margin: 0; }
.module-desc  { font-size: .8rem; color: var(--text-muted); margin: 0; }
.module-arrow { margin-top: auto; align-self: flex-end; color: var(--text-muted); font-size: .8rem; }
.module-card:hover .module-arrow { color: var(--primary); }

.icon-ruta    { background: #EFF6FF; color: #2563EB; }
.icon-agenda  { background: #F5F3FF; color: #7C3AED; }
.icon-install { background: #ECFDF5; color: #059669; }
.icon-visita  { background: #FFF7ED; color: #EA580C; }
.icon-datos   { background: #EFF6FF; color: #0047AB; }

.section-divider {
    display: flex; align-items: center; gap: 1rem;
    margin: 2rem 0 1.25rem;
}
.section-divider-line { flex: 1; height: 1px; background: var(--border); }
.section-divider-label {
    font-size: .72rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-muted); white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════════════════
   FORM CARD
   ════════════════════════════════════════════════════════════════════════════ */
.fn-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.fn-card-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.fn-card-title {
    font-size: 1.1rem; font-weight: 700;
    color: var(--text-dark); margin: 0;
    display: flex; align-items: center; gap: .6rem;
}
.fn-card-title i { color: var(--primary); }
.fn-card .form-control,
.fn-card .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .7rem 1rem;
    font-size: .9rem;
    color: var(--text-dark);
    transition: border-color .2s, box-shadow .2s;
}
.fn-card .form-control:focus,
.fn-card .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,71,171,.1);
    outline: none;
}
.fn-card .form-label {
    font-size: .78rem; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
    margin-bottom: .4rem;
}
.form-section {
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
    margin: 1.5rem 0 1rem;
}
.form-section-title {
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--primary);
}
.btn-fn-primary {
    background: linear-gradient(135deg, var(--primary), #0072FF);
    border: none; border-radius: var(--radius-sm);
    color: #fff; font-weight: 600;
    padding: .85rem 2rem;
    box-shadow: var(--shadow-primary);
    transition: opacity .2s, transform .15s;
}
.btn-fn-primary:hover { opacity: .9; transform: translateY(-1px); color: #fff; }
.btn-fn-primary:disabled { opacity: .7; transform: none; }

/* ════════════════════════════════════════════════════════════════════════════
   RUTA DIARIA
   ════════════════════════════════════════════════════════════════════════════ */
.date-picker-bar {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 1rem;
}
.date-picker-bar .form-control {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    padding: .55rem .85rem;
    max-width: 200px;
}
.date-picker-bar .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,71,171,.1);
    outline: none;
}
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}
.ticket {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    transition: box-shadow .2s;
}
.ticket:hover { box-shadow: var(--shadow); }
.ticket.done  { border-top-color: #adb5bd; opacity: .75; }
.ticket-meta {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.ticket-time {
    font-size: .78rem; font-weight: 600;
    color: var(--text-muted);
    background: var(--bg); padding: .25rem .7rem;
    border-radius: 20px; border: 1px solid var(--border);
}
.ticket-type {
    font-size: .7rem; font-weight: 700;
    padding: .25rem .75rem;
    border-radius: 20px;
    text-transform: uppercase; letter-spacing: .5px;
}
.type-instalacion   { background: #EFF6FF; color: #2563EB; }
.type-averia        { background: #FFF7ED; color: #EA580C; }
.type-mantenimiento { background: #F5F3FF; color: #7C3AED; }
.ticket-name {
    font-size: 1rem; font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 .4rem; text-transform: uppercase;
}
.ticket-name.done-text { text-decoration: line-through; color: var(--text-muted); }
.ticket-address {
    font-size: .82rem; color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex; gap: .4rem;
}
.ticket-address i { color: var(--danger); flex-shrink: 0; margin-top: 2px; }
.ticket-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}
.ticket-actions .btn {
    border-radius: var(--radius-sm);
    font-size: .8rem; font-weight: 600; padding: .55rem;
}
.btn-maps { background: #EA4335; color: #fff; border: none; }
.btn-maps:hover { background: #c5352a; color: #fff; }
.btn-wa   { background: #25D366; color: #fff; border: none; }
.btn-wa:hover { background: #1db953; color: #fff; }
.btn-done {
    grid-column: 1 / -1;
    background: transparent;
    border: 1.5px solid var(--success);
    color: var(--success); font-weight: 700;
    transition: background .2s, color .2s;
}
.btn-done:hover { background: var(--success); color: #fff; }
.done-badge {
    grid-column: 1 / -1;
    background: #ECFDF5; color: #059669;
    text-align: center;
    border-radius: var(--radius-sm);
    padding: .55rem;
    font-size: .8rem; font-weight: 700;
}
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 3.5rem; opacity: .3; display: block; margin-bottom: 1rem; }

/* ════════════════════════════════════════════════════════════════════════════
   HOJA INSTALACIÓN
   ════════════════════════════════════════════════════════════════════════════ */
.install-header {
    display: flex; align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}
.install-logo-name {
    font-size: 1.5rem; font-weight: 800;
    color: var(--primary); letter-spacing: 2px;
}
.install-badge {
    background: var(--danger); color: #fff;
    font-size: .75rem; font-weight: 700;
    padding: .4rem 1rem; border-radius: var(--radius-sm);
    letter-spacing: 1px; text-transform: uppercase;
}
.install-section {
    background: var(--primary); color: #fff;
    font-size: .7rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    padding: .5rem 1rem; border-radius: var(--radius-sm);
    margin: 1.5rem 0 .75rem;
}
.install-section.gray { background: #64748B; }
.signature-area {
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    background: #FAFBFF;
    padding: 1rem; text-align: center;
}
.signature-area canvas {
    width: 100% !important;
    height: 220px;
    border-radius: var(--radius-sm);
    background: #fff;
    touch-action: none;
    display: block;
}

/* ════════════════════════════════════════════════════════════════════════════
   TABLA DATOS
   ════════════════════════════════════════════════════════════════════════════ */
.data-table-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.data-table-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
}
.data-table-header h4 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.data-table .table { margin: 0; font-size: .875rem; }
.data-table .table thead th {
    background: var(--sidebar-bg);
    color: rgba(255,255,255,.85);
    font-size: .7rem; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    padding: .85rem 1rem; border: none;
}
.data-table .table tbody td {
    padding: .85rem 1rem;
    border-color: var(--border);
    vertical-align: middle;
}
.data-table .table tbody tr:hover td { background: var(--bg); }
.firma-thumbnail {
    height: 40px; border: 1px solid var(--border);
    border-radius: 4px; cursor: zoom-in;
    transition: transform .2s;
}
.firma-thumbnail:hover { transform: scale(2.5); position: relative; z-index: 10; }
.badge-plan {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600; font-size: .72rem;
    padding: .3rem .65rem;
    border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════════════════════
   UTILIDADES
   ════════════════════════════════════════════════════════════════════════════ */
.btn-back {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .85rem; color: var(--text-muted);
    padding: .4rem .75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    border: 1px solid var(--border);
    transition: background .2s, color .2s;
}
.btn-back:hover { background: var(--border); color: var(--text-dark); }
.page-heading { font-size: 1.35rem; font-weight: 700; color: var(--text-dark); margin: 0; }
.alert { border-radius: var(--radius-sm); border: none; font-size: .875rem; }
.alert-success { background: #ECFDF5; color: #065F46; }
.alert-danger  { background: #FEF2F2; color: #991B1B; }
.alert-warning { background: #FFFBEB; color: #92400E; }
