/* assets/css/admin.css */

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #0f2347;
  --sidebar-text: rgba(255,255,255,.75);
  --sidebar-active: rgba(255,255,255,.12);
  --topbar-h: 60px;
}

.admin-body { display: flex; min-height: 100vh; background: var(--bg); }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform .3s;
}

.sidebar-logo {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}

.sidebar-logo .logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -.3px;
}
.sidebar-logo .logo-text span { color: var(--accent); }

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .2s;
}
.sidebar-nav a:hover { color: #fff; background: var(--sidebar-active); }
.sidebar-nav a.active { color: #fff; background: var(--sidebar-active); border-left-color: var(--accent); }
.sidebar-nav a .mi { font-size: 1.1rem; }

.sidebar-section {
  padding: .5rem 1.25rem .25rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.35);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-card {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  flex-shrink: 0;
}

.user-info .name { color: #fff; font-size: .85rem; font-weight: 600; }
.user-info .role { color: rgba(255,255,255,.5); font-size: .72rem; }

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

.admin-topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-title { font-weight: 700; font-size: 1.05rem; flex: 1; color: var(--primary-dark); }
.topbar-actions { display: flex; gap: .5rem; }

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text);
  cursor: pointer;
  padding: .4rem;
}

.admin-content { flex: 1; padding: 1.5rem; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.card-title { font-weight: 700; font-size: 1rem; color: var(--primary-dark); }
.card-body { padding: 1.25rem; }

/* ── TABLES ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg); }
thead th { padding: .75rem 1rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); text-align: left; }
tbody td { padding: .85rem 1rem; font-size: .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-primary  { background: #dbeafe; color: #1e40af; }
.badge-gray     { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── FORMS ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.form-label .req { color: var(--danger); }

.form-control {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(36,81,160,.1);
}

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; -webkit-appearance: none; }

.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

.form-row { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 600px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ── UPLOAD ───────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--bg);
}
.upload-area:hover { border-color: var(--primary-light); background: #f0f5ff; }
.upload-area .upload-icon { font-size: 2rem; color: var(--text-muted); margin-bottom: .5rem; }
.upload-area p { font-size: .85rem; color: var(--text-muted); }
.upload-area input { display: none; }

/* ── LOGIN ────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 1rem;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .icon-wrap {
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .75rem;
  font-size: 1.6rem;
  color: #fff;
}

.login-logo h1 { font-size: 1.4rem; font-weight: 800; color: var(--primary-dark); }
.login-logo h1 span { color: var(--accent); }
.login-logo p { color: var(--text-muted); font-size: .88rem; margin-top: .25rem; }

/* ── PROGRESS BAR ─────────────────────────────────────────── */
.progress { background: var(--bg); border-radius: 20px; height: 6px; overflow: hidden; margin-top: .4rem; }
.progress-bar { height: 100%; border-radius: 20px; background: var(--success); transition: width .3s; }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }

/* ── RESPONSIVE SIDEBAR ───────────────────────────────────── */
@media (max-width: 899px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199; }
  .sidebar-overlay.open { display: block; }
}
