/* ============================================================
   Portal de Proveedores Softwerk — tema oscuro
   Paleta: negro #1a1a1a / gris #2d2d2d / rojo #c8102e / contenido #EDE8E8
   ============================================================ */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; background: #EDE8E8; font-family: 'Segoe UI', Arial, sans-serif; color: #222; }

/* ---------- Layout privado (con sidebar) ---------- */
.sw-layout { display: flex; min-height: 100vh; }
.sw-sidebar {
    width: 252px; min-width: 252px; background: #1a1a1a; border-right: 1px solid #2a2a2a;
    display: flex; flex-direction: column; height: 100vh; position: fixed; top: 0; left: 0; z-index: 100;
}
.sw-sidebar-logo { padding: 16px 18px 14px; border-bottom: 1px solid #2a2a2a; }
.sw-sidebar-logo strong { display: block; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .06em; }
.sw-sidebar-logo-sub { font-size: 9px; color: #7f8c8d; letter-spacing: .10em; text-transform: uppercase; margin-top: 5px; font-weight: 600; }
.sw-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.sw-nav-item {
    display: flex; align-items: center; padding: 14px 20px; cursor: pointer;
    border-left: 3px solid transparent; color: #b0b8c1; font-size: 15px; font-weight: 600;
    text-decoration: none; transition: background .12s, color .12s, border-left-color .12s;
}
.sw-nav-item:hover { background: #2d2d2d; color: #fff; border-left-color: #c8102e; text-decoration: none; }
.sw-nav-item.active { background: #c8102e; color: #fff; border-left-color: #ff1a3c; }
.sw-nav-item i { width: 24px; font-size: 18px; flex-shrink: 0; margin-right: 12px; color: #7f8c8d; }
.sw-nav-item:hover i { color: #c8102e; }
.sw-nav-item.active i { color: #fff; }
.sw-nav-item.disabled { opacity: .4; cursor: default; }
.sw-nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sw-sidebar-profile { border-top: 1px solid #2a2a2a; padding: 12px 16px 14px; }
.sw-profile-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sw-avatar { width: 38px; height: 38px; border-radius: 50%; background: #c8102e; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.sw-profile-info { overflow: hidden; flex: 1; }
.sw-profile-name { font-size: 12px; font-weight: 700; color: #fff; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-profile-sub { font-size: 10px; color: #8c95a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.sw-btn-salir { width: 100%; background: transparent; border: 1.5px solid #3a3a3a; color: #d5d5d5; border-radius: 6px; padding: 7px 10px; font-size: 12px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: background .12s, color .12s, border-color .12s; }
.sw-btn-salir:hover { background: #2d2d2d; color: #fff; border-color: #c8102e; text-decoration: none; }

.sw-main { margin-left: 252px; flex: 1; min-height: 100vh; }
.sw-topbar { background: #1a1a1a; color: #fff; padding: 12px 26px; font-size: 14px; font-weight: 600; letter-spacing: .04em; }

/* Barra de totales (panel top) */
.sw-statsbar { background: #faf9f7; border-bottom: 1px solid #ddd; display: flex; align-items: stretch; box-shadow: 0 1px 3px rgba(0,0,0,.06); flex-wrap: wrap; }
.sw-stat { display: flex; align-items: center; gap: 12px; padding: 13px 26px; border-right: 1px solid #eee; }
.sw-stat > i { font-size: 23px; color: #c8102e; opacity: .9; }
.sw-stat-txt { display: flex; flex-direction: column; line-height: 1.1; }
.sw-stat .num { font-size: 22px; font-weight: 800; color: #1a1a1a; }
.sw-stat .num-fecha { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.sw-stat .lbl { font-size: 10.5px; color: #888; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.sw-stat-fecha { border-right: none; background: #faf7f7; }
.sw-content { padding: 28px 32px; }
.sw-page-title { font-size: 24px; font-weight: 600; color: #222; margin: 0 0 4px; }
.sw-page-title b { font-weight: 600; }
.sw-hr { border: none; border-top: 1px solid #d8d2d2; margin: 14px 0 24px; }

/* ---------- Tarjetas ---------- */
.sw-card { background: #faf9f7; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 22px 26px; margin-bottom: 22px; }
.sw-card h3 { margin: 0 0 16px; font-size: 16px; color: #1a1a1a; text-align: center; font-weight: 700; }

/* ---------- Formularios ---------- */
.sw-form-row { display: flex; align-items: center; margin-bottom: 14px; }
.sw-form-row label { width: 150px; text-align: right; padding-right: 16px; font-weight: 700; color: #444; font-size: 14px; }
.sw-form-row .sw-field { flex: 1; }
.sw-input { width: 100%; padding: 9px 12px; border: 1px solid #c9c9c9; border-radius: 5px; font-size: 14px; }
.sw-input:focus { outline: none; border-color: #c8102e; box-shadow: 0 0 0 2px rgba(200,16,46,.12); }

/* Ver contraseña (ojito) */
.sw-pass-wrap { position: relative; margin-bottom: 14px; }
.sw-pass-wrap .sw-input { margin-bottom: 0; padding-right: 48px; }
.sw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; background: none; border: none; color: #9a9a9a; cursor: pointer; font-size: 18px; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center; }
.sw-eye:hover { color: #c8102e; }
.sw-input[readonly] { background: #eceff1; color: #555; }

.sw-btn { background: #c8102e; color: #fff; border: none; border-radius: 6px; padding: 11px 22px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .12s; }
.sw-btn:hover { background: #a50d26; }
.sw-btn:disabled { opacity: .5; cursor: default; }
.sw-btn-block { width: 100%; }
.sw-btn-link { background: none; border: none; color: #c8102e; cursor: pointer; font-size: 13px; text-decoration: underline; padding: 0; }

.sw-alert { padding: 11px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; text-align: center; }
.sw-alert-error { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6cb; }
.sw-alert-ok { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.sw-alert-info { background: #fff4e5; color: #8a5a00; border: 1px solid #ffe0b2; }

/* ---------- Grillas ---------- */
.sw-table { width: 100%; border-collapse: collapse; background: #faf9f7; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.sw-table th { background: #f3f3f3; color: #444; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; text-align: left; border-bottom: 2px solid #e0e0e0; }
.sw-table td { padding: 11px 14px; border-bottom: 1px solid #eee; font-size: 14px; }
.sw-table tr:hover td { background: #faf7f7; }
.sw-empresa-group { background: #7a0a1c; color: #fff; font-weight: 700; padding: 9px 14px; font-size: 13px; }
.sw-table tr:hover td.sw-empresa-group { background: #7a0a1c; color: #fff; }

/* ---------- Login / Registro (pantalla publica, 2 columnas) ---------- */
.sw-auth-page { display: flex; min-height: 100vh; }
.sw-auth-right { flex: 1; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #c8102e 0%, #7a0a1c 60%, #4a0612 100%); padding: 24px; }

/* panel izquierdo (marca) */
.sw-brand { width: 30%; min-width: 240px; background: linear-gradient(158deg, #14060a 0%, #2e0911 50%, #5a0e1c 100%); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 32px; position: relative; overflow: hidden; }
.sw-brand::before { content:''; position:absolute; top:-70px; right:-70px; width:300px; height:300px; border-radius:50%; background: radial-gradient(circle, rgba(200,16,46,.22) 0%, transparent 70%); pointer-events:none; }
.sw-brand-line { position:absolute; right:0; top:0; bottom:0; width:1px; background: linear-gradient(to bottom, transparent, rgba(200,16,46,.5) 40%, rgba(200,16,46,.5) 60%, transparent); }
.sw-brand-logo { position:relative; z-index:1; display:flex; flex-direction:column; align-items:flex-start; }
.sw-brand-logo-img { height:38px; width:auto; max-width:210px; display:block; }
.sw-brand-logo-sub { font-size:9.5px; color: rgba(255,255,255,.6); letter-spacing:.14em; text-transform:uppercase; font-weight:700; margin-top:9px; }
.sw-brand-body { flex:1; display:flex; flex-direction:column; justify-content:center; position:relative; z-index:1; }
.sw-badge { display:inline-flex; align-items:center; gap:7px; background: rgba(200,16,46,.20); border:1px solid rgba(200,16,46,.5); color:#ff9a9a; font-size:9.5px; font-weight:700; letter-spacing:1.1px; text-transform:uppercase; padding:4px 11px; border-radius:99px; width:fit-content; margin-bottom:20px; }
.sw-badge-dot { width:6px; height:6px; border-radius:50%; background:#c8102e; box-shadow:0 0 6px rgba(200,16,46,.95); }
.sw-brand-headline { font-size:23px; font-weight:800; line-height:1.3; letter-spacing:-.3px; margin-bottom:14px; }
.sw-brand-headline em { font-style:normal; color:#FF6B6B; }
.sw-brand-desc { font-size:12.5px; color: rgba(255,255,255,.6); line-height:1.78; }
.sw-brand-feats { list-style:none; margin:22px 0 0; padding:0; }
.sw-brand-feats li { font-size:12.5px; color: rgba(255,255,255,.72); padding:6px 0 6px 22px; position:relative; }
.sw-brand-feats li::before { content:'\2713'; position:absolute; left:0; color:#c8102e; font-weight:800; }
.sw-brand-footer { position:relative; z-index:1; font-size:11px; color: rgba(255,255,255,.4); }
.sw-recaptcha-wrap { display:flex; justify-content:center; margin:4px 0 14px; }
@media (max-width: 760px) { .sw-brand { display:none; } }
.sw-auth-card { background: #eef0f3; border-radius: 10px; box-shadow: 0 12px 45px rgba(0,0,0,.45); width: 100%; max-width: 400px; overflow: hidden; }
.sw-auth-head { background: #a00d22; color: #fff; padding: 22px 26px; text-align: center; }
.sw-auth-head strong { font-size: 19px; letter-spacing: .02em; }
.sw-auth-head .sub { display: block; font-size: 10px; color: #9aa3ad; letter-spacing: .12em; text-transform: uppercase; margin-top: 6px; }
.sw-auth-accent { height: 3px; background: #c8102e; }
.sw-auth-body { padding: 26px; }
.sw-auth-body .sw-input { margin-bottom: 14px; }
.sw-auth-foot { text-align: center; margin-top: 14px; font-size: 13px; color: #666; }
.sw-auth-foot a { color: #c8102e; text-decoration: none; font-weight: 600; }

/* ---------- Badges de estado ---------- */
.sw-estado { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.sw-estado.pagada { background: #e8f5e9; color: #1b5e20; }
.sw-estado.pendiente { background: #fff4e5; color: #8a5a00; }
.sw-estado.parcial { background: #e1f0fb; color: #0b5394; }
.sw-estado.otro { background: #eceff1; color: #555; }

/* ---------- Dropdown de descargas ---------- */
.sw-dd { position: relative; display: inline-block; }
.sw-dd-toggle { background: #fff; border: 1px solid #c9c9c9; border-radius: 5px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: #444; cursor: pointer; }
.sw-dd-toggle:hover { border-color: #c8102e; color: #c8102e; }
.sw-dd-menu { display: none; position: absolute; right: 0; top: 100%; margin-top: 3px; background: #fff; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.15); min-width: 170px; z-index: 50; overflow: hidden; }
.sw-dd-menu.open { display: block; }
.sw-dd-menu a { display: block; padding: 9px 14px; font-size: 13px; color: #333; text-decoration: none; cursor: pointer; }
.sw-dd-menu a:hover { background: #faf0f1; color: #c8102e; }
.sw-btn-ver { background: none; border: none; color: #c8102e; cursor: pointer; font-size: 16px; }

/* Fila expandible master-detail (factura -> pagos) */
.sw-toggle-btn { background:#fff; border:1px solid #ccc; border-radius:5px; width:26px; height:26px; cursor:pointer; color:#c8102e; font-weight:800; font-size:15px; line-height:1; padding:0; }
.sw-toggle-btn:hover { background:#faf0f1; border-color:#c8102e; }
.sw-toggle-ph { display:inline-block; width:26px; }
.sw-subdetalle { background:#f7f4f4; padding:12px 18px; }
.sw-subdetalle .sub-title { font-size:11px; font-weight:700; color:#c8102e; text-transform:uppercase; letter-spacing:.05em; margin-bottom:8px; }
.sw-subtable { width:100%; border-collapse:collapse; background:#fff; border:1px solid #e6e6e6; border-radius:6px; }
.sw-subtable th { background:#f0f0f0; font-size:11px; text-transform:uppercase; color:#555; padding:8px 12px; text-align:left; letter-spacing:.03em; }
.sw-subtable td { padding:9px 12px; border-top:1px solid #f0f0f0; font-size:13px; }
.sw-subtable tr:hover td { background:#fbf8f8; }

/* Tarjeta de pago (OP) dentro de la factura expandida */
.sw-pago-card { background:#fff; border:1px solid #e6e6e6; border-radius:6px; margin-bottom:10px; overflow:hidden; }
.sw-pago-card:last-child { margin-bottom:0; }
.sw-pago-head { display:flex; align-items:center; justify-content:space-between; gap:12px; background:#efe9e9; padding:9px 14px; font-size:13px; flex-wrap:wrap; }
.sw-pago-head .op-info { color:#444; }
.sw-pago-head .op-info b { color:#1a1a1a; font-size:14px; }
.sw-nc-card .sw-pago-head { background:#e9f3ea; }
.sw-nc-tag { font-size:11px; color:#3f7a4a; font-weight:600; display:inline-flex; align-items:center; gap:5px; }
.sw-pago-body { padding:10px 14px; }
.sw-pdf-btn { display:inline-flex; align-items:center; gap:6px; background:#c8102e; color:#fff; border:none; border-radius:5px; padding:6px 12px; font-size:12px; font-weight:700; cursor:pointer; text-decoration:none; }
.sw-pdf-btn:hover { background:#a50d26; color:#fff; }
.sw-mini-title { font-size:10.5px; font-weight:700; color:#999; text-transform:uppercase; letter-spacing:.05em; margin:6px 0 5px; }
.sw-pdf-ico { color:#c8102e; cursor:pointer; font-size:17px; background:none; border:none; padding:2px 6px; }
.sw-pdf-ico:hover { color:#a50d26; }
.sw-detalle-box { background: #faf9f7; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 18px 22px; margin-bottom: 18px; }
.sw-detalle-box h4 { margin: 0 0 12px; font-size: 14px; color: #c8102e; text-transform: uppercase; letter-spacing: .04em; }

/* ============================================================
   Acordeon premium (Facturas / Pagos) — Empresa > comprobante > detalle
   ============================================================ */
.sw-emp-block { margin-bottom: 28px; }
.sw-emp-banner { display: flex; align-items: center; gap: 13px; background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%); color: #fff; padding: 13px 20px; border-radius: 10px 10px 0 0; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.sw-emp-banner .ico { width: 34px; height: 34px; border-radius: 8px; background: #c8102e; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.sw-emp-banner .nom { font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.sw-emp-banner .cuit { margin-left: auto; font-size: 12px; color: #b9c0c8; font-weight: 600; }

/* encabezado de columnas */
.sw-grid-head { gap: 10px; align-items: center; padding: 9px 16px; background: #f3efef; border-bottom: 2px solid #e3dada; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #978a8a; }
.sw-grid-head, .sw-acc-head { display: grid; }
.sw-grid-head .r, .sw-acc-head .r { text-align: right; }
.sw-grid-head .c, .sw-acc-head .c { text-align: center; }

/* contenedor de items por empresa */
.sw-emp-list { border: 1px solid #ece6e6; border-top: none; border-radius: 0 0 10px 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.sw-emp-list > .sw-acc { border-bottom: 1px solid #efe7e7; }
.sw-emp-list > .sw-acc:last-child { border-bottom: none; }

/* item acordeon */
.sw-acc { background: #fff; }
.sw-acc-head { gap: 10px; align-items: center; padding: 12px 16px; cursor: pointer; transition: background .12s; font-size: 13.5px; color: #333; }
.sw-acc-head:hover { background: #faf4f5; }
.sw-acc.open > .sw-acc-head { background: #fbeff1; }
.sw-acc-head .nro b { color: #1a1a1a; }
.sw-chev { color: #c8102e; font-size: 13px; transition: transform .15s; display: inline-block; }
.sw-acc.open > .sw-acc-head .sw-chev { transform: rotate(90deg); }
.sw-acc-acciones { display: flex; align-items: center; justify-content: center; gap: 8px; }

/* fila no expandible (Nota de Credito / sin hijos) */
.sw-acc-static > .sw-acc-head { cursor: default; }
.sw-acc-static > .sw-acc-head:hover { background: transparent; }
.sw-acc-static .sw-chev { color: #cfc7c7; }

/* panel desplegable */
.sw-acc-panel { display: none; padding: 14px 18px 16px; background: #f9f6f6; border-top: 1px dashed #e6dede; }
.sw-acc.open > .sw-acc-panel { display: block; }
.sw-sub-label { font-size: 11px; font-weight: 700; color: #c8102e; text-transform: uppercase; letter-spacing: .05em; margin: 2px 0 10px; }
.sw-empty { color: #999; font-size: 12px; padding: 2px 0 4px; }

/* sub-tarjetas de OP dentro de una factura */
.sw-acc-op { border: 1px solid #e8e0e0; border-radius: 8px; margin-bottom: 8px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.sw-acc-op:last-child { margin-bottom: 0; }
.sw-acc-op.open { box-shadow: 0 2px 8px rgba(0,0,0,.09); }
.sw-acc-op.sw-nc { background: #f4f9f4; border-color: #d7e7d7; }
.sw-acc-op.sw-nc > .sw-acc-head:hover { background: #eef6ee; }
.sw-acc-op > .sw-acc-panel { border-radius: 0 0 8px 8px; }

/* grillas por tipo (mismas columnas en titulo y filas) */
.sw-grid-fac { grid-template-columns: 26px 1.25fr 1.6fr 1.05fr 1.2fr 1.2fr 1.15fr; }
.sw-grid-op  { grid-template-columns: 24px .95fr 1fr 1.25fr .5fr 1fr 1fr 1fr 1fr 1.05fr .9fr; }
.sw-grid-op.sw-grid-head { background: #f7f2f2; }
