/* ============================================================
   DriftNation Admin — Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow+Condensed:wght@400;600;700&family=Barlow:wght@300;400;500&display=swap');

:root {
  --fire:    #FF3A1A;
  --ember:   #FF7A00;
  --gold:    #FFB800;
  --green:   #00D264;
  --blue:    #4DB8FF;
  --purple:  #C080FF;

  --bg:      #0A0A0B;
  --s1:      #111114;
  --s2:      #18181D;
  --s3:      #1F1F26;
  --s4:      #26262E;

  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);

  --text:    #F0F0F0;
  --muted:   #888;
  --dim:     #555;

  --sidebar-w: 240px;
  --topbar-h:  60px;

  --radius:  8px;
  --radius-lg: 12px;
  --shadow:  0 4px 24px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { background: var(--bg); color: var(--text); font-family: 'Barlow', sans-serif; min-height: 100vh; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 2px; }

a { color: var(--fire); text-decoration: none; }
a:hover { color: #FF5535; }

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

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--s1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50; overflow-y: auto;
  transition: transform .3s;
}

.sidebar__brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar__logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 3px; color: var(--text);
  line-height: 1;
}
.sidebar__logo span { color: var(--fire); }
.sidebar__version { font-size: 10px; color: var(--dim); letter-spacing: 1px; }

.sidebar__section {
  padding: 20px 12px 8px;
}
.sidebar__label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--dim);
  padding: 0 8px; margin-bottom: 6px;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 6px;
  color: var(--muted); font-size: 13px; font-weight: 500;
  transition: all .18s; cursor: pointer; position: relative;
}
.nav-item:hover { color: var(--text); background: var(--s2); }
.nav-item.active { color: var(--fire); background: rgba(255,58,26,0.1); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--fire); border-radius: 0 2px 2px 0;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-item .badge-count {
  margin-left: auto;
  background: var(--fire); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 20px; text-align: center;
}

.sidebar__footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.admin-card {
  background: var(--s2); border-radius: 8px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.admin-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--fire), var(--ember));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.admin-info { flex: 1; min-width: 0; }
.admin-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-role { font-size: 10px; color: var(--dim); }
.admin-logout { color: var(--dim); font-size: 13px; transition: color .2s; }
.admin-logout:hover { color: var(--fire); }

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

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 40;
}
.topbar__left { display: flex; flex-direction: column; }
.topbar__title { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.topbar__breadcrumb { font-size: 11px; color: var(--dim); }
.topbar__breadcrumb span { color: var(--muted); }

.topbar__right { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; border-radius: var(--radius);
  padding: 8px 18px; cursor: pointer; border: none;
  transition: all .18s; text-decoration: none; white-space: nowrap;
}
.btn-primary   { background: var(--fire); color: #fff; }
.btn-primary:hover  { background: #FF5535; color: #fff; transform: translateY(-1px); }
.btn-secondary { background: var(--s3); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--s4); border-color: rgba(255,255,255,0.2); color: var(--text); }
.btn-danger    { background: rgba(255,58,26,0.15); color: var(--fire); border: 1px solid rgba(255,58,26,0.3); }
.btn-danger:hover { background: rgba(255,58,26,0.25); color: var(--fire); }
.btn-ghost     { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover  { color: var(--text); border-color: var(--border2); }
.btn-sm { padding: 5px 12px; font-size: 11px; }
.btn-icon { padding: 8px 10px; }

/* ── Content ── */
.content { padding: 28px; flex: 1; }

/* ── Flash ── */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 20px; font-size: 13px;
}
.flash--success { background: rgba(0,210,100,0.1); color: var(--green); border: 1px solid rgba(0,210,100,0.25); }
.flash--error   { background: rgba(255,58,26,0.1); color: var(--fire); border: 1px solid rgba(255,58,26,0.25); }
.flash--warning { background: rgba(255,184,0,0.1); color: var(--gold); border: 1px solid rgba(255,184,0,0.25); }
.flash--info    { background: rgba(77,184,255,0.1); color: var(--blue); border: 1px solid rgba(77,184,255,0.25); }

/* ── Cards de estatísticas ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }

.stat-card {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px;
  display: flex; align-items: flex-start; justify-content: space-between;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-card__body {}
.stat-card__label { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.stat-card__value { font-family: 'Bebas Neue', sans-serif; font-size: 40px; line-height: 1; color: var(--text); }
.stat-card__delta { font-size: 11px; color: var(--green); margin-top: 4px; }
.stat-card__icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}

/* ── Tabelas ── */
.card {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card__header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card__title { font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.card__body { padding: 20px; }

.table-wrap { overflow-x: auto; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--dim); text-align: left;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--s2); white-space: nowrap;
}
table.tbl td {
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px; vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .15s; }
table.tbl tbody tr:hover td { background: var(--s2); }

