/* ============================================
   PsychoEmpathy — Admin Dashboard CSS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Nunito:wght@400;600;700&display=swap');

:root {
  --sky-deep:    #1a8ec2;
  --sky-mid:     #38b6e8;
  --sky-light:   #87ceeb;
  --sky-pale:    #d6eefa;
  --sky-bg:      #edf6fb;
  --sidebar-bg:  #0d4a68;
  --sidebar-dark:#092e41;
  --white:       #ffffff;
  --text-dark:   #1a2e3a;
  --text-mid:    #3a5568;
  --text-soft:   #6b8fa3;
  --card-bg:     #f5fbff;
  --shadow-sm:   0 2px 12px rgba(56,182,232,0.12);
  --shadow-md:   0 6px 28px rgba(56,182,232,0.18);
  --radius:      14px;
  --font-display: 'Playfair Display', serif;
  --font-body:   'Nunito', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font-body); background: var(--sky-bg); color: var(--text-dark); }

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

/* ─── Sidebar ───────────────────────────────── */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--sidebar-dark) 0%, var(--sidebar-bg) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1.75rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--white);
  font-weight: 700;
}

.sidebar-brand-sub {
  font-size: 0.72rem;
  color: var(--sky-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(135,206,235,0.5);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.sidebar-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
  border-left-color: var(--sky-light);
}

.sidebar-link.active {
  color: var(--white);
  background: rgba(56,182,232,0.15);
  border-left-color: var(--sky-mid);
}

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

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

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sky-mid), var(--sky-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--white);
  font-weight: 700;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.82rem; color: var(--white); font-weight: 700; }
.sidebar-user-role { font-size: 0.72rem; color: rgba(255,255,255,0.5); }

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

.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid rgba(135,206,235,0.2);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.admin-topbar-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  flex: 1;
}

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

/* ─── Stat Cards ────────────────────────────── */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(135,206,235,0.15);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: var(--sky-pale); color: var(--sky-deep); }
.stat-icon.teal   { background: #e0f2f7; color: #0891b2; }
.stat-icon.indigo { background: #e0e7ff; color: #4f46e5; }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }

.stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-soft);
  font-weight: 600;
  margin-top: 0.15rem;
}

/* ─── Admin Cards ───────────────────────────── */
.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(135,206,235,0.2);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(135,206,235,0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
}

.admin-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.admin-card-body { padding: 1.5rem; }

/* ─── Tables ────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgba(135,206,235,0.2);
  background: var(--card-bg);
  text-align: left;
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(135,206,235,0.1);
  font-size: 0.88rem;
  color: var(--text-mid);
  vertical-align: middle;
}

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

/* ─── Form Elements ─────────────────────────── */
.admin-form .form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 0.35rem;
}

.admin-form .form-control,
.admin-form .form-select {
  border: 1.5px solid rgba(135,206,235,0.35);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  background: var(--sky-bg);
  color: var(--text-dark);
  transition: all 0.25s ease;
}

.admin-form .form-control:focus,
.admin-form .form-select:focus {
  border-color: var(--sky-mid);
  box-shadow: 0 0 0 3px rgba(56,182,232,0.12);
  background: var(--white);
  outline: none;
}

/* ─── Buttons ───────────────────────────────── */
.btn-admin-primary {
  background: linear-gradient(135deg, var(--sky-deep), var(--sky-mid));
  color: var(--white);
  border: none;
  padding: 0.55rem 1.4rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-admin-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56,182,232,0.4);
  color: var(--white);
}

.btn-admin-danger {
  background: transparent;
  color: #ef4444;
  border: 1.5px solid #fca5a5;
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-admin-danger:hover {
  background: #ef4444;
  color: var(--white);
  border-color: #ef4444;
}

/* ─── Badges ────────────────────────────────── */
.badge-sky {
  background: var(--sky-pale);
  color: var(--sky-deep);
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-green {
  background: #dcfce7;
  color: #16a34a;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-orange {
  background: #fff7ed;
  color: #ea580c;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ─── Login Page ────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0a3a52 0%, #1a8ec2 60%, #87ceeb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--white);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}

.login-logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--sky-deep), var(--sky-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 0.25rem;
}

/* ─── Flash ─────────────────────────────────── */
.flash-container {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 9999;
  max-width: 340px;
}

.flash-msg {
  background: var(--white);
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--sky-mid);
  font-size: 0.87rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  animation: slideIn 0.35s ease both;
}
.flash-msg.success { border-color: #22c55e; }
.flash-msg.danger  { border-color: #ef4444; }
.flash-msg.warning { border-color: #f59e0b; }
.flash-msg.info    { border-color: var(--sky-mid); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Responsive ────────────────────────────── */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}