/* ==========================================================
   LEBRIAH OPS — Design System
   Paleta: morado profundo / negro / blanco. Look premium.
   ========================================================== */

:root {
    --bg: #0a0912;
    --bg-alt: #120f1c;
    --surface: #1a1626;
    --surface-2: #221d32;
    --surface-hover: #2a2440;
    --border: #2c2740;

    --purple: #6d3fe0;
    --purple-light: #a488f5;
    --purple-dark: #3d1f8c;
    --purple-glow: rgba(109, 63, 224, 0.35);

    --white: #ffffff;
    --text: #f4f2fa;
    --text-muted: #9c95b5;
    --text-faint: #6f6889;

    --success: #2fbf71;
    --success-bg: rgba(47, 191, 113, 0.14);
    --warning: #e0a63c;
    --warning-bg: rgba(224, 166, 60, 0.14);
    --danger: #e6415f;
    --danger-bg: rgba(230, 65, 95, 0.14);
    --info: #6d3fe0;
    --info-bg: rgba(109, 63, 224, 0.14);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);

    --sidebar-w: 260px;
    --topbar-h: 72px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { overflow-x: hidden; }
body {
    margin: 0;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 10% 0%, rgba(109, 63, 224, 0.10), transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(109, 63, 224, 0.08), transparent 40%);
    background-attachment: fixed;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .brandfont {
    font-family: 'Sora', 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}