.tbl__photo img, .tbl__photo .avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  background: var(--s3); display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.tbl__pilot-name { font-weight: 600; font-size: 14px; }
.tbl__pilot-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tbl__actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 4px; border: 1px solid transparent;
  white-space: nowrap;
}
.badge-active   { background: rgba(0,210,100,0.1); color: var(--green); border-color: rgba(0,210,100,0.25); }
.badge-inactive { background: rgba(136,136,136,0.1); color: var(--muted); border-color: rgba(136,136,136,0.2); }
.badge-highlight { background: rgba(255,184,0,0.1); color: var(--gold); border-color: rgba(255,184,0,0.25); }

/* ── Search / Filters ── */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.search-box {
  position: relative; flex: 1; min-width: 200px;
}
.search-box i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--dim); font-size: 13px;
}
.search-box input {
  width: 100%; padding: 9px 12px 9px 36px;
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 13px;
  transition: border-color .2s; font-family: 'Barlow', sans-serif;
}
.search-box input:focus { outline: none; border-color: rgba(255,58,26,0.5); }

.select-filter {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 13px;
  padding: 9px 12px; cursor: pointer; font-family: 'Barlow', sans-serif;
  transition: border-color .2s;
}
.select-filter:focus { outline: none; border-color: rgba(255,58,26,0.5); }

/* ── Formulários ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px 24px; }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted);
}
.form-label .required { color: var(--fire); margin-left: 2px; }

.form-control {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  padding: 10px 14px; font-size: 13px; font-family: 'Barlow', sans-serif;
  transition: border-color .2s, background .2s;
  width: 100%;
}
.form-control:focus { outline: none; border-color: rgba(255,58,26,0.6); background: var(--s3); }
.form-control::placeholder { color: var(--dim); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint { font-size: 11px; color: var(--dim); }
.form-error { font-size: 11px; color: var(--fire); }

.form-control.has-error { border-color: rgba(255,58,26,0.6); }

/* Switch */
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.switch-label { font-size: 13px; }
.switch-desc { font-size: 11px; color: var(--dim); }
.switch {
  position: relative; width: 40px; height: 22px; flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute; inset: 0; background: var(--s4);
  border-radius: 11px; cursor: pointer; transition: background .2s;
}
.switch__slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--dim); left: 3px; top: 3px; transition: all .2s;
}
.switch input:checked + .switch__slider { background: rgba(255,58,26,0.3); }
.switch input:checked + .switch__slider::before { background: var(--fire); transform: translateX(18px); }

/* Upload foto */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 32px 20px; text-align: center;
  cursor: pointer; transition: all .2s; position: relative;
}
.upload-zone:hover { border-color: rgba(255,58,26,0.5); background: rgba(255,58,26,0.03); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone__icon { font-size: 32px; color: var(--dim); margin-bottom: 10px; }
.upload-zone__text { font-size: 13px; color: var(--muted); }
.upload-zone__sub  { font-size: 11px; color: var(--dim); margin-top: 4px; }

.photo-preview {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--border2);
  display: block; margin: 0 auto 12px;
}

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: .5px;
  padding: 10px 18px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .18s;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--fire); border-bottom-color: var(--fire); }

/* Pager */
.pager { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pager__btn {
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--s2); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; transition: all .18s;
}
.pager__btn:hover { background: var(--s3); color: var(--text); border-color: var(--border2); }
.pager__btn--active { background: var(--fire); color: #fff; border-color: var(--fire); }

/* Empty state */
.empty-state {
  padding: 60px 20px; text-align: center;
}
.empty-state i { font-size: 40px; color: var(--dim); margin-bottom: 16px; display: block; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }

/* Modal confirm */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px); z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--s2); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 28px;
  max-width: 400px; width: 90%;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal__icon { font-size: 36px; margin-bottom: 14px; }
.modal__title { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal__body  { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.modal__foot  { display: flex; gap: 10px; justify-content: flex-end; }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}

/* Scrollbar do sidebar */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--s4); }

/* Dashboard activity */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 5px; flex-shrink: 0;
}
.activity-text { font-size: 13px; line-height: 1.4; }
.activity-time { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* Chart bars */
.mini-chart { display: flex; align-items: flex-end; gap: 6px; height: 60px; }
.mini-bar {
  flex: 1; background: rgba(255,58,26,0.25);
  border-radius: 3px 3px 0 0; transition: background .2s; cursor: default;
  min-height: 4px;
}
.mini-bar:hover { background: rgba(255,58,26,0.5); }
