/* ============================================
   WEDNESDAY THEME — Service Hub
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0a0b;
  --surface: #141418;
  --surface-2: #1e1e24;
  --border: #2a2a33;
  --primary: #8b7ec8;
  --primary-light: #a99de0;
  --accent: #c4a882;
  --text: #e8e6e3;
  --text-muted: #8a8891;
  --danger: #c45c5c;
  --success: #5c9a6e;
  --warning: #c4a055;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ─── Layout ─── */
.app-layout { display: flex; min-height: 100vh; }

/* ─── Top Header ─── */
.top-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700; color: #fff;
}
.brand h2 { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 600; }
.user-menu { display: flex; align-items: center; gap: 14px; }
.user-info { text-align: right; }
.user-info .name { font-size: 13px; font-weight: 500; }
.user-info .role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2);
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--primary); font-weight: 600;
}
.logout-btn {
  padding: 6px 14px; border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: 12px;
  font-family: 'Inter', sans-serif; transition: all 0.2s;
}
.logout-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ─── Sidebar ─── */
.sidebar {
  width: 220px; min-width: 220px; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
}
.sidebar-brand {
  padding: 18px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 14px; transition: all 0.2s; text-decoration: none;
}
.back-btn:hover { border-color: var(--primary); color: var(--primary); }
.sidebar-brand h3 { font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 600; }
.sidebar-section {
  padding: 14px 16px 6px; font-size: 9px; text-transform: uppercase;
  letter-spacing: 1.5px; color: #4a4a52; font-weight: 600;
}
.sidebar-nav { padding: 10px 0; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px;
  color: var(--text-muted); text-decoration: none; font-size: 13px;
  transition: all 0.15s; border-left: 2px solid transparent;
}
.sidebar-nav a:hover { color: var(--text); background: var(--surface-2); }
.sidebar-nav a.active { color: var(--primary-light); border-left-color: var(--primary); background: rgba(139,126,200,0.06); }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }

/* ─── Main Content ─── */
.main-content { flex: 1; padding: 24px 28px; min-width: 0; overflow-x: auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; }

/* ─── Buttons ─── */
.btn {
  padding: 8px 16px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 7px; cursor: pointer; font-size: 12px;
  font-family: 'Inter', sans-serif; transition: all 0.2s; display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { border-color: var(--primary); }
.btn-accent { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-accent:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(196,92,92,0.1); }
.btn-sm { padding: 4px 10px; font-size: 10px; border-radius: 4px; }
.btn-approve { border: 1px solid var(--success); background: rgba(92,154,110,0.1); color: var(--success); cursor: pointer; font-family: 'Inter', sans-serif; }
.btn-approve:hover { background: rgba(92,154,110,0.2); }
.btn-reject { border: 1px solid var(--danger); background: rgba(196,92,92,0.1); color: var(--danger); cursor: pointer; font-family: 'Inter', sans-serif; margin-left: 4px; }
.btn-reject:hover { background: rgba(196,92,92,0.2); }

/* ─── Panel ─── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.panel-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-header h3 { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 600; }

/* ─── Stats Row ─── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.stat-value { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 600; }
.stat-value.purple { color: var(--primary-light); }
.stat-value.gold { color: var(--accent); }
.stat-value.green { color: var(--success); }
.stat-value.red { color: var(--danger); }

/* ─── Tables ─── */
table { width: 100%; border-collapse: collapse; }
table th {
  text-align: left; padding: 10px 20px; font-size: 10px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 500;
}
table td { padding: 12px 20px; font-size: 13px; border-bottom: 1px solid rgba(42,42,51,0.3); }
table tr:hover { background: rgba(30,30,36,0.5); }

/* ─── Badges ─── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-admin { background: rgba(139,126,200,0.15); color: var(--primary-light); }
.badge-member { background: rgba(196,168,130,0.15); color: var(--accent); }
.badge-viewer { background: rgba(138,136,145,0.1); color: var(--text-muted); }
.badge-approved { background: rgba(92,154,110,0.12); color: var(--success); }
.badge-pending { background: rgba(196,160,85,0.12); color: var(--warning); }
.badge-rejected { background: rgba(196,92,92,0.12); color: var(--danger); }

/* ─── Service Cards ─── */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.service-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px 22px; cursor: pointer; transition: all 0.25s; position: relative; overflow: hidden;
  text-decoration: none; color: var(--text); display: block;
}
.service-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--border); transition: background 0.25s;
}
.service-card:hover {
  border-color: var(--primary); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139,126,200,0.1); color: var(--text);
}
.service-card:hover::before { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.service-icon {
  width: 44px; height: 44px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-size: 20px; margin-bottom: 14px;
}
.service-card h3 { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.service-card p { color: var(--text-muted); font-size: 12px; line-height: 1.5; font-weight: 300; }
.service-status {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 500;
}
.service-status.online { color: var(--success); }
.service-status.offline { color: var(--text-muted); }
.service-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.service-status.online .dot { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.service-card.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.service-card .card-badge {
  position: absolute; top: 10px; right: 10px; font-size: 9px; padding: 2px 7px;
  border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}

/* ─── Flash Messages ─── */
.flash-messages { padding: 0; margin: 0 0 20px; list-style: none; }
.flash-msg {
  padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 8px;
  border: 1px solid var(--border);
}
.flash-msg.error { background: rgba(196,92,92,0.1); border-color: var(--danger); color: var(--danger); }
.flash-msg.success { background: rgba(92,154,110,0.1); border-color: var(--success); color: var(--success); }
.flash-msg.warning { background: rgba(196,160,85,0.1); border-color: var(--warning); color: var(--warning); }

/* ─── Forms ─── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 500; color: var(--text-muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px;
}
.form-group input, .form-group select {
  width: 100%; padding: 11px 14px; background: rgba(10,10,11,0.6);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-size: 14px; font-family: 'Inter', sans-serif; outline: none; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }
.form-group input::placeholder { color: #3a3a42; }
.form-group select option { background: var(--surface); color: var(--text); }

/* ─── Login Page ─── */
.login-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139,126,200,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(196,168,130,0.04) 0%, transparent 50%),
    var(--bg);
}
.login-container {
  width: 380px; padding: 44px 36px;
  background: rgba(20,20,24,0.95); border: 1px solid var(--border); border-radius: 16px;
  position: relative;
}
.login-container::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; color: #fff;
}
.login-logo h1 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; }
.login-logo p { color: var(--text-muted); font-size: 12px; margin-top: 4px; font-weight: 300; letter-spacing: 2px; text-transform: uppercase; }
.btn-primary {
  width: 100%; padding: 12px; background: var(--primary); border: none; border-radius: 8px;
  color: #fff; font-size: 14px; font-weight: 500; font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all 0.2s; letter-spacing: 0.3px;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); }
.login-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-muted); font-size: 11px;
}
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-footer { text-align: center; }
.login-footer a { font-size: 13px; }

/* ─── Modal ─── */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px; width: 420px; max-width: 90vw; max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-family: 'Playfair Display', serif; font-size: 18px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
