/* ============================================================
   LMA · LOADING MASTER APP
   Design system
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
    /* Brand */
    --navy-900: #05121f;
    --navy-800: #0a1c2e;
    --navy-700: #10293f;
    --navy-600: #17395a;
    --navy-500: #1f4e7a;

    --accent:      #2b7fff;
    --accent-dark: #1a5fd0;
    --accent-soft: #eaf2ff;
    --accent-line: #c2d9ff;

    --gold:      #c8952b;
    --gold-soft: #fdf4e3;

    /* Surfaces */
    --bg:         #f1f4f9;
    --bg-deep:    #e7ecf4;
    --surface:    #ffffff;
    --surface-2:  #f8fafc;
    --surface-3:  #f1f5f9;

    /* Lines */
    --line:        #e2e8f0;
    --line-strong: #cbd5e1;

    /* Text */
    --ink:      #0f1e2e;
    --ink-2:    #33475e;
    --ink-3:    #64748b;
    --ink-4:    #94a3b8;

    /* Status */
    --ok:        #0e9f6e;
    --ok-soft:   #e7f8f1;
    --ok-line:   #a7e3cb;
    --warn:      #b45309;
    --warn-soft: #fef6e7;
    --warn-line: #f0d9a8;
    --bad:       #dc2626;
    --bad-soft:  #fdeeee;
    --bad-line:  #f2c0c0;
    --info:      #2b7fff;
    --info-soft: #eaf2ff;

    /* Elevation */
    --sh-1: 0 1px 2px rgba(15, 30, 46, .05);
    --sh-2: 0 1px 3px rgba(15, 30, 46, .07), 0 4px 12px rgba(15, 30, 46, .04);
    --sh-3: 0 8px 28px rgba(15, 30, 46, .12);

    --r-sm: 6px;
    --r:    10px;
    --r-lg: 14px;

    --sidebar-w: 258px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
            Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "SF Mono", "Cascadia Mono", Consolas, monospace;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }

::selection { background: var(--accent-line); }

/* ============================================================
   LAYOUT
   ============================================================ */

.app { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--navy-900);
    background-image:
        radial-gradient(120% 45% at 0% 0%, rgba(43,127,255,.16), transparent 60%);
    color: #e8eef6;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 40;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.16) transparent;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.16); border-radius: 3px;
}

.brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

/* El nombre completo es mucho mas largo que la sigla que habia antes:
   va con menos cuerpo y sin el espaciado entre letras, para que entre
   en una sola linea en los 258 px de la barra. */
.brand h1 {
    font-size: 14.5px; font-weight: 750; letter-spacing: .01em;
    margin: 0; white-space: nowrap;
}

.brand-sub {
    margin-top: 10px;
    font-size: 10px;
    line-height: 1.6;
    color: #8ba3bd;
    letter-spacing: .02em;
}

.nav { flex: 1; padding: 12px 11px 18px; }

.nav-label {
    padding: 0 9px;
    margin: 18px 0 7px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #6d87a3;
}

.nav-label:first-child { margin-top: 4px; }

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    margin: 1px 0;
    border-radius: 8px;
    color: #c8d6e5;
    font-size: 13px;
    font-weight: 500;
    transition: background .14s, color .14s;
}

.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }

.nav-item.on {
    background: rgba(43,127,255,.16);
    color: #fff;
    font-weight: 600;
}

.nav-item.on::before {
    content: "";
    position: absolute;
    left: -11px; top: 50%;
    width: 3px; height: 18px;
    margin-top: -9px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

.nav-ico {
    width: 17px;
    flex: 0 0 17px;
    text-align: center;
    font-size: 13px;
    opacity: .85;
}

.nav-num {
    font-family: var(--mono);
    font-size: 10px;
    opacity: .5;
    min-width: 15px;
}

.nav-foot {
    padding: 13px 18px 18px;
    border-top: 1px solid rgba(255,255,255,.07);
    font-size: 9.5px;
    line-height: 1.65;
    color: #6d87a3;
}

.main {
    margin-left: var(--sidebar-w);
    padding: 24px 28px 72px;
    min-height: 100vh;
}

.wrap { max-width: 1500px; }

/* ============================================================
   PAGE HEADER
   ============================================================ */

.phead {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.phead h2 { font-size: 23px; letter-spacing: -.02em; }

.phead .sub {
    margin-top: 5px;
    font-size: 13px;
    color: var(--ink-3);
    max-width: 74ch;
}

.pacts { display: flex; gap: 8px; flex-wrap: wrap; }

.eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 5px;
}

/* ============================================================
   OPERATION BANNER
   ============================================================ */

.opbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    padding: 17px 22px;
    margin-bottom: 20px;
    border-radius: var(--r-lg);
    background:
        linear-gradient(112deg, var(--navy-800) 0%, var(--navy-600) 62%, var(--navy-500) 100%);
    color: #fff;
    flex-wrap: wrap;
    overflow: hidden;
    box-shadow: var(--sh-2);
}

