/* ============================================
   NEWTIME — Admin Panel CSS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

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

:root {
  --bg:        #0d0d0d;
  --sidebar:   #111111;
  --card:      #161616;
  --border:    #222222;
  --gold:      #c9a84c;
  --gold-dim:  rgba(201,168,76,0.12);
  --white:     #f0f0ec;
  --grey:      #777770;
  --grey-lt:   #aaaaaa;
  --danger:    #e05252;
  --success:   #52c07a;
  --font:      'Outfit', system-ui, sans-serif;
  --radius:    4px;
  --trans:     0.25s ease;
}

html, body { height: 100%; }
body { background: var(--bg); color: var(--white); font-family: var(--font); font-size: 14px; line-height: 1.6; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- Layout ---- */
.admin-wrap { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-name {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.02em;
}
.sidebar-logo .logo-sub {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.sidebar-logo .logo-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.25);
  padding: 2px 8px;
  border-radius: 2px;
}

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.sidebar-section {
  padding: 8px 16px 4px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey);
  margin-top: 8px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 0.85rem;
  color: var(--grey-lt);
  transition: var(--trans);
  border-left: 2px solid transparent;
}
.sidebar-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-nav a:hover { color: var(--white); background: rgba(255,255,255,0.04); }
.sidebar-nav a.active { color: var(--gold); border-left-color: var(--gold); background: var(--gold-dim); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--grey);
  transition: color var(--trans);
}
.sidebar-footer a:hover { color: var(--danger); }

/* ---- Main Content ---- */
.admin-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-topbar h1 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user {
  font-size: 0.78rem;
  color: var(--grey-lt);
}

.admin-content { padding: 32px; flex: 1; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ---- Stats ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.stat-card .stat-val {
  font-size: 2rem;
  font-weight: 300;
  color: var(--white);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card .stat-lbl {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-lt);
  margin-bottom: 7px;
}
.form-control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 10px 14px;
  transition: border-color var(--trans);
  outline: none;
}
.form-control:focus { border-color: var(--gold); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 0.72rem; color: var(--grey); margin-top: 5px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  transition: var(--trans);
  outline: none;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover { background: #d4b96a; }
.btn-outline { background: transparent; color: var(--white); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--grey-lt); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(224,82,82,0.3); }
.btn-danger:hover { background: rgba(224,82,82,0.1); }
.btn-sm { padding: 6px 14px; font-size: 0.75rem; }
.btn-icon { padding: 7px; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--trans); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody td { padding: 12px 14px; font-size: 0.85rem; color: var(--grey-lt); vertical-align: middle; }
tbody td:first-child { color: var(--white); }

/* ---- Badge ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-green { background: rgba(82,192,122,0.15); color: var(--success); }
.badge-red { background: rgba(224,82,82,0.15); color: var(--danger); }

/* ---- Alerts ---- */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: rgba(82,192,122,0.12); border: 1px solid rgba(82,192,122,0.25); color: var(--success); }
.alert-error { background: rgba(224,82,82,0.12); border: 1px solid rgba(224,82,82,0.25); color: var(--danger); }

/* ---- Gallery Grid ---- */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.gallery-admin-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.gallery-admin-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.gallery-admin-item .item-info {
  padding: 10px 12px;
}
.gallery-admin-item .item-title {
  font-size: 0.82rem;
  color: var(--white);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-admin-item .item-actions {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
}
.gallery-admin-item .item-badge {
  position: absolute;
  top: 8px; right: 8px;
}

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--gold);
  background: var(--gold-dim);
}
.upload-zone p { color: var(--grey); font-size: 0.85rem; margin-top: 8px; }
.upload-zone .upload-icon { color: var(--gold); margin: 0 auto 12px; }

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-box {
  width: 100%;
  max-width: 380px;
  padding: 48px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.login-box .login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-box .login-logo .logo-name {
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--white);
  display: block;
}
.login-box .login-logo .logo-sub {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.login-box h2 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--grey-lt);
  text-align: center;
}

/* ---- Drag handle ---- */
.drag-handle {
  cursor: grab;
  color: var(--grey);
  padding: 0 8px;
}
.drag-handle:active { cursor: grabbing; }

/* ---- Toggle switch ---- */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--trans);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; bottom: 3px;
  background: var(--grey);
  border-radius: 50%;
  transition: var(--trans);
}
.toggle input:checked + .toggle-slider { background: var(--gold-dim); border: 1px solid var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); background: var(--gold); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .sidebar { transform: translateX(-100%); transition: transform var(--trans); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}
