/* src/client/base.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #161616;
  --card-foreground: #fafafa;
  --popover: #161616;
  --popover-foreground: #fafafa;
  --primary: #fafafa;
  --primary-foreground: #0a0a0a;
  --secondary: #262626;
  --secondary-foreground: #fafafa;
  --muted: #262626;
  --muted-foreground: #a1a1aa;
  --accent: #262626;
  --accent-foreground: #fafafa;
  --destructive: #dc2626;
  --destructive-foreground: #fafafa;
  --border: #262626;
  --input: #262626;
  --ring: #d4d4d8;
  --success: #059669;
  --warning: #eab308;
  --info: #3b82f6;
  --command: #22d3ee;
  --text-primary: var(--foreground);
  --text-secondary: var(--muted-foreground);
  --text-accent: #60a5fa;
  --bg-page: var(--background);
  --bg-card: var(--card);
  --bg-input: var(--input);
  --border-color: var(--border);
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --radius-sm: .25rem;
  --radius: .375rem;
  --radius-md: .5rem;
  --radius-lg: .75rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --shadow-sm: 0 1px 2px 0 #0000000d;
  --shadow: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;
  --shadow-md: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

.cursor-pointer {
  cursor: pointer;
}

.text-xs {
  font-size: .75rem;
  line-height: 1rem;
}

.text-sm {
  font-size: .875rem;
  line-height: 1.25rem;
}

.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-mono {
  font-family: var(--font-mono);
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--text-accent);
}

.text-primary-foreground {
  color: var(--primary-foreground);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-destructive {
  color: var(--destructive);
}

.text-command {
  color: var(--command);
}

.container {
  padding: 0 var(--space-4);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.items-center {
  align-items:  center;
}

.items-start {
  align-items:  flex-start;
}

.items-end {
  align-items:  flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.flex-1 {
  flex: 1;
}

.flex-none {
  flex: none;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

.gap-8 {
  gap: var(--space-8);
}

.space-y-2 > * + * {
  margin-top: var(--space-2);
}

.space-y-4 > * + * {
  margin-top: var(--space-4);
}

.space-y-6 > * + * {
  margin-top: var(--space-6);
}

.space-y-8 > * + * {
  margin-top: var(--space-8);
}

.p-0 {
  padding: 0;
}

.p-2 {
  padding: var(--space-2);
}

.p-3 {
  padding: var(--space-3);
}

.p-4 {
  padding: var(--space-4);
}

.p-6 {
  padding: var(--space-6);
}

.p-8 {
  padding: var(--space-8);
}

.px-2 {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.px-3 {
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.px-6 {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.py-2 {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.py-3 {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.py-6 {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.m-0 {
  margin: 0;
}

.m-2 {
  margin: var(--space-2);
}

.m-4 {
  margin: var(--space-4);
}

.m-6 {
  margin: var(--space-6);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.mt-2 {
  margin-top: var(--space-2);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-8 {
  margin-top: var(--space-8);
}

.ml-2 {
  margin-left: var(--space-2);
}

.mr-2 {
  margin-right: var(--space-2);
}

.ml-4 {
  margin-left: var(--space-4);
}

.mr-4 {
  margin-right: var(--space-4);
}

.ml-6 {
  margin-left: var(--space-6);
}

.mr-6 {
  margin-right: var(--space-6);
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.min-h-screen {
  min-height: 100vh;
}

.max-w-xs {
  max-width: 20rem;
}

.max-w-sm {
  max-width: 24rem;
}

.max-w-md {
  max-width: 28rem;
}

.max-w-lg {
  max-width: 32rem;
}

.max-w-xl {
  max-width: 36rem;
}

.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all .2s ease-in-out;
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.card-header-sm {
  padding: var(--space-3) var(--space-6);
}

.card-content {
  padding: var(--space-6);
}

.card-title {
  margin-bottom: var(--space-2);
  font-size: 1.125rem;
  font-weight: 600;
}

.card-description {
  color: var(--text-secondary);
  font-size: .875rem;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items:  center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid #0000;
  transition: all .2s ease-in-out;
  font-size: .875rem;
  font-weight: 500;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary);
  opacity: .9;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--accent);
}

.btn-ghost {
  color: var(--text-primary);
  background: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent);
}

.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.btn-destructive:hover:not(:disabled) {
  background: var(--destructive);
  opacity: .9;
}

.btn-destructive-ghost {
  color: var(--destructive);
  background: none;
  border-color: #0000;
}

.btn-destructive-ghost:hover:not(:disabled) {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: var(--success);
  opacity: .9;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: .75rem;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
}

.form-group {
  margin-bottom: var(--space-4);
}

.label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: .875rem;
  font-weight: 500;
}

.input {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  width: 100%;
  transition: border-color .2s ease-in-out;
  font-size: .875rem;
}

.input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

.input::placeholder {
  color: var(--text-secondary);
}

.select {
  padding: var(--space-2) var(--space-3);
  background: var(--background);
  color: var(--text-primary);
  cursor: pointer;
  width: 100%;
  font-size: .875rem;
}

.select:focus {
  outline: none;
  border-color: var(--ring);
}

.table {
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  width: 100%;
}

.table th {
  background: var(--muted);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  font-size: .875rem;
  font-weight: 500;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  font-size: .875rem;
}

.table tr:hover {
  background: var(--muted);
}

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

.badge {
  display: inline-flex;
  align-items:  center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-radius: var(--radius);
  font-size: .65rem;
  font-weight: 500;
}

.badge-success {
  background: var(--success);
  color: #fff;
}

.badge-warning {
  background: var(--warning);
  color: #000;
}

.badge-destructive {
  background: var(--destructive);
  color: #fff;
}

.badge-admin {
  color: #fff;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #9333ea, #7e22ce);
  border: 1px solid #a855f7;
}

.badge-admin:before {
  content: "";
  position: absolute;
  animation: sparkle 5s infinite linear;
  background: linear-gradient(90deg, #0000, #ffffff80, #0000);
  width: 75%;
  height: 100%;
  top: 0;
  left: -150%;
  transform: skewX(-25deg);
}

.breadcrumb {
  display: flex;
  align-items:  center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  color: var(--text-secondary);
  font-size: .875rem;
}

.breadcrumb a {
  color: var(--text-primary);
  transition: color .2s ease-in-out;
}

.breadcrumb a:hover, .breadcrumb-separator {
  color: var(--text-secondary);
}

.site-header {
  position: sticky;
  z-index: 50;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: var(--space-2) 0;
  backdrop-filter: blur(8px);
  top: 0;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  min-height: 3rem;
}

.site-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.site-header p {
  color: var(--text-secondary);
  font-size: .875rem;
}

.page-header {
  margin-bottom: var(--space-8);
}

.page-title {
  margin-bottom: var(--space-2);
  font-size: 1.875rem;
  font-weight: 700;
}

.page-description {
  color: var(--text-secondary);
  font-size: 1rem;
}

.dropdown-item:hover {
  background-color: var(--muted);
  cursor: pointer;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.top-full {
  top: 100%;
}

.left-0 {
  left: 0;
}

.left-3 {
  left: .75rem;
}

.right-3 {
  right: .75rem;
}

.top-1\/2 {
  top: 50%;
}

.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.-translate-y-1\/2 {
  --tw-translate-y: -50%;
  transform: translateY(-50%);
}

.rotate-180 {
  transform: rotate(180deg);
}

.transition-transform {
  transition: transform .2s ease-in-out;
}

.transition-colors {
  transition: color .2s ease-in-out;
}

.z-50 {
  z-index: 50;
}

.min-w-32 {
  min-width: 8rem;
}

.min-w-48 {
  min-width: 12rem;
}

.w-1\.5 {
  width: .375rem;
}

.h-1\.5 {
  height: .375rem;
}

.pl-8 {
  padding-left: 2rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.px-2 {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.py-1 {
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}

.bg-background {
  background: var(--background);
}

.bg-card {
  background: var(--bg-card);
}

.bg-muted {
  background: var(--muted);
}

.rounded {
  border-radius: var(--radius);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.divide-y > * + * {
  border-top: 1px solid var(--border-color);
}

.divide-border-color > * + * {
  border-color: var(--border-color);
}

.border-success {
  border-color: var(--success);
}

.border-primary {
  border-color: var(--primary);
}

.border-accent {
  border-color: var(--text-accent);
}

.border-transparent {
  border-color: #0000;
}

.border-b {
  border-bottom: 1px solid var(--border-color);
}

.border-b-2 {
  border-bottom: 2px solid;
}

.border-border-color {
  border-color: var(--border-color);
}

.sr-only {
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (width >= 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (width >= 1024px) {
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width <= 768px) {
  .container {
    padding: 0 var(--space-3);
  }

  .grid-cols-2, .grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .flex-col-mobile {
    flex-direction: column;
  }

  .gap-2-mobile {
    gap: var(--space-2);
  }
}

.loading-spinner {
  display: inline-block;
  border: 2px solid var(--text-secondary);
  border-top-color: var(--text-primary);
  animation: spin 1s ease-in-out infinite;
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
}

@keyframes sparkle {
  0% {
    left: -150%;
  }

  100% {
    left: 150%;
  }
}

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

.tabs-list {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
}

.tabs-trigger {
  display: flex;
  white-space: nowrap;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  background: none;
  border: none;
  border-bottom: 2px solid #0000;
  border-radius: .375rem .375rem 0 0;
  justify-content: center;
  align-items:  center;
  padding: .75rem 1rem;
  transition: all .15s;
  font-size: .875rem;
  font-weight: 500;
}

.tabs-trigger:hover {
  color: var(--text-primary);
  background-color: var(--muted);
}

.tabs-trigger-active {
  color: var(--text-primary);
  border-bottom-color: var(--text-accent);
  background-color: #0000;
}

.tabs-trigger-active:hover {
  background-color: #0000;
}

.tabs-content {
  margin-top: 1rem;
}
