:root {
  --accent: #22c55e;
  --card: #231a13;
  --bg: #120d0a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f6f2ea;
  --muted: #b5aa9b;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: "Space Grotesk", "Sora", sans-serif;
  background:
    radial-gradient(1200px 600px at 15% 0%, rgba(49, 37, 26, 0.6), transparent 60%),
    radial-gradient(900px 400px at 85% 15%, rgba(34, 197, 94, 0.18), transparent 55%),
    linear-gradient(160deg, rgba(15, 10, 8, 0.9) 0%, rgba(18, 13, 10, 0.95) 35%, rgba(12, 9, 7, 0.98) 100%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

#app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 40%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 8px);
  opacity: 0.35;
  z-index: 0;
}

::selection {
  background: rgba(34, 197, 94, 0.3);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(20, 14, 10, 0.7);
}

::-webkit-scrollbar-thumb {
  background: rgba(118, 95, 71, 0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(118, 95, 71, 0.8);
}

.font-mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.bg-main {
  background: rgba(16, 12, 9, 0.92);
  backdrop-filter: blur(10px);
}

.bg-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  background-color: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.text-accent {
  color: var(--accent);
}

.bg-accent {
  background-color: var(--accent);
  color: #0b0a08;
}

.bg-accent:active {
  filter: brightness(0.95);
}

#sidebar {
  background: linear-gradient(180deg, rgba(20, 14, 10, 0.98), rgba(12, 9, 7, 0.98));
  border-right: 1px solid rgba(58, 44, 32, 0.8);
}

#sidebar .panel-title {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.02em;
}

#nav-menu a {
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

#nav-menu a:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

#main-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 96px);
  padding: 2.5rem 2rem 3.5rem;
}

.page-shell {
  width: 100%;
  display: flex;
  justify-content: center;
}

.page-content {
  width: 100%;
  max-width: 1400px;
  padding: 1.5rem;
}

.page-content > .bg-card {
  width: 100%;
}

.content-fade {
  animation: contentFade 0.35s ease;
}

@keyframes contentFade {
  from {
    opacity: 0.6;
    transform: translateY(6px);
  }
  to {
    transform: translateY(0);
  }
}

.panel-toolbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.75rem;
}

.panel-list {
  display: grid;
  gap: 1rem;
  width: 100%;
}

.panel-item {
  background: rgba(22, 16, 12, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  animation: itemRise 0.35s ease forwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}

@keyframes itemRise {
  from {
    transform: translateY(6px);
  }
  to {
    transform: translateY(0);
  }
}

.panel-item--clickable {
  cursor: pointer;
}

.panel-item:hover,
.panel-item--clickable:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(32, 23, 17, 0.9);
  transform: translateY(-1px);
}

.panel-item--active {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25);
}

.panel-empty {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
}

.panel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 12px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 22, 16, 0.6);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.panel-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.panel-btn:active {
  transform: translateY(1px);
}

.panel-btn--ghost {
  background: rgba(12, 10, 8, 0.6);
}

.panel-btn--primary {
  background: var(--accent);
  color: #0b0a08;
  border-color: rgba(34, 197, 94, 0.5);
}

.panel-btn--danger {
  background: rgba(120, 32, 32, 0.75);
  border-color: rgba(255, 120, 120, 0.4);
  color: #ffe2e2;
}

.panel-pill {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-pill--admin {
  background: rgba(160, 38, 38, 0.35);
  color: #ffb3b3;
}

.panel-pill--ops {
  background: rgba(161, 113, 34, 0.35);
  color: #ffd89b;
}

.panel-pill--control {
  background: rgba(34, 86, 161, 0.35);
  color: #b8d5ff;
}

.panel-pill--dash {
  background: rgba(118, 95, 71, 0.35);
  color: #f2e2cf;
}

.file-row {
  justify-content: flex-start;
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(120, 94, 68, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.file-icon--folder::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 8px;
  top: 6px;
  left: 7px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 200, 98, 0.6);
}

.file-icon--file {
  background: rgba(86, 86, 90, 0.4);
}

.file-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.user-row {
  align-items: center;
}

.user-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-actions .panel-btn {
  min-width: 120px;
}

.user-name {
  font-weight: 600;
}

.perm-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 12, 9, 0.7);
}

