/* ============================================================================
   MyNetworkOne — Sistema de diseño (ArguedasOne)
   Paleta corporativa estricta:
     Azul   #08476B   ·   Cyan  #07AEDE   ·   Verde #9ABE3C
     Blanco #FFFFFF   ·   Negro #000000
   ============================================================================ */

:root {
    /* Paleta base */
    --azul:        #08476B;
    --cyan:        #07AEDE;
    --verde:       #9ABE3C;
    --blanco:      #FFFFFF;
    --negro:       #000000;

    /* Derivados (mismos tonos con transparencia / mezcla, sin colores nuevos) */
    --azul-900:    #06324c;
    --azul-700:    #08476B;
    --azul-50:     #eaf2f7;
    --cyan-50:     #e6f7fc;
    --verde-50:    #f1f6e4;

    --ink:         #16202b;          /* texto principal (negro suavizado) */
    --ink-soft:    #5b6b7a;          /* texto secundario */
    --line:        #e4ebf1;          /* bordes / divisores */
    --bg:          #eef2f6;          /* fondo de la app */
    --surface:     #ffffff;

    --shadow-sm:   0 1px 2px rgba(8,71,107,.06), 0 1px 3px rgba(8,71,107,.08);
    --shadow:      0 4px 16px rgba(8,71,107,.10);
    --shadow-lg:   0 12px 32px rgba(8,71,107,.16);

    --radius:      14px;
    --radius-sm:   10px;
    --sidebar-w:   256px;

    --grad-azul:   linear-gradient(135deg, #08476B 0%, #06324c 100%);
    --grad-cyan:   linear-gradient(135deg, #07AEDE 0%, #0892bb 100%);
    --grad-brand:  linear-gradient(120deg, #08476B 0%, #07AEDE 100%);
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--azul); text-decoration: none; transition: color .15s; }
a:hover { color: var(--cyan); }

h1,h2,h3,h4,h5,h6 { color: var(--azul); font-weight: 700; }
.text-cyan  { color: var(--cyan)  !important; }
.text-verde { color: var(--verde) !important; }
.text-azul  { color: var(--azul)  !important; }
.text-muted { color: var(--ink-soft) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c4d2dd; border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a9bccb; }

/* ============================ BOTONES ============================ */
.btn { border-radius: 10px; font-weight: 600; padding: .5rem 1rem; transition: all .18s ease; border: 1px solid transparent; }
.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 8px; padding: .3rem .6rem; font-size: .82rem; }

.btn-primary { background: var(--grad-brand); border: none; color: #fff; box-shadow: 0 4px 12px rgba(7,174,222,.28); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 6px 18px rgba(7,174,222,.38); color: #fff; }

.btn-outline-primary { color: var(--azul); border-color: var(--line); background: #fff; }
.btn-outline-primary:hover { background: var(--azul-50); border-color: var(--cyan); color: var(--azul); }

.btn-success { background: var(--verde); border-color: var(--verde); color: #20300a; font-weight: 700; }
.btn-success:hover { filter: brightness(1.04); color: #20300a; }

.btn-light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-light:hover { background: var(--azul-50); border-color: var(--line); }

.btn-danger { background: #d6453b; border: none; }
.btn-danger:hover { background: #bf3a31; }

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

.sidebar {
    width: var(--sidebar-w);
    background: var(--grad-azul);
    color: #c7dce8;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    box-shadow: 4px 0 24px rgba(8,71,107,.18);
    z-index: 1040;
}
.sidebar-brand {
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .brand-logo {
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm);
}
.sidebar-brand .brand-logo img { height: 46px; width: auto; max-width: 100%; object-fit: contain; }
.sidebar-brand .brand-app {
    margin-top: 10px; text-align: center;
    font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: #7fb0ca;
}
.sidebar-brand .brand-app strong { color: #fff; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 18px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-color: transparent; }
.nav-section {
    padding: 16px 12px 6px; font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em; color: #6fa3bf;
}
.sidebar-nav .nav-link {
    color: #c7dce8; padding: 10px 12px; margin: 2px 0; border-radius: 10px;
    display: flex; align-items: center; gap: 12px; font-size: .9rem; font-weight: 500;
    position: relative; transition: background .15s, color .15s;
}
.sidebar-nav .nav-link i { width: 20px; font-size: 1.05rem; color: #7fb0ca; transition: color .15s; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav .nav-link:hover i { color: var(--cyan); }
.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(7,174,222,.22), rgba(7,174,222,.04));
    color: #fff;
}
.sidebar-nav .nav-link.active i { color: var(--verde); }
.sidebar-nav .nav-link.active::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
    background: var(--verde); border-radius: 0 4px 4px 0;
}
.sidebar-foot { padding: 12px 16px; font-size: .72rem; color: #6fa3bf; border-top: 1px solid rgba(255,255,255,.08); }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px; display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 1030;
}
.topbar-title { font-weight: 700; font-size: 1.1rem; color: var(--azul); }
.topbar-right { margin-left: auto; }

.content { padding: 26px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ============================ ENCABEZADO DE PÁGINA ============================ */
.page-head { display: flex; align-items: center; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.45rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.page-head h1 i { color: var(--cyan); }
.page-head .ms-auto { margin-left: auto; }

/* ============================ TARJETAS ============================ */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); overflow: hidden; }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--azul); padding: 14px 18px; display: flex; align-items: center; gap: 8px; }
.card-header i { color: var(--cyan); }
.card-body { padding: 18px; }

/* ============================ KPI ============================ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.kpi {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 4px; transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi::after { content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; opacity: .10; background: var(--azul); }
.kpi .kpi-ico { position: absolute; right: 16px; top: 16px; font-size: 1.5rem; opacity: .35; color: var(--azul); }
.kpi .kpi-label { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.kpi .kpi-value { font-size: 2rem; font-weight: 800; color: var(--azul); line-height: 1.1; letter-spacing: -.5px; }
.kpi.azul::after, .kpi.azul .kpi-ico  { color: var(--azul);  background: var(--azul); }
.kpi.cyan::after, .kpi.cyan .kpi-ico  { color: var(--cyan);  background: var(--cyan); }
.kpi.verde::after,.kpi.verde .kpi-ico { color: var(--verde); background: var(--verde); }
.kpi.azul  { border-top: 3px solid var(--azul); }
.kpi.cyan  { border-top: 3px solid var(--cyan); }
.kpi.verde { border-top: 3px solid var(--verde); }

/* ============================ TABLAS ============================ */
.table { margin: 0; color: var(--ink); }
.table > thead { background: var(--azul-50); }
.table > thead th { color: var(--azul); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); padding: .8rem .9rem; }
.table > tbody > tr { transition: background .12s; }
.table > tbody > tr:hover { background: var(--cyan-50); }
.table > :not(caption) > * > * { padding: .72rem .9rem; border-color: var(--line); vertical-align: middle; }
.table-responsive { border-radius: var(--radius); }

/* ============================ BADGES / PÍLDORAS DE ESTADO ============================ */
.badge { font-weight: 600; padding: .4em .7em; border-radius: 8px; font-size: .74rem; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: .28rem .65rem; border-radius: 20px; font-size: .76rem; font-weight: 600; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-azul  { background: var(--azul-50);  color: var(--azul); }
.pill-cyan  { background: var(--cyan-50);  color: #0676a0; }
.pill-verde { background: var(--verde-50); color: #5a7d18; }
.pill-gris  { background: #eef2f6;         color: var(--ink-soft); }
.pill-rojo  { background: #fdecea;         color: #c0392b; }
.pill-amar  { background: #fff4e0;         color: #b9770a; }

/* ============================ FORMULARIOS ============================ */
.form-label { font-weight: 600; font-size: .85rem; color: var(--azul); margin-bottom: .3rem; }
.form-control, .form-select {
    border-radius: 10px; border: 1px solid var(--line); padding: .55rem .8rem; font-size: .92rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--cyan); box-shadow: 0 0 0 .2rem rgba(7,174,222,.18);
}
.form-control::placeholder { color: #9fb0bd; }
.form-check-input:checked { background-color: var(--cyan); border-color: var(--cyan); }
.input-group .btn { border-radius: 0 10px 10px 0; }
.input-group .form-control { border-radius: 10px 0 0 10px; }

/* ============================ ALERTAS ============================ */
.alert { border: none; border-radius: 12px; padding: .9rem 1.1rem; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 8px; font-weight: 500; }
.alert-success { background: var(--verde-50); color: #4d6e12; border-left: 4px solid var(--verde); }
.alert-danger  { background: #fdecea; color: #b4382f; border-left: 4px solid #d6453b; }

/* ============================ FIRMA (canvas) ============================ */
#firmaCanvas { border: 2px dashed var(--cyan); border-radius: 12px; touch-action: none; background: #fff; width: 100%; max-width: 480px; height: 200px; }

/* ============================ DROPDOWN USUARIO ============================ */
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.dropdown-item { border-radius: 8px; font-size: .9rem; padding: .5rem .7rem; }
.dropdown-item:hover { background: var(--azul-50); color: var(--azul); }

/* ============================ AUTENTICACIÓN (login) ============================ */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: var(--grad-azul); position: relative; overflow: hidden;
}
.auth-wrap::before, .auth-wrap::after {
    content: ''; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .25;
}
.auth-wrap::before { width: 420px; height: 420px; background: var(--cyan); top: -120px; right: -100px; }
.auth-wrap::after  { width: 340px; height: 340px; background: var(--verde); bottom: -120px; left: -90px; }
.auth-card {
    position: relative; z-index: 2; width: 100%; max-width: 430px;
    background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 36px 34px;
}
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo img { height: 96px; }
.auth-title { text-align: center; font-size: 1.25rem; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--ink-soft); font-size: .9rem; margin-bottom: 22px; }
.auth-card .form-floating > label { color: #8fa2b0; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .82rem; color: var(--ink-soft); }

/* ============================ UTILIDADES ============================ */
.text-end { text-align: right; }
.shadow-soft { box-shadow: var(--shadow); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 992px) {
    .content { padding: 18px; }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; left: calc(-1 * var(--sidebar-w) - 10px); transition: left .25s ease; }
    .sidebar.open { left: 0; }
    .content { padding: 14px; }
    .kpi .kpi-value { font-size: 1.7rem; }
    .topbar { padding: 10px 14px; }
}
