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

:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #6366f1;
  --brand-hover: #4f46e5;
  --ok: #10b981;
  --bad: #ef4444;
  --accent: #f1f5f9;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

h1 {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #1e293b;
}

h2 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: #334155;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

@media (max-width: 900px) {
  [class*="col-"] { grid-column: span 12 !important; }
}

/* Navigation */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  background: #fff;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  align-items: center;
}

.nav a, .nav button {
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav a:hover {
  color: var(--brand);
  background: var(--accent);
}

.nav a.active {
  background: var(--brand);
  color: #fff;
}

.nav .logout {
  margin-left: auto;
  color: var(--bad);
}

.nav .logout:hover {
  background: #fef2f2;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  background: #fff;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}


/* Forms */
label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  line-height: 1.4;
}

.grid label {
  min-height: 38px;
  display: flex;
  align-items: end;
  padding-bottom: 4px;
}

.inline label {
  min-height: 0 !important;
  display: inline !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
}

input,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="date"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--line);
  background: #fff;
  color: #475569;
}

.btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-top-color: #fff;
  border-radius: 50%;
  margin-left: 8px;
  animation: stella-spin 0.7s linear infinite;
}

.btn:not(.btn-primary).is-loading::after {
  border: 2px solid rgba(71, 85, 105, 0.35);
  border-top-color: #475569;
}

/* Tables */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: #334155;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fcfdfe;
}

/* Messages */
.msg {
  min-height: 24px;
  font-size: 14px;
  margin-top: 12px;
  font-weight: 500;
}

.ok { color: var(--ok); }
.error { color: var(--bad); }

/* Avatar Preview */
.avatar-preview {
  width: 80px;
  height: 80px;
  border: 2px solid var(--line);
  background: var(--accent);
  object-fit: cover;
  box-shadow: var(--shadow);
}
.avatar-preview.round { border-radius: 50%; }
.avatar-preview.square { border-radius: 12px; }

/* Utilities */
.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand);
}

/* Security Banner */
.security-banner {
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #92400e;
  border-radius: 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Category List */
.cat-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  max-height: 250px;
  overflow: auto;
  background: #fcfdfe;
}

.cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.cat-row:last-child {
  border-bottom: 0;
}

.cat-row span {
  font-weight: 500;
  color: #334155;
}

/* Specific Page Adjustments */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
}

.faq-mobile-list {
  display: none;
}

.faq-mobile-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  margin-bottom: 10px;
}

.faq-mobile-row {
  margin-bottom: 8px;
}

.faq-mobile-row:last-child {
  margin-bottom: 0;
}

.faq-mobile-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.faq-mobile-value {
  font-size: 14px;
  color: #334155;
  word-break: break-word;
}

.faq-mobile-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .faq-desktop-table {
    display: none;
  }
  .faq-mobile-list {
    display: block;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Animations */
@keyframes pulse-sm {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes stella-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .container {
    padding: 24px 12px;
  }
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }
  .nav .logout {
    margin-left: 0;
  }
}

.pulse-hover:hover {
  animation: pulse-sm 0.5s infinite;
}

.pro-glow {
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.1), 0 4px 6px -4px rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2) !important;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.card-header-pro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