a { color: var(--purple-light); text-decoration: none; }
::selection { background: var(--purple); color: #fff; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-dark); }

/* ---------- Layout base ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #0d0b16 0%, #120f1e 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 40;
    transition: transform .25s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 26px 22px 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand img { height: 46px; width: auto; image-rendering: -webkit-optimize-contrast; }
.sidebar-brand .brand-text { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; line-height: 1.2; }
.sidebar-brand .brand-text span { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 14.5px; font-weight: 500;
    transition: all .15s ease;
}
.sidebar-nav a:hover { background: var(--surface); color: var(--text); }
.sidebar-nav a.active {
    background: linear-gradient(90deg, var(--purple-dark), rgba(109,63,224,.25));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(164,136,245,.25);
}
.sidebar-nav .nav-icon { width: 18px; text-align: center; font-size: 16px; }
.sidebar-nav .nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); padding: 16px 14px 6px; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff;
}
.sidebar-user .who { line-height: 1.2; }
.sidebar-user .who strong { display: block; font-size: 13.5px; }
.sidebar-user .who small { color: var(--text-muted); font-size: 11.5px; text-transform: capitalize; }
.sidebar-user a.logout { margin-left: auto; color: var(--text-faint); font-size: 16px; }
.sidebar-user a.logout:hover { color: var(--danger); }

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.topbar {
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
    background: rgba(10, 9, 18, 0.75);
    backdrop-filter: blur(10px);
}
.topbar h1 { font-size: 19px; margin: 0; }
.topbar .topbar-actions { display: flex; gap: 10px; align-items: center; }
.menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }

.content { padding: 28px; flex: 1; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.card-subtitle { font-size: 12.5px; color: var(--text-muted); margin: 0 0 16px; }
.grid { display: grid; gap: 18px; min-width: 0; }
.grid > * { min-width: 0; }
.flex, .flex-between { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-4, .grid-3 { grid-template-columns: 1fr; } }

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; font-family: 'Sora', sans-serif; }
.stat-card .stat-value.purple { color: var(--purple-light); }
.stat-card .stat-value.success { color: var(--success); }
.stat-card .stat-hint { font-size: 12px; color: var(--text-faint); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    border: 1px solid transparent; transition: all .15s ease;
    font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--purple), var(--purple-dark)); color: #fff; box-shadow: 0 6px 18px var(--purple-glow); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-outline { background: transparent; border-color: var(--purple); color: var(--purple-light); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
input[type=text], input[type=password], input[type=date], input[type=url], input[type=email], input[type=search], select, textarea {
    width: 100%; padding: 11px 13px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg-alt); color: var(--text);
    font-size: 14px; font-family: inherit; transition: border-color .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }
input[type=date] { color-scheme: dark; }
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 24px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 2px; top: 2px; background: var(--text-muted); border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--purple); border-color: var(--purple); }
.switch input:checked + .slider::before { transform: translateX(20px); background: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
    text-align: left; padding: 13px 16px; background: var(--surface-2);
    color: var(--text-muted); font-weight: 600; font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .05em;
    position: sticky; top: 0;
}
table.data td { padding: 13px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { background: var(--surface); transition: background .12s ease; }
table.data tbody tr:hover { background: var(--surface-hover); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--purple-light); }
.badge-muted { background: var(--surface-2); color: var(--text-muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tabs a { padding: 12px 4px; margin-right: 22px; color: var(--text-muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; }
.tabs a.active { color: #fff; border-color: var(--purple); }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(5,4,10,.65); backdrop-filter: blur(3px);
    display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow); animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.modal-body { padding: 22px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Toasts ---------- */
#toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    padding: 13px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-sm);
    animation: toastIn .18s ease; max-width: 320px;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Calendar ---------- */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.calendar-dow { text-align: center; font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 6px; }
.calendar-cell {
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    min-height: 108px; padding: 8px; display: flex; flex-direction: column; gap: 5px;
    transition: background .12s ease;
}
.calendar-cell.other-month { opacity: .35; }
.calendar-cell.today { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple); }
.calendar-cell.drag-over { background: var(--surface-hover); }
.calendar-cell .cell-date { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.calendar-event {
    font-size: 11px; padding: 4px 7px; border-radius: 6px; background: var(--surface-2);
    border-left: 3px solid var(--purple); cursor: grab; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; font-weight: 500;
}
.calendar-event:active { cursor: grabbing; }

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 50% 0%, rgba(109,63,224,.22), transparent 55%), var(--bg);
}
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px 34px; box-shadow: var(--shadow); text-align: center; }
.login-card img { height: 74px; margin-bottom: 18px; image-rendering: -webkit-optimize-contrast; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p.subtitle { color: var(--text-muted); font-size: 13.5px; margin: 0 0 26px; }
.login-card form { text-align: left; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-error { background: var(--danger-bg); color: var(--danger); padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; }

/* ---------- Vista 1win (luxury, negro/blanco) ---------- */
.win-page { min-height: 100vh; background: #050505; color: #fff; }
.win-header {
    position: relative;
    padding: 54px 6vw 34px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.08);
    background:
        radial-gradient(circle at 20% 0%, rgba(109,63,224,.20), transparent 55%),
        radial-gradient(circle at 80% 100%, rgba(109,63,224,.12), transparent 50%),
        linear-gradient(180deg, #0d0d0d, #050505);
    overflow: hidden;
}
.win-header .win-logos { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 22px; }
.win-header img { height: 56px; image-rendering: -webkit-optimize-contrast; }
.win-header .win-logo-fallback {
    height: 46px; display: none; align-items: center; font-family: 'Sora', sans-serif;
    font-weight: 700; font-size: 22px; letter-spacing: .04em; color: #fff;
}
.win-header .win-x { color: rgba(255,255,255,.3); font-size: 20px; }
.win-header .win-1win-mark { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 26px; letter-spacing: .02em; color: #fff; }
.win-header h1 { font-family: 'Sora', sans-serif; font-size: 25px; margin: 0 0 8px; letter-spacing: .01em; }
.win-header p.win-sub { color: rgba(255,255,255,.5); font-size: 13.5px; margin: 0; }
.win-header p.win-sub strong { color: rgba(255,255,255,.75); font-weight: 600; }

.win-stats {
    max-width: 900px; margin: 36px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
    position: relative;
}
.win-stat-card {
    background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.16); border-radius: 16px;
    padding: 20px 18px; text-align: left; box-shadow: 0 8px 24px rgba(0,0,0,.35);
    position: relative;
}
.win-stat-card::before {
    content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}
.win-stat-card .win-stat-value { font-family: 'Sora', sans-serif; font-size: 30px; font-weight: 800; color: #fff; line-height: 1; }
.win-stat-card .win-stat-label { font-size: 11px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .07em; margin-top: 7px; }
.win-stat-card.accent .win-stat-value { color: #a488f5; }
.win-progress-track { max-width: 900px; margin: 16px auto 0; height: 5px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.win-progress-fill { height: 100%; background: linear-gradient(90deg, #6d3fe0, #a488f5); transition: width .6s ease; }

.win-body { max-width: 1100px; margin: 0 auto; padding: 40px 6vw 80px; }

.win-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.win-tabs { display: flex; gap: 6px; background: rgba(255,255,255,.05); padding: 4px; border-radius: 12px; border: 1px solid rgba(255,255,255,.09); }
.win-tabs button {
    background: none; border: none; color: rgba(255,255,255,.55); font-family: inherit; font-size: 13px; font-weight: 600;
    padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: all .15s ease;
}
.win-tabs button.active { background: #fff; color: #050505; }
.win-toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.win-search {
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); color: #fff;
    padding: 9px 14px; border-radius: 10px; font-size: 13px; font-family: inherit; min-width: 220px;
}
.win-search::placeholder { color: rgba(255,255,255,.35); }
.win-search:focus { outline: none; border-color: rgba(164,136,245,.5); }
.win-filter-select {
    background: rgba(255,255,255,.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='rgba(255,255,255,0.5)'%3E%3Cpath d='M5.5 7.5L10 12l4.5-4.5' stroke='rgba(255,255,255,0.5)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid rgba(255,255,255,.14); color: #fff;
    padding: 9px 34px 9px 12px; border-radius: 10px; font-size: 13px; font-family: inherit;
    appearance: none; -webkit-appearance: none; cursor: pointer;
}

.win-table-wrap { border: 1px solid rgba(255,255,255,.1); border-radius: 16px; overflow-x: auto; }
table.win-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.win-table th {
    background: #0c0c0c; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .07em;
    font-size: 11px; padding: 14px 18px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.08);
}
table.win-table td { padding: 15px 18px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
table.win-table tr.confirmado { background: rgba(47, 191, 113, 0.06); }
table.win-table tr:hover { background: rgba(255,255,255,.03); }
table.win-table tr:last-child td { border-bottom: none; }
.win-link { color: #cdb8ff; text-decoration: none; }
.win-link:hover { text-decoration: underline; }
.win-empty { text-align: center; padding: 60px 20px; color: rgba(255,255,255,.4); }

.win-platform-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.win-platform-label { color: rgba(255,255,255,.85); font-size: 12.5px; }

.win-status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.win-status-pendiente { background: rgba(255,255,255,.08); color: rgba(255,255,255,.55); }
.win-status-programado { background: rgba(164,136,245,.15); color: #c9b8f7; }
.win-status-publicado { background: rgba(47,191,113,.15); color: #6ee0a3; }

.win-link-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 8px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; font-size: 12px; font-weight: 600;
    text-decoration: none; transition: all .15s ease;
}
.win-link-btn:hover { background: #fff; color: #050505; }

.win-switch { position: relative; display: inline-block; width: 46px; height: 25px; }
.win-switch input { opacity: 0; width: 0; height: 0; }
.win-switch .win-slider {
    position: absolute; inset: 0; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
    border-radius: 30px; cursor: pointer; transition: .2s;
}
.win-switch .win-slider::before {
    content: ""; position: absolute; height: 19px; width: 19px; left: 2px; top: 2px;
    background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.win-switch input:checked + .win-slider { background: #2fbf71; border-color: #2fbf71; }
.win-switch input:checked + .win-slider::before { transform: translateX(21px); }

/* Calendario de solo lectura para 1win */
.win-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.win-cal-nav button {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff;
    width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px;
}
.win-cal-nav button:hover { background: rgba(255,255,255,.14); }
.win-cal-nav h3 { font-family: 'Sora', sans-serif; margin: 0; font-size: 16px; font-weight: 600; }
.win-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.win-cal-dow { text-align: center; font-size: 10.5px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 6px; }
.win-cal-cell {
    background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07); border-radius: 12px;
    min-height: 96px; padding: 8px; display: flex; flex-direction: column; gap: 5px;
}
.win-cal-cell.other-month { opacity: .3; }
.win-cal-cell.today { border-color: #a488f5; box-shadow: 0 0 0 1px #a488f5; }
.win-cal-cell .win-cell-date { font-size: 11.5px; color: rgba(255,255,255,.45); font-weight: 600; }
.win-cal-pill {
    font-size: 10.5px; padding: 4px 7px; border-radius: 6px; background: rgba(255,255,255,.06);
    border-left: 2px solid #a488f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
    text-decoration: none; color: #fff; display: block;
}
.win-cal-pill:hover { background: rgba(255,255,255,.14); }
.win-cal-pill.confirmado { border-left-color: #2fbf71; }

.win-footer { text-align: center; padding: 30px 6vw 50px; color: rgba(255,255,255,.3); font-size: 12px; border-top: 1px solid rgba(255,255,255,.06); margin-top: 20px; }
.win-footer strong { color: rgba(255,255,255,.5); }

@media (max-width: 720px) {
    .win-stats { grid-template-columns: repeat(2, 1fr); }
    .win-toolbar { flex-direction: column; align-items: stretch; }
    .win-search { min-width: 0; }
}

/* ---------- Kanban ---------- */
/* ---------- Inventario (grilla con foto) ---------- */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.inv-card {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; cursor: pointer; transition: border-color .15s ease;
    display: flex; flex-direction: column;
}
.inv-card.selected { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple); }
.inv-card .inv-thumb {
    width: 100%; aspect-ratio: 1/1; background: var(--surface); display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 26px; overflow: hidden; position: relative;
}
.inv-card .inv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.inv-card .inv-check {
    position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 6px;
    background: rgba(10,9,18,.6); border: 1.5px solid rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff;
}
.inv-card.selected .inv-check { background: var(--purple); border-color: var(--purple); }
.inv-card .inv-info { padding: 8px 10px; }
.inv-card .inv-name { font-size: 12.5px; font-weight: 600; display: block; line-height: 1.3; }
.inv-card .inv-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; display: block; }

.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .kanban-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .kanban-board { grid-template-columns: 1fr; } }
.kanban-column { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-height: 200px; }
.kanban-column-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 2px; }
.kanban-column-header h4 { margin: 0; font-size: 13.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.kanban-column-header .count { background: var(--surface-2); color: var(--text-muted); font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.kanban-cards.drag-over { background: var(--surface-hover); border-radius: 10px; }
.kanban-card { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--purple); border-radius: 10px; padding: 12px 13px; cursor: grab; font-size: 13.5px; }
.kanban-card:active { cursor: grabbing; }
.kanban-card .kc-title { font-weight: 600; margin-bottom: 6px; }
.kanban-card .kc-meta { font-size: 11.5px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
    .main { margin-left: 0; }
    .menu-toggle { display: block; }
    .content { padding: 16px; }
    .form-row { flex-direction: column; gap: 0; }

    /* El topbar ya no se corta: crece de alto y las acciones bajan de línea */
    .topbar {
        height: auto; min-height: var(--topbar-h);
        flex-wrap: wrap; gap: 10px 0;
        padding: 14px 16px;
    }
    .topbar h1 { font-size: 16px; }
    .topbar .topbar-actions { flex-wrap: wrap; width: 100%; gap: 8px; }
    .topbar .topbar-actions .btn { flex: 1 1 auto; justify-content: center; }

    /* Calendario interno: celdas más chicas y legibles en celular */
    .calendar-cell { min-height: 64px; padding: 5px; border-radius: 8px; }
    .calendar-cell .cell-date { font-size: 10.5px; }
    .calendar-event { font-size: 9.5px; padding: 3px 5px; }
    .calendar-dow { font-size: 9.5px; }
    .calendar-grid { gap: 4px; }

    /* Kanban: tarjetas con menos aire para que quepa más en pantalla */
    .kanban-card { padding: 10px 11px; font-size: 12.5px; }

    /* Toasts: nunca se salen por el borde en pantallas angostas */
    #toast-container { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
    .toast { max-width: none; }

    .modal-header, .modal-body, .modal-footer { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 480px) {
    .content { padding: 12px; }
    .card { padding: 16px; }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    h1 { font-size: 18px; }
    .stat-card .stat-value { font-size: 21px; }
    table.data th, table.data td { padding: 10px 12px; font-size: 12.5px; }
    .calendar-cell { min-height: 50px; }
    .login-card { padding: 28px 20px; }
}

/* ---------- Responsive: vista pública 1win ---------- */
@media (max-width: 640px) {
    .win-header { padding: 40px 5vw 26px; }
    .win-header h1 { font-size: 19px; }
    .win-1win-mark { font-size: 20px; }
    .win-cal-cell { min-height: 60px; padding: 5px; }
    .win-cal-cell .win-cell-date { font-size: 10px; }
    .win-cal-pill { font-size: 9px; padding: 3px 5px; }
    .win-cal-grid { gap: 4px; }
    table.win-table th, table.win-table td { padding: 10px 12px; font-size: 12.5px; }
}
