/* ============================================================
   HADS LIVE — Admin Panel CSS
   ============================================================ */

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:         #000000;
  --bg2:        #0f0f0f;
  --bg3:        #111111;
  --bg4:        #1a1a1a;
  --red:        #e50914;
  --red-bright: #ff1a24;
  --green:      #22c55e;
  --white:      #ffffff;
  --gray:       #888888;
  --gray-light: #cccccc;
  --border:     rgba(255,255,255,0.07);
  --font-main:  'Arial', sans-serif;
  --radius:     6px;
  --radius-lg:  10px;
}

html { font-size: 16px; }

body {
  background:  var(--bg);
  color:       var(--white);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height:  100vh;
}

a { color: var(--gray-light); text-decoration: none; }
a:hover { color: var(--red); }
ul { list-style: none; }

/* ── LOGIN PAGE ─────────────────────────────────────────────── */
.login-page {
  display:         flex;
  align-items:     center;
  justify-content: center;
  min-height:      100vh;
  background:      var(--bg);
}

.login-wrap {
  width:    100%;
  padding:  1rem;
  display:  flex;
  justify-content: center;
}

.login-box {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       2.5rem 2rem;
  width:         100%;
  max-width:     420px;
}

.login-logo {
  font-family: 'Arial Black', sans-serif;
  font-size:   2rem;
  font-weight: 900;
  color:       var(--white);
  text-align:  center;
  margin-bottom: 1.5rem;
}

.login-logo span { color: var(--red); }

.login-logo small {
  display:     block;
  font-size:   0.75rem;
  font-weight: 400;
  color:       var(--gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top:  4px;
}

.login-error {
  color:       var(--red);
  font-size:   0.875rem;
  margin:      0.5rem 0;
  text-align:  center;
}

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

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width:      220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display:    flex;
  flex-direction: column;
  position:   fixed;
  top:        0;
  left:       0;
  height:     100vh;
  z-index:    100;
}

.sidebar__logo {
  padding:     1.25rem 1rem;
  font-family: 'Arial Black', sans-serif;
  font-size:   1.3rem;
  font-weight: 900;
  color:       var(--white);
  border-bottom: 1px solid var(--border);
}

.sidebar__logo span { color: var(--red); }

