:root {
  --bg:       #0F1117;
  --surface:  #1A1D27;
  --surface2: #22263A;
  --border:   rgba(255,255,255,0.08);
  --rojo:     #C41230;
  --verde:    #10B981;
  --amarillo: #F59E0B;
  --text:     #E8E8EA;
  --muted:    #6B7280;
  --sidebar-w: 240px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Inter, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

/* LOGIN */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 40px; width: 100%; max-width: 380px; }
.login-logo { display: flex; flex-direction: column; margin-bottom: 24px; }
.logo-name { font-weight: 700; font-size: 22px; letter-spacing: .14em; color: #fff; }
.logo-sub { font-size: 9px; letter-spacing: .28em; color: var(--rojo); font-weight: 500; }
.login-title { font-size: 18px; font-weight: 600; margin-bottom: 24px; }

/* LAYOUT */
#app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 10; }
.sidebar-logo { padding: 24px 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--muted); cursor: pointer; transition: all .2s; margin-bottom: 2px; font-size: 13.5px; }
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: rgba(196,18,48,0.12); color: #fff; border-left: 2px solid var(--rojo); padding-left: 10px; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.sidebar-link { font-size: 12px; color: var(--muted); transition: color .2s; }
.sidebar-link:hover { color: var(--text); }
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar h2 { font-size: 16px; font-weight: 600; }
.admin-name { font-size: 13px; color: var(--muted); }
.view-container { padding: 24px; flex: 1; }

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.stat-card-label { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: #fff; line-height: 1; }
.stat-card-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat-card.danger .stat-card-value { color: var(--rojo); }
.stat-card.success .stat-card-value { color: var(--verde); }
.stat-card.warning .stat-card-value { color: var(--amarillo); }

/* TABLES */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.table-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.table-header-title { font-size: 14px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 16px; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.table-empty { padding: 48px; text-align: center; color: var(--muted); }

/* BADGES / STATUS */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.badge-green  { background: rgba(16,185,129,0.12); color: var(--verde); }
.badge-red    { background: rgba(196,18,48,0.12); color: var(--rojo); }
.badge-yellow { background: rgba(245,158,11,0.12); color: var(--amarillo); }
.badge-gray   { background: rgba(255,255,255,0.06); color: var(--muted); }
.badge-blue   { background: rgba(59,130,246,0.12); color: #60A5FA; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.form-control { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); outline: none; transition: border-color .2s; }
.form-control:focus { border-color: var(--rojo); }
.form-control::placeholder { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all .2s; white-space: nowrap; }
.btn-primary { background: var(--rojo); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-danger { background: rgba(196,18,48,0.12); color: var(--rojo); border: 1px solid rgba(196,18,48,0.2); }
.btn-danger:hover { background: rgba(196,18,48,0.2); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 6px; justify-content: center; }

/* SEARCH / FILTER BAR */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.search-input { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; color: var(--text); outline: none; min-width: 200px; }
.search-input:focus { border-color: var(--rojo); }
select.filter-select { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; color: var(--text); outline: none; cursor: pointer; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 640px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; }
.alert-error { background: rgba(196,18,48,0.1); border: 1px solid rgba(196,18,48,0.25); color: #F87171; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #34D399; }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); color: #60A5FA; }

/* TOAST */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 20px; font-size: 13px; z-index: 100; box-shadow: 0 8px 32px rgba(0,0,0,0.4); max-width: 320px; }
.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.error { border-color: rgba(196,18,48,0.3); }

/* PAGINATION */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); }
.pagination-info { font-size: 12px; color: var(--muted); }
.pagination-btns { display: flex; gap: 6px; }

/* IMPORT */
.drop-zone { position: relative; border: 2px dashed var(--border); border-radius: 12px; padding: 48px; text-align: center; cursor: pointer; transition: all .2s; }
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--rojo); background: rgba(196,18,48,0.04); }
.drop-zone-icon { font-size: 40px; margin-bottom: 12px; }
.drop-zone-text { font-size: 14px; color: var(--muted); }
.drop-zone-text strong { color: var(--text); }
.import-result { background: var(--surface2); border-radius: 10px; padding: 20px; margin-top: 20px; }
.import-stat { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.import-stat:last-child { border-bottom: none; }

/* PRODUCT IMAGE PREVIEW */
.img-preview { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); }
.img-placeholder { width: 48px; height: 48px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 10px; }

/* UPLOAD ZONE */
.upload-btn-wrap { position: relative; overflow: hidden; display: inline-block; }
.upload-btn-wrap input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.product-images-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.product-img-thumb { position: relative; }
.product-img-thumb img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.remove-img { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; background: var(--rojo); border-radius: 50%; border: none; color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* SETTINGS */
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.settings-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* DASHBOARD RECENT */
.recent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.recent-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.recent-card h3 { font-size: 13px; font-weight: 600; margin-bottom: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.recent-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 12.5px; }
.recent-item:last-child { border-bottom: none; }
.recent-item-name { color: var(--text); }
.recent-item-meta { color: var(--muted); font-size: 11px; }
