/* ═══════════════════════════════════════════════════════════════
   ALA PRINTING – admin.css
═══════════════════════════════════════════════════════════════ */
:root {
  --admin-primary:   #0155B5;
  --admin-secondary: #0B2E56;
  --admin-sidebar-w: 240px;
  --admin-top-h:     60px;
  --admin-bg:        #F3F6FB;
  --admin-card-bg:   #FFFFFF;
  --admin-border:    #E2E8F0;
  --admin-text:      #1E293B;
  --admin-muted:     #64748B;
  --font:           'Montserrat', sans-serif;
  --radius:          10px;
  --shadow:          0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); background: var(--admin-bg); color: var(--admin-text); font-size: 14px; }

/* ─── LOGIN ─── */
.admin-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--admin-secondary) 0%, var(--admin-primary) 100%);
  padding: 20px;
}
.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-logo {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--admin-secondary), var(--admin-primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff; margin: 0 auto 20px;
}
.login-box h4 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-box p  { color: var(--admin-muted); margin-bottom: 24px; }
.login-box .form-control {
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--admin-border);
  font-family: var(--font);
}
.login-box .form-control:focus { border-color: var(--admin-primary); box-shadow: 0 0 0 3px rgba(1,85,181,.1); }
.btn-admin-primary {
  background: var(--admin-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .2s, transform .1s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-admin-primary:hover { background: #0146a0; color: #fff; transform: translateY(-1px); }

/* ─── LAYOUT ─── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--admin-secondary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.brand-icon { font-size: 22px; color: #60a5fa; }

.sidebar-nav { flex: 1; padding: 12px 10px; }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  padding: 12px 10px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: rgba(255,255,255,.7);
  border-radius: 8px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  position: relative;
}
.sidebar-link i { font-size: 16px; min-width: 18px; }
.sidebar-link span { flex: 1; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: var(--admin-primary); color: #fff; }

.badge-count {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 50px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  gap: 6px;
}
.sidebar-footer a, .sidebar-footer button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-footer a:hover, .sidebar-footer button:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ─── MAIN ─── */
.admin-main {
  flex: 1;
  margin-left: var(--admin-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin .3s;
}

/* ─── TOPBAR ─── */
.admin-topbar {
  height: var(--admin-top-h);
  background: #fff;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--admin-text);
  padding: 4px;
  display: none;
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--admin-bg);
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  cursor: pointer;
  color: var(--admin-text);
  transition: background .15s;
}
.topbar-icon-btn:hover { background: var(--admin-border); }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--admin-secondary), var(--admin-primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
}

/* ─── CONTENT ─── */
.admin-content { padding: 28px 24px; flex: 1; }

.admin-section { display: none; }
.admin-section.active { display: block; }

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.content-header h2 { font-size: 22px; font-weight: 700; }
.content-header span { color: var(--admin-muted); font-size: 13px; }

/* ─── KPI CARDS ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}
.kpi-small { grid-template-columns: repeat(4, 1fr); }
.kpi-card {
  background: var(--admin-card-bg);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--admin-border);
  transition: box-shadow .2s;
}
.kpi-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.kpi-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.kpi-icon.blue   { background: rgba(1,85,181,.1);  color: #0155B5; }
.kpi-icon.green  { background: rgba(22,163,74,.1);  color: #16a34a; }
.kpi-icon.orange { background: rgba(234,88,12,.1);  color: #ea580c; }
.kpi-icon.red    { background: rgba(220,38,38,.1);  color: #dc2626; }
.kpi-body { display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: 12px; color: var(--admin-muted); }
.kpi-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.kpi-change { font-size: 12px; }
.kpi-change.up      { color: #16a34a; }
.kpi-change.down    { color: #dc2626; }
.kpi-change.neutral { color: var(--admin-muted); }

/* ─── ADMIN CARD ─── */
.admin-card {
  background: var(--admin-card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--admin-border);
  overflow: hidden;
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
  gap: 12px;
  flex-wrap: wrap;
}
.admin-card-header h5 { font-size: 15px; font-weight: 700; margin: 0; }

/* ─── TABLES ─── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  background: #F8FAFC;
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
  color: var(--admin-text);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #F8FAFC; }

/* STATUS BADGES */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
}
.status-badge::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; flex-shrink:0; }
.s-pendiente  { background: #fef3c7; color: #92400e; }
.s-revision   { background: #dbeafe; color: #1e40af; }
.s-cotizado   { background: #d1fae5; color: #065f46; }
.s-cerrado    { background: #f3f4f6; color: #374151; }
.s-urgente    { background: #fee2e2; color: #991b1b; }
.s-stock-ok   { background: #d1fae5; color: #065f46; }
.s-stock-low  { background: #fef3c7; color: #92400e; }
.s-stock-out  { background: #fee2e2; color: #991b1b; }
.s-facturado  { background: #ede9fe; color: #5b21b6; }

/* ─── CONFIG ─── */
.cfg-tabs { border-bottom: 2px solid var(--admin-border); gap: 4px; }
.cfg-tabs .nav-link {
  font-family: var(--font);
  font-weight: 600;
  font-size: 13px;
  color: var(--admin-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  margin-bottom: -2px;
  transition: color .15s;
}
.cfg-tabs .nav-link.active { color: var(--admin-primary); border-bottom-color: var(--admin-primary); background: none; }
.cfg-tabs .nav-link:hover  { color: var(--admin-primary); }

.cfg-tab-content { padding-top: 24px; }
.cfg-section-body { padding: 24px; }
.cfg-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--admin-text); }

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.color-picker-item { display: flex; flex-direction: column; gap: 6px; }
.color-picker-item label { font-weight: 600; font-size: 13px; }
.color-picker-item small { font-size: 12px; color: var(--admin-muted); }
.color-pick-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 6px 10px;
  background: #fff;
}
.color-pick-wrap input[type=color] {
  width: 36px; height: 36px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
}
.color-pick-wrap input[type=text] {
  flex: 1;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  background: none;
  color: var(--admin-text);
}

.color-preview-section { margin-top: 28px; }
.color-preview-section h6 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--admin-muted); margin-bottom: 10px; }
.color-preview-bar {
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  height: 52px;
}
.cpb-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: background .3s;
}

.font-preview {
  background: var(--admin-bg);
  border-radius: var(--radius);
  padding: 24px;
  border: 1.5px dashed var(--admin-border);
}
.fp-heading { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.fp-body    { font-size: 15px; color: var(--admin-muted); }

/* ─── CHATBOT ANSWERS ─── */
.chatbot-answer-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.chatbot-answer-row input { flex: 1; }
.chatbot-answer-row button { flex-shrink: 0; }

/* ─── SOCIAL POST PREVIEW ─── */
.social-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.social-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--admin-border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: border-color .15s, background .15s;
}
.social-check input { display: none; }
.social-check:has(input:checked) { border-color: var(--admin-primary); background: rgba(1,85,181,.06); }

.post-preview {
  padding: 20px;
  background: #F0F2F5;
  border-radius: var(--radius);
  min-height: 200px;
}
.pp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.pp-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--admin-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
}
.pp-header strong { display: block; font-size: 14px; }
.pp-header small  { font-size: 12px; color: var(--admin-muted); }
.post-preview p { font-size: 14px; line-height: 1.6; color: var(--admin-text); }
.pp-img img { width: 100%; border-radius: 8px; margin-top: 10px; }

/* ─── COT TOTALS ─── */
.cot-totals {
  background: var(--admin-bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--admin-border);
}
.cot-total-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.cot-grand {
  border-top: 2px solid var(--admin-border);
  margin-top: 4px;
  padding-top: 10px;
  font-size: 16px;
}
.cot-grand strong { color: var(--admin-primary); }

/* ─── TICKET CARD ─── */
.ticket-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.ticket-card:hover { background: var(--admin-bg); }
.ticket-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.ticket-icon.urgente  { background: #fee2e2; color: #dc2626; }
.ticket-icon.normal   { background: #dbeafe; color: #1e40af; }
.ticket-body { flex: 1; min-width: 0; }
.ticket-body strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-body small   { color: var(--admin-muted); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-content { padding: 16px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--admin-border); border-radius: 4px; }

/* ─── FORM CONTROLS ─── */
.form-control, .form-select {
  font-family: var(--font);
  font-size: 13px;
  border-radius: var(--radius);
  border: 1.5px solid var(--admin-border);
  padding: 9px 12px;
  color: var(--admin-text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(1,85,181,.1);
  outline: none;
}

/* ─── BG utility ─── */
.bg-admin-primary { background: var(--admin-secondary); }
/* ═══════════════════════════════════════
   INVENTARIO / PRODUCTOS PRO
═══════════════════════════════════════ */

.admin-table{

    width:100%;

    table-layout:auto;
}

#invTable td,
#prodTable td{

    vertical-align:middle;

    padding-top:12px;
    padding-bottom:12px;
}

/* PRODUCTO */

.product-cell{

    display:flex;

    align-items:center;

    gap:12px;

    min-width:240px;

    max-width:320px;
}

/* THUMB */

.inv-thumb{

    width:58px !important;
    height:58px !important;

    min-width:58px;
    max-width:58px;

    min-height:58px;
    max-height:58px;

    border-radius:10px;

    object-fit:cover;

    border:1px solid #e2e8f0;

    background:#fff;

    padding:3px;

    display:block;

    flex-shrink:0;

    transition:.2s ease;

    cursor:pointer;
}

.inv-thumb:hover{

    transform:scale(1.04);

    box-shadow:
        0 8px 18px rgba(0,0,0,.08);
}

/* INFO */

.product-info{

    display:flex;

    flex-direction:column;

    justify-content:center;

    min-width:0;
}

.product-info strong{

    font-size:14px;

    line-height:1.3;

    font-weight:700;

    color:#0f172a;

    overflow:hidden;

    text-overflow:ellipsis;

    display:-webkit-box;

    -webkit-line-clamp:2;

    -webkit-box-orient:vertical;
}

.product-info .small{

    margin-top:3px;

    font-size:11px;

    color:#94a3b8;
}

/* PRECIOS */

.price-block{

    min-width:165px;
}

.price-grid{

    display:flex;

    align-items:center;

    gap:16px;
}

.price-item{

    display:flex;

    flex-direction:column;

    line-height:1.1;
}

.price-item .label{

    font-size:10px;

    text-transform:uppercase;

    letter-spacing:.5px;

    color:#94a3b8;

    margin-bottom:4px;

    font-weight:700;
}

.buy-price{

    color:#b26b00;

    font-size:14px;

    font-weight:700;
}

.sell-price{

    color:#0f172a;

    font-size:16px;

    font-weight:800;
}

/* BADGES */

.status-badge{

    padding:6px 12px;

    font-size:11px;

    font-weight:700;
}

/* BOTONES */

#invTable .btn,
#prodTable .btn{

    width:32px;
    height:32px;

    padding:0;

    display:flex;

    align-items:center;

    justify-content:center;

    border-radius:9px;
}

/* PREVIEW MODAL */

.product-preview{

    width:120px;
    height:120px;

    border:1px solid #e2e8f0;

    border-radius:14px;

    overflow:hidden;

    background:#f8fafc;

    display:flex;

    align-items:center;

    justify-content:center;
}

.product-preview img{

    width:100%;
    height:100%;

    object-fit:cover;
}





