/* ══════════════════════════════════════════════
   TN PROJECT — Admin Panel CSS
   Dark Professional Theme
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg:         #0D1117;
  --surface:    #161B22;
  --card:       #1C2333;
  --border:     rgba(48, 54, 61, 0.8);
  --border-hover: rgba(0, 212, 200, 0.4);

  --accent:     #00D4C8;
  --accent-2:   #0099FF;
  --accent-grad: linear-gradient(135deg, #00D4C8, #0099FF);

  --text:       #E6EDF3;
  --text-2:     #8B949E;
  --text-muted: #484F58;

  --danger:     #F85149;
  --success:    #3FB950;
  --warning:    #D29922;

  --shadow:     0 8px 32px rgba(0,0,0,0.5);
  --radius:     10px;
  --radius-lg:  16px;

  --font-head:  'Outfit', sans-serif;
  --font-body:  'Inter', sans-serif;
  --sidebar-w:  240px;
  --transition: all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; }

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

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand img { height: 30px; width: auto; filter: drop-shadow(0 0 6px rgba(0,212,200,0.3)); }
.sidebar-brand-text { font-family: var(--font-head); font-size: 0.95rem; font-weight: 800; background: var(--accent-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-brand-sub { font-size: 0.65rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }

.sidebar-nav { padding: 12px 0; flex: 1; overflow-y: auto; }
.nav-section-label { padding: 12px 20px 6px; font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  transition: var(--transition);
  border-left: 2px solid transparent;
  margin: 1px 0;
}
.sidebar-link:hover { color: var(--text); background: rgba(0,212,200,0.06); }
.sidebar-link.active { color: var(--accent); background: rgba(0,212,200,0.08); border-left-color: var(--accent); font-weight: 600; }
.sidebar-link i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }
.sidebar-link .badge { margin-left: auto; background: var(--accent); color: #000; font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sidebar-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-grad); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; color: #000; flex-shrink: 0; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 600; }
.sidebar-user-role { font-size: 0.7rem; color: var(--text-muted); }
.btn-logout { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.8rem; color: var(--text-2); transition: var(--transition); }
.btn-logout:hover { border-color: var(--danger); color: var(--danger); background: rgba(248,81,73,0.06); }

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

.topbar {
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-badge { font-size: 0.72rem; font-weight: 600; padding: 4px 12px; border-radius: 99px; background: rgba(63,185,80,0.12); color: var(--success); border: 1px solid rgba(63,185,80,0.3); }

.content { padding: 28px; flex: 1; }

/* ─── CARDS ─── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-family: var(--font-head); font-size: 0.95rem; font-weight: 700; }
.card-body { padding: 22px; }

/* ─── STATS GRID ─── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; align-items: center; gap: 14px; transition: var(--transition); }
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { width: 46px; height: 46px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-icon-teal { background: rgba(0,212,200,0.1); color: var(--accent); }
.stat-icon-blue { background: rgba(0,153,255,0.1); color: var(--accent-2); }
.stat-icon-green { background: rgba(63,185,80,0.1); color: var(--success); }
.stat-icon-orange { background: rgba(210,153,34,0.1); color: var(--warning); }
.stat-num { font-family: var(--font-head); font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.78rem; color: var(--text-2); font-weight: 500; }

/* ─── BUTTONS ─── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius); font-size: 0.845rem; font-weight: 600; transition: var(--transition); cursor: pointer; font-family: var(--font-body); }
.btn-primary { background: var(--accent-grad); color: #000; border: none; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,212,200,0.3); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; border: 1px solid rgba(248,81,73,0.3); color: var(--danger); }
.btn-danger:hover { background: rgba(248,81,73,0.1); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }

/* ─── TABLE ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 11px 14px; text-align: left; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 13px 14px; font-size: 0.855rem; border-bottom: 1px solid rgba(48,54,61,0.5); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(0,212,200,0.03); }

/* ─── BADGES ─── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 0.7rem; font-weight: 700; }
.badge-web     { background: rgba(0,212,200,0.12); color: var(--accent); }
.badge-android { background: rgba(0,153,255,0.12); color: var(--accent-2); }
.badge-active  { background: rgba(63,185,80,0.12); color: var(--success); }
.badge-inactive{ background: rgba(136,136,136,0.12); color: var(--text-muted); }

/* ─── FORMS ─── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 0.78rem; font-weight: 600; color: var(--text-2); }
.form-input, .form-select, .form-textarea {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.855rem;
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,200,0.1);
}
.form-select option { background: var(--card); }
.form-textarea { resize: vertical; min-height: 110px; }
.form-hint { font-size: 0.72rem; color: var(--text-muted); }

/* ─── TOGGLE ─── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 99px; transition: var(--transition); cursor: pointer; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: var(--transition); }
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: 0.845rem; font-weight: 500; }

/* ─── FILE UPLOAD ─── */
.file-upload { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; transition: var(--transition); }
.file-upload:hover { border-color: var(--accent); background: rgba(0,212,200,0.04); }
.file-upload i { font-size: 1.5rem; color: var(--text-muted); margin-bottom: 8px; }
.file-upload p { font-size: 0.82rem; color: var(--text-2); }
.file-upload input[type="file"] { display: none; }
.preview-img { width: 80px; height: 80px; border-radius: var(--radius); object-fit: cover; border: 2px solid var(--border); margin: 8px auto 0; }

/* ─── ALERTS ─── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 0.845rem; margin-bottom: 18px; border: 1px solid; display: flex; align-items: center; gap: 8px; }
.alert-success { background: rgba(63,185,80,0.08); border-color: rgba(63,185,80,0.3); color: var(--success); }
.alert-error   { background: rgba(248,81,73,0.08); border-color: rgba(248,81,73,0.3); color: var(--danger); }

/* ─── PAGINATION ─── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; }
.pagination-info { font-size: 0.78rem; color: var(--text-2); }
.pagination-links { display: flex; gap: 4px; }
.pagination-links a, .pagination-links span { padding: 5px 10px; border-radius: 6px; font-size: 0.78rem; border: 1px solid var(--border); color: var(--text-2); transition: var(--transition); }
.pagination-links a:hover { border-color: var(--accent); color: var(--accent); }
.pagination-links .active-page { background: var(--accent-grad); color: #000; border-color: transparent; font-weight: 700; }

/* ─── EMPTY STATE ─── */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state i { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 12px; }
.empty-state p { color: var(--text-2); font-size: 0.9rem; margin-bottom: 16px; }

/* ─── AUTH ─── */
.auth-wrap { width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.auth-card { background: rgba(28, 35, 51, 0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo img { height: 50px; margin: 0 auto 10px; }
.auth-title { font-family: var(--font-head); font-size: 1.2rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-sub { font-size: 0.82rem; color: var(--text-2); text-align: center; margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
}