.opbar::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

.opbar h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.opbar .meta {
    margin-top: 7px;
    font-size: 12.5px;
    color: #b7cade;
    line-height: 1.7;
}

.opbar .meta b { color: #fff; font-weight: 600; }
.opbar .meta .sep { opacity: .4; margin: 0 7px; }

.opbar-right { text-align: right; font-size: 12px; color: #b7cade; }

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    margin-bottom: 18px;
    box-shadow: var(--sh-1);
    overflow: hidden;
}

.card-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.card-h h3 {
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .01em;
    color: var(--ink);
}

.card-h .note { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }

.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
.card-b + .card-h { border-top: 1px solid var(--line); }

.grid2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
}

.grid3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 18px;
}

/* ============================================================
   STATS
   ============================================================ */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    position: relative;
    padding: 14px 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh-1);
    overflow: hidden;
}

.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--line-strong);
}

.stat .k {
    display: block;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.stat .v {
    display: block;
    margin-top: 7px;
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.stat .v.sm { font-size: 15px; letter-spacing: -.01em; }

.stat .u {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--ink-3);
}

.stat.blue::before  { background: var(--accent); }
.stat.blue  { background: linear-gradient(180deg, var(--accent-soft), #fff 62%); }
.stat.green::before { background: var(--ok); }
.stat.green { background: linear-gradient(180deg, var(--ok-soft), #fff 62%); }
.stat.amber::before { background: var(--gold); }
.stat.amber { background: linear-gradient(180deg, var(--gold-soft), #fff 62%); }
.stat.red::before   { background: var(--bad); }
.stat.red   { background: linear-gradient(180deg, var(--bad-soft), #fff 62%); }
.stat.plum::before  { background: #7c5cd6; }
.stat.plum  { background: linear-gradient(180deg, #f3efff, #fff 62%); }

/* ============================================================
   TABLES
   ============================================================ */

.tw {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
}

.card-b.flush > .tw { border: 0; border-radius: 0; }

table.t {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12.5px;
}

table.t th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 9px 10px;
    background: var(--surface-3);
    color: var(--ink-2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--line-strong);
}

table.t td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover { background: var(--surface-2); }

table.t td.n, table.t th.n {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

table.t td.calc {
    background: var(--surface-3);
    font-weight: 600;
}

table.t tfoot td {
    background: var(--surface-3);
    font-weight: 700;
    border-top: 2px solid var(--line-strong);
    border-bottom: 0;
}

table.t input, table.t select {
    height: 31px;
    padding: 3px 7px;
    font-size: 12px;
    border-radius: var(--r-sm);
}

table.t input.n { text-align: right; }

tr.off  { opacity: .5; }
tr.warn { background: var(--warn-soft) !important; }
tr.bad  { background: var(--bad-soft) !important; }

.tnum {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-4);
}

/* ============================================================
   FORMS
   ============================================================ */

.fg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.fg.c2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.fg.c4 { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }

.f { display: flex; flex-direction: column; min-width: 0; }
.f.full { grid-column: 1 / -1; }

.f label {
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-2);
}

.f .hint { margin-top: 5px; font-size: 11px; color: var(--ink-3); }

input, select, textarea {
    width: 100%;
    padding: 8px 11px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    transition: border-color .13s, box-shadow .13s;
}

input:hover, select:hover, textarea:hover { border-color: #a9bacd; }

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(43,127,255,.13);
}

input::placeholder, textarea::placeholder { color: var(--ink-4); }

input[readonly], input:disabled, select:disabled {
    background: var(--surface-3);
    color: var(--ink-3);
    cursor: not-allowed;
}

textarea { min-height: 76px; resize: vertical; line-height: 1.55; }

select {
    appearance: none;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='%2364748b' d='M5.5 7 0 1.4 1.4 0l4.1 4.2L9.6 0 11 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

table.t select { background-position: right 6px center; padding-right: 22px; }

fieldset {
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px;
    margin: 0 0 16px;
    background: var(--surface-2);
}

fieldset:last-child { margin-bottom: 0; }

legend {
    padding: 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.chk {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
}

.chk input { width: auto; accent-color: var(--accent); cursor: pointer; }

input[type=range] { padding: 0; accent-color: var(--accent); border: 0; }
input[type=file] { padding: 7px; font-size: 12.5px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 15px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background .13s, border-color .13s, box-shadow .13s, transform .06s;
}

.b:active { transform: translateY(.5px); }
.b:disabled { opacity: .55; cursor: not-allowed; }

.b-1 {
    background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 1px 2px rgba(43,127,255,.28);
}
.b-1:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color:#fff; }

.b-2 { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.b-2:hover:not(:disabled) { background: var(--surface-3); border-color: #a9bacd; color: var(--ink); }

.b-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.b-ok:hover:not(:disabled) { background: #0b8259; color:#fff; }

.b-x { background: var(--surface); border-color: var(--bad-line); color: var(--bad); }
.b-x:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad); }

.b-s { padding: 5px 10px; font-size: 11.5px; }
.b-xs { padding: 3px 8px; font-size: 11px; }

.b-link {
    background: none; border: 0; padding: 0;
    color: var(--accent); font-size: 12.5px; font-weight: 600;
    cursor: pointer; text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   MESSAGES
   ============================================================ */

.msg {
    display: flex;
    gap: 10px;
    padding: 11px 15px;
    margin-bottom: 15px;
    border-radius: var(--r);
    font-size: 13px;
    line-height: 1.55;
    border: 1px solid;
}

.msg-ok   { background: var(--ok-soft);   border-color: var(--ok-line);   color: #0a6b4a; }
.msg-bad  { background: var(--bad-soft);  border-color: var(--bad-line);  color: #9b1c1c; }
.msg-warn { background: var(--warn-soft); border-color: var(--warn-line); color: #8a4a08; }
.msg-info { background: var(--info-soft); border-color: var(--accent-line); color: #17457f; }

.msg::before { font-weight: 700; flex: 0 0 auto; }
.msg-ok::before   { content: "✓"; }
.msg-bad::before  { content: "!"; }
.msg-warn::before { content: "!"; }
.msg-info::before { content: "i"; }

.tip {
    padding: 11px 14px;
    margin-bottom: 15px;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 12.5px;
    line-height: 1.65;
}

.empty {
    padding: 46px 24px;
    text-align: center;
    color: var(--ink-3);
    font-size: 13px;
}

.empty .ico { font-size: 30px; opacity: .3; margin-bottom: 12px; }
.empty strong {
    display: block; margin-bottom: 7px;
    font-size: 15px; font-weight: 650; color: var(--ink);
}

/* ============================================================
   PILLS
   ============================================================ */

.p {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .03em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.p-blue  { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-line); }
.p-green { background: var(--ok-soft);     color: #0a6b4a; border-color: var(--ok-line); }
.p-amber { background: var(--warn-soft);   color: var(--warn); border-color: var(--warn-line); }
.p-red   { background: var(--bad-soft);    color: var(--bad); border-color: var(--bad-line); }
.p-grey  { background: var(--surface-3);   color: var(--ink-3); border-color: var(--line-strong); }
.p-plum  { background: #f3efff;            color: #5b3fb0; border-color: #d9cdf5; }

.p-dot::before {
    content: ""; width: 5px; height: 5px; border-radius: 50%;
    background: currentColor;
}

/* ============================================================
   PROGRESS
   ============================================================ */

.bar {
    position: relative;
    height: 26px;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.bar-f {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4b96ff, var(--accent));
    transition: width .45s cubic-bezier(.4,0,.2,1);
}

.bar-f.done { background: linear-gradient(90deg, #22b981, var(--ok)); }
.bar-f.over { background: linear-gradient(90deg, #f0a02b, var(--warn)); }

.bar-t {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    text-shadow: 0 0 5px rgba(255,255,255,.9);
}

.bar.thin { height: 7px; }
.bar.thin .bar-t { display: none; }

/* ============================================================
   TABS
   ============================================================ */

.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 2px;
}

.tab {
    padding: 7px 15px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 600;
    transition: all .13s;
}

.tab:hover { background: var(--surface-3); border-color: #a9bacd; color: var(--ink); }

.tab.on {
    background: var(--navy-700);
    border-color: var(--navy-700);
    color: #fff;
    box-shadow: var(--sh-1);
}

.tab .q { opacity: .65; font-weight: 500; }

/* ============================================================
   KEY / VALUE
   ============================================================ */

.kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    font-size: 13px;
}

.kv dt {
    padding: 6px 16px 6px 0;
    color: var(--ink-3);
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.kv dd {
    margin: 0;
    padding: 6px 0;
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--line);
    text-align: right;
}

.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

/* ============================================================
   MODULE TOGGLES
   ============================================================ */

.mods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.mod {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .13s, background .13s;
}

.mod:hover { border-color: var(--accent-line); background: var(--surface-2); }
.mod.on    { border-color: var(--accent-line); background: var(--accent-soft); }
.mod.fixed { opacity: .72; cursor: default; background: var(--surface-3); }

.mod input { width: auto; margin-top: 2px; accent-color: var(--accent); }
.mod .t { font-size: 13px; font-weight: 600; }
.mod .d { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }

/* ============================================================
   PHOTO GALLERY
   ============================================================ */

.gal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.ph {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--sh-1);
    transition: box-shadow .15s, border-color .15s;
}

.ph:hover { box-shadow: var(--sh-2); border-color: var(--line-strong); }
.ph.off { opacity: .45; }

.ph-i {
    position: relative;
    aspect-ratio: 180 / 96;
    background: var(--navy-800);
    overflow: hidden;
}

.ph-i img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ph-n {
    position: absolute; top: 8px; left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(5,18,31,.86);
    color: #fff;
    font-size: 10.5px; font-weight: 700;
    backdrop-filter: blur(4px);
}

.ph-src {
    position: absolute; top: 8px; right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: var(--ink-2);
    font-size: 9px; font-weight: 700; letter-spacing: .04em;
}

.ph-b { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ph-b input, .ph-b select { height: 30px; font-size: 12px; }

.ph-a { display: flex; gap: 5px; }
.ph-a > * { flex: 1; }

.drop {
    display: block;
    padding: 30px 22px;
    border: 2px dashed var(--line-strong);
    border-radius: var(--r);
    background: var(--surface-2);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.drop:hover, .drop.over {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.drop .ico { font-size: 28px; opacity: .45; }
.drop .t { margin-top: 9px; font-size: 14px; font-weight: 600; }
.drop .d { margin-top: 5px; font-size: 12px; color: var(--ink-3); }

/* ============================================================
   IMPORT PICKER
   ============================================================ */

.pick { max-height: 430px; overflow-y: auto; padding: 4px; }

.pick-g {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
    gap: 9px;
}

.pick-i {
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    padding: 5px;
    cursor: pointer;
    font-size: 10px;
    transition: all .12s;
}

.pick-i:hover { border-color: var(--line-strong); }
.pick-i.on { border-color: var(--accent); background: var(--accent-soft); }
.pick-i img {
    width: 100%; height: 74px; object-fit: cover;
    border-radius: 3px; display: block;
}
.pick-i .nm {
    margin-top: 4px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

.pick-f {
    display: block; width: 100%; text-align: left;
    padding: 8px 11px; margin-bottom: 5px;
    border: 1px solid var(--warn-line);
    border-radius: var(--r-sm);
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
}

.pick-f:hover { background: #fdeed2; }

/* ============================================================
   FILE TREE
   ============================================================ */

.tree { font-size: 12.5px; }

.tree .row {
    display: flex; justify-content: space-between; gap: 14px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
}

.tree .row:last-child { border-bottom: 0; }
.tree .row:hover { background: var(--surface-2); }
.tree .nm { font-weight: 550; }
.tree .nm.dir { color: var(--warn); cursor: pointer; }
.tree .nm.dir:hover { text-decoration: underline; }
.tree .mt { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }

/* ============================================================
   PHOTO EDITOR
   ============================================================ */

.ed {
    position: relative;
    width: 100%;
    max-width: 680px;
    aspect-ratio: 180 / 96;
    margin: 0 auto;
    overflow: hidden;
    background: var(--navy-800);
    border: 2px solid var(--line-strong);
    border-radius: var(--r);
    cursor: grab;
    user-select: none;
}

.ed.drag { cursor: grabbing; border-color: var(--accent); }

.ed img {
    position: absolute; top: 50%; left: 50%;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.ed-g {
    position: absolute; inset: 0; pointer-events: none;
    opacity: 0; transition: opacity .15s;
    background:
        linear-gradient(to right, transparent 33.2%, rgba(255,255,255,.3) 33.2%,
            rgba(255,255,255,.3) 33.5%, transparent 33.5%, transparent 66.4%,
            rgba(255,255,255,.3) 66.4%, rgba(255,255,255,.3) 66.7%, transparent 66.7%),
        linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,.3) 33.2%,
            rgba(255,255,255,.3) 33.5%, transparent 33.5%, transparent 66.4%,
            rgba(255,255,255,.3) 66.4%, rgba(255,255,255,.3) 66.7%, transparent 66.7%);
}

.ed:hover .ed-g { opacity: 1; }

.ed-n {
    position: absolute; top: 12px; left: 12px;
    padding: 4px 13px; border-radius: 999px;
    background: rgba(5,18,31,.86); color: #fff;
    font-size: 12px; font-weight: 700;
    pointer-events: none;
}

.ctrl {
    display: flex; align-items: center; gap: 13px;
    flex-wrap: wrap; margin-top: 16px;
}

.ctrl input[type=range] { flex: 1; min-width: 170px; }

.ctrl .lbl {
    font-size: 10.5px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}

.ctrl .val {
    min-width: 58px;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
    @page { size: A4; margin: 11mm; }

    html, body { background: #fff !important; font-size: 10px; }
    .sidebar, .pacts, .no-print { display: none !important; }
    .main { margin: 0 !important; padding: 0 !important; }

    .card, .tw, .stat { box-shadow: none !important; break-inside: avoid; }
    .card { border-color: #b9c6d3 !important; }

    .opbar {
        background: #fff !important; color: #000 !important;
        border: 1px solid #b9c6d3;
    }
    .opbar .meta, .opbar .meta b, .opbar-right { color: #000 !important; }

    table.t { font-size: 8.5px; }
    table.t th { background: #eef2f6 !important; position: static; }

    .brk { break-before: page; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1080px) {
    .sidebar { position: static; width: 100%; height: auto; }
    .main { margin-left: 0; padding: 18px 16px 48px; }
    .nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .nav-label { width: 100%; }
    .nav-item { flex: 0 1 auto; }
    .nav-item.on::before { display: none; }
}

@media (max-width: 640px) {
    .phead { align-items: flex-start; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .kv { grid-template-columns: 1fr; }
    .kv dd { text-align: left; padding-top: 0; }
    .kv dt { border-bottom: 0; padding-bottom: 2px; }
}


/* ---------------------------------------------------------------
   LOGO DE LA EMPRESA
   El archivo tiene fondo transparente y tinta azul oscuro, asi que
   siempre se apoya sobre un panel claro: sobre el azul de la barra
   lateral no se leeria.
   --------------------------------------------------------------- */

.logo-panel {
    background: #fff;
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 13px;
    box-shadow: 0 1px 6px rgba(0,0,0,.22);
}

.logo-panel img {
    width: 100%;
    height: auto;
    display: block;
}

.logo-panel-lg {
    max-width: 260px;
    padding: 12px 16px;
    margin: 0 auto 18px;
}

/* ---- Alias de clases que algunas pantallas usan con otro nombre ---- */
.stat.orange::before { background: var(--gold); }
.stat.orange { background: linear-gradient(180deg, var(--gold-soft), #fff 62%); }
.stat.purple::before { background: #7c5cd6; }
.stat.purple { background: linear-gradient(180deg, #f3efff, #fff 62%); }
.alert { padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 8px; margin: 10px 0; font-size: 13px; }
.alert-ok    { background: var(--ok-soft);   border-color: var(--ok-line);     color: #0a6b4a; }
.alert-error { background: var(--bad-soft);  border-color: var(--bad-line);    color: #9b1c1c; }
.alert-info  { background: var(--info-soft); border-color: var(--accent-line); color: #17457f; }
.help-note { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