.sidebar__logo small {
  display:    block;
  font-size:  0.65rem;
  color:      var(--gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar__nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar__nav a {
  display:      flex;
  align-items:  center;
  gap:          10px;
  padding:      0.65rem 1rem;
  color:        var(--gray);
  font-size:    0.875rem;
  font-weight:  600;
  transition:   color 0.2s, background 0.2s;
  border-left:  3px solid transparent;
}

.sidebar__nav a:hover {
  color:       var(--white);
  background:  var(--bg3);
}

.sidebar__nav a.active {
  color:       var(--white);
  background:  var(--bg3);
  border-left: 3px solid var(--red);
}

.sidebar__nav a svg {
  width:    18px;
  height:   18px;
  flex-shrink: 0;
}

.sidebar__footer {
  padding:       1rem;
  border-top:    1px solid var(--border);
  font-size:     0.75rem;
  color:         var(--gray);
}

.sidebar__footer a {
  color:     var(--red);
  font-size: 0.75rem;
}

/* ── MAIN CONTENT ───────────────────────────────────────────── */
.admin-main {
  margin-left: 220px;
  flex:        1;
  min-height:  100vh;
}

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  background:    var(--bg2);
  border-bottom: 1px solid var(--border);
  padding:       0 1.5rem;
  height:        56px;
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  position:      sticky;
  top:           0;
  z-index:       50;
}

.topbar__title {
  font-size:   1rem;
  font-weight: 700;
  color:       var(--white);
}

.topbar__right {
  display:     flex;
  align-items: center;
  gap:         0.75rem;
}

/* ── PAGE CONTENT ───────────────────────────────────────────── */
.page-content {
  padding: 1.5rem;
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stats-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:                   1rem;
  margin-bottom:         1.5rem;
}

.stat-card {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.25rem;
}

.stat-card__label {
  font-size:     0.75rem;
  color:         var(--gray);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-card__value {
  font-family: 'Arial Black', sans-serif;
  font-size:   1.8rem;
  font-weight: 900;
  color:       var(--white);
  line-height: 1;
}

.stat-card__value--red   { color: var(--red);   }
.stat-card__value--green { color: var(--green); }

.stat-card__sub {
  font-size:  0.75rem;
  color:      var(--gray);
  margin-top: 0.25rem;
}

/* ── FORMS ──────────────────────────────────────────────────── */
.form-label {
  display:       block;
  font-size:     0.8rem;
  color:         var(--gray);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-input {
  width:         100%;
  background:    var(--bg3);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  color:         var(--white);
  font-size:     0.9rem;
  padding:       0.6rem 0.8rem;
  outline:       none;
  transition:    border-color 0.2s;
  margin-bottom: 1rem;
}

.form-input:focus { border-color: var(--red); }

.form-select {
  background:    var(--bg3);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  color:         var(--white);
  font-size:     0.85rem;
  padding:       0.5rem 0.8rem;
  outline:       none;
  cursor:        pointer;
}

.form-select:focus { border-color: var(--red); }

.form-select option { background: #1a1a1a; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn-admin {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             6px;
  font-size:       0.85rem;
  font-weight:     700;
  letter-spacing:  0.06em;
  text-transform:  uppercase;
  padding:         0.55rem 1.1rem;
  border-radius:   var(--radius);
  border:          none;
  cursor:          pointer;
  transition:      background-color 0.2s, transform 0.15s;
  text-decoration: none;
}

.btn-admin:active { transform: scale(0.97); }

.btn-admin--primary {
  background: var(--red);
  color:      var(--white);
}

.btn-admin--primary:hover { background: var(--red-bright); color: var(--white); }

.btn-admin--outline {
  background:  transparent;
  color:       var(--gray-light);
  border:      1px solid var(--border);
}

.btn-admin--outline:hover {
  border-color: var(--red);
  color:        var(--white);
}

.btn-admin--green {
  background: var(--green);
  color:      #000;
}

.btn-full { width: 100%; }

/* ── TOOLBAR ────────────────────────────────────────────────── */
.toolbar {
  display:      flex;
  align-items:  center;
  gap:          0.75rem;
  flex-wrap:    wrap;
  margin-bottom: 1.25rem;
}

.toolbar__search {
  display:     flex;
  align-items: center;
  background:  var(--bg3);
  border:      1px solid var(--border);
  border-radius: var(--radius);
  overflow:    hidden;
  flex:        1;
  max-width:   360px;
}

.toolbar__search input {
  flex:       1;
  background: transparent;
  border:     none;
  outline:    none;
  color:      var(--white);
  font-size:  0.875rem;
  padding:    0.5rem 0.75rem;
}

.toolbar__search input::placeholder { color: var(--gray); }

/* ── MODELS GRID ADMIN ──────────────────────────────────────── */
.admin-models-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap:                   0.75rem;
}

.admin-model-card {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow:      hidden;
  transition:    border-color 0.2s, transform 0.2s;
}

.admin-model-card:hover {
  border-color: var(--red);
  transform:    translateY(-2px);
}

.admin-model-card__thumb {
  position:    relative;
  aspect-ratio: 4/3;
  background:  var(--bg4);
  overflow:    hidden;
}

.admin-model-card__thumb img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}

.admin-model-card__badge {
  position:       absolute;
  top:            6px;
  left:           6px;
  background:     var(--red);
  color:          var(--white);
  font-size:      9px;
  font-weight:    700;
  padding:        2px 6px;
  border-radius:  3px;
  letter-spacing: 0.1em;
}

.admin-model-card__viewers {
  position:   absolute;
  bottom:     6px;
  left:       6px;
  background: rgba(0,0,0,0.75);
  color:      var(--white);
  font-size:  10px;
  padding:    2px 6px;
  border-radius: 3px;
}

.admin-model-card__hd {
  position:    absolute;
  bottom:      6px;
  right:       6px;
  background:  rgba(0,0,0,0.75);
  color:       var(--red);
  font-size:   9px;
  font-weight: 700;
  padding:     2px 5px;
  border-radius: 3px;
  border:      1px solid var(--red);
}

.admin-model-card__info {
  padding: 0.5rem 0.6rem;
}

.admin-model-card__name {
  font-size:     0.8rem;
  font-weight:   700;
  color:         var(--white);
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.4rem;
}

.admin-model-card__actions {
  display: flex;
  gap:     4px;
}

.admin-model-card__actions .btn-admin {
  flex:        1;
  font-size:   0.7rem;
  padding:     0.3rem 0.4rem;
  letter-spacing: 0;
}

/* ── LOADING ────────────────────────────────────────────────── */
.admin-loading {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             0.75rem;
  padding:         3rem 0;
  color:           var(--gray);
  font-size:       0.9rem;
}

.admin-dot {
  width:         10px;
  height:        10px;
  border-radius: 50%;
  background:    var(--red);
  animation:     blink 1.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position:      fixed;
  bottom:        1.5rem;
  right:         1.5rem;
  background:    var(--green);
  color:         #000;
  font-size:     0.85rem;
  font-weight:   700;
  padding:       0.75rem 1.25rem;
  border-radius: var(--radius);
  z-index:       9999;
  animation:     toast-in 0.3s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── GANANCIA CHART ─────────────────────────────────────────── */
.chart-box {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.25rem;
  margin-bottom: 1.5rem;
}

.chart-box__title {
  font-size:     0.85rem;
  font-weight:   700;
  color:         var(--gray-light);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── TABLE ──────────────────────────────────────────────────── */
.admin-table {
  width:           100%;
  border-collapse: collapse;
  font-size:       0.85rem;
}

.admin-table th {
  text-align:    left;
  padding:       0.6rem 0.75rem;
  color:         var(--gray);
  font-size:     0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding:       0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color:         var(--gray-light);
}

.admin-table tr:hover td { background: var(--bg3); }

.badge {
  display:        inline-block;
  font-size:      0.7rem;
  font-weight:    700;
  padding:        2px 8px;
  border-radius:  3px;
  letter-spacing: 0.06em;
}

.badge--red   { background: rgba(229,9,20,0.2);  color: var(--red);   }
.badge--green { background: rgba(34,197,94,0.2); color: var(--green); }
.badge--gray  { background: var(--bg4);          color: var(--gray);  }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar      { width: 100%; height: auto; position: relative; }
  .admin-main   { margin-left: 0; }
  .admin-layout { flex-direction: column; }
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
}