input, select, textarea {
  background: rgba(18, 13, 10, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: var(--text) !important;
  border-radius: 14px !important;
}

input::placeholder, textarea::placeholder {
  color: rgba(220, 210, 198, 0.6);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6c7b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 14px;
  padding-right: 2.4rem;
}

.panel-select {
  background: rgba(16, 12, 9, 0.85) !important;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(20, 14, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-img {
  height: 160px;
  width: auto;
  margin-bottom: 1rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-fields {
  display: grid;
  gap: 0.9rem;
}

.auth-input {
  padding: 0.85rem 1rem;
}

.auth-button {
  padding: 0.85rem 1rem;
  font-weight: 700;
  border-radius: 14px;
}

#console-output {
  background: rgba(12, 10, 8, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#status-indicator {
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  #main-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 96px);
  padding: 2.5rem 2rem 3.5rem;
}

  .page-content {
  width: 100%;
  max-width: 1400px;
  padding: 1.5rem;
}

.page-content > .bg-card {
  width: 100%;
}
}

.backup-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  background: rgba(24, 18, 13, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1.35rem 1.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  animation: itemRise 0.35s ease forwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.backup-item:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(36, 26, 19, 0.98);
  transform: translateY(-1px);
}

.backup-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.backup-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backup-meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.backup-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.backup-actions .panel-btn {
  min-height: 44px;
  min-width: 120px;
}

@media (max-width: 640px) {
  .backup-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  background: rgba(24, 18, 13, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1.35rem 1.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  animation: itemRise 0.35s ease forwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}

  .backup-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
}




.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1.1rem 1.25rem;
}

.user-main {
  gap: 0.8rem;
}

.user-name {
  font-size: 1rem;
}

.panel-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
}

.user-actions {
  gap: 0.9rem;
}

.user-actions .panel-btn {
  min-width: 120px;
  min-height: 42px;
}


/* Utility layout helpers (minimal Tailwind-style set) */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; min-width: 0; }
.flex-shrink-0 { flex-shrink: 0; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-64 { width: 16rem; }
.w-20 { width: 5rem; }
.w-12 { width: 3rem; }
.w-6 { width: 1.5rem; }
.w-5 { width: 1.25rem; }
.w-4 { width: 1rem; }
.h-full { height: 100%; }
.h-96 { height: 24rem; }
.h-12 { height: 3rem; }
.h-6 { height: 1.5rem; }
.h-5 { height: 1.25rem; }
.h-4 { height: 1rem; }
.h-2 { height: 0.5rem; }
.min-h-screen { min-height: 100vh; }
.max-w-md { max-width: 28rem; }
.max-h-96 { max-height: 24rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 999px; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-center { text-align: center; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.08em; }
.cursor-pointer { cursor: pointer; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-all { word-break: break-all; }
.resize-none { resize: none; }
.overflow-y-auto { overflow-y: auto; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.inset-0 { inset: 0; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.transform { transform: translateZ(0); }
.-translate-x-full { transform: translateX(-100%); }
.transition-all { transition: all 0.2s ease; }
.transition-transform { transition: transform 0.3s ease; }
.duration-300 { transition-duration: 300ms; }
.ease-in-out { transition-timing-function: ease-in-out; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.border { border-width: 1px; border-style: solid; border-color: var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }

.text-white { color: #ffffff; }
.text-gray-500 { color: #9ca3af; }
.text-red-400 { color: #f87171; }
.text-yellow-400 { color: #facc15; }
.text-\[\#cccccc\] { color: #cccccc; }
.text-\[\#e0e0e0\] { color: #e0e0e0; }
.text-\[\#9aa0a6\] { color: #9aa0a6; }

.bg-\[\#1e1e1e\] { background: #1e1e1e; }
.bg-\[\#252525\] { background: #252525; }
.bg-\[\#2d2d2d\] { background: #2d2d2d; }
.bg-\[\#3a3a3a\] { background: #3a3a3a; }
.bg-\[\#3c3c3c\] { background: #3c3c3c; }
.bg-\[\#4a4a4a\] { background: #4a4a4a; }
.bg-blue-500 { background: #3b82f6; }
.bg-blue-600 { background: #2563eb; }
.bg-green-600 { background: #16a34a; }
.bg-indigo-600 { background: #4f46e5; }
.bg-purple-500 { background: #a855f7; }
.bg-red-600 { background: #dc2626; }
.bg-yellow-600 { background: #ca8a04; }
.bg-black { background: #000; }
.bg-opacity-50 { opacity: 0.5; }

.border-\[\#4a4a4a\] { border-color: #4a4a4a; }
.border-\[\#555555\] { border-color: #555555; }
.border-\[\#5a5a5a\] { border-color: #5a5a5a; }

.hover\:bg-\[\#2d2d2d\]:hover { background: #2d2d2d; }
.hover\:bg-\[\#454545\]:hover { background: #454545; }
.active\:bg-\[\#2d2d2d\]:active { background: #2d2d2d; }
.active\:bg-\[\#3c3c3c\]:active { background: #3c3c3c; }
.active\:bg-\[\#4a4a4a\]:active { background: #4a4a4a; }
.active\:bg-green-700:active { background: #15803d; }
.active\:bg-red-700:active { background: #b91c1c; }
.active\:bg-yellow-700:active { background: #a16207; }

@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:p-6 { padding: 1.5rem; }
  .sm\:p-8 { padding: 2rem; }
  .sm\:w-auto { width: auto; }
  .sm\:inline { display: inline; }
}

@media (min-width: 768px) {
  .md\:hidden { display: none; }
  .md\:ml-64 { margin-left: 16rem; }
  .md\:translate-x-0 { transform: scale(1); opacity: 1; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px; left: 50%; transform: translateX(-50%);
  
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 20px;
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toastIn 0.3s ease-out;
  max-width: 350px;
  backdrop-filter: blur(10px);
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast.fade-out {
  animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
  from {
    transform: scale(0.9); opacity: 0;
  }
  to {
    transform: scale(1); opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: scale(1); opacity: 1;
  }
  to {
    transform: scale(0.9); opacity: 0;
  }
}
