/**
 * Lolidactyl PHP Edition - Comprehensive Stylesheet
 * Preserving exact visual design, dark-only theme tokens, and typography.
 */

:root {
  color-scheme: dark;
  --radius: 0.625rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.625rem;
  --radius-xl: 0.875rem;

  --background: #000000;
  --foreground: #ededed;
  --card: #0a0a0a;
  --card-foreground: #ededed;
  --popover: #0a0a0a;
  --popover-foreground: #ededed;
  
  --dew: #86d9f7;
  --dew-foreground: #03131b;
  --primary: var(--dew);
  --primary-foreground: var(--dew-foreground);
  
  --secondary: #161616;
  --secondary-foreground: #ededed;
  
  --muted: #111111;
  --muted-foreground: #a3a3a3;
  --subtle: #858585;
  
  --accent: #1a1a1a;
  --accent-foreground: #ededed;
  
  --destructive: #e5484d;
  --success: #3dd68c;
  --warning: #f5a524;
  --info: #52a8ff;
  
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --input: rgba(255, 255, 255, 0.1);
  --ring: var(--dew);

  --sidebar: #000000;
  --sidebar-foreground: #a3a3a3;
  --sidebar-primary: var(--dew);
  --sidebar-primary-foreground: var(--dew-foreground);
  --sidebar-accent: #111111;
  --sidebar-accent-foreground: #ededed;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-ring: var(--dew);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
  --font-display: "Huninn", "Chiron GoRound TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  border-color: var(--border);
  margin: 0;
  padding: 0;
}

html {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  accent-color: var(--dew);
  scrollbar-color: #2a2a2a transparent;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

input, textarea {
  caret-color: var(--dew);
}

h1, h2, .font-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.25em;
}

::selection {
  background: var(--dew);
  color: var(--dew-foreground);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------- Tailwind-like utility classes ---------------- */

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

.min-h-screen { min-height: 100vh; }
.min-w-0 { min-width: 0px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-auto { width: auto; }
.h-auto { height: auto; }
.w-px { width: 1px; }

.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; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-6xl { max-width: 72rem; }
.max-h-80 { max-height: 20rem; }
.max-h-40 { max-height: 10rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.-mr-2 { margin-right: -0.5rem; }
.-mr-3 { margin-right: -0.75rem; }
.-ml-1\.5 { margin-left: -0.375rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-0 { padding-top: 0px; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-8 { padding-top: 2rem; }
.pt-20 { padding-top: 5rem; }
.pt-28 { padding-top: 7rem; }
.pb-10 { padding-bottom: 2.5rem; }
.pb-24 { padding-bottom: 6rem; }
.pl-4 { padding-left: 1rem; }
.pl-8 { padding-left: 2rem; }
.pr-0 { padding-right: 0px; }
.pr-2\.5 { padding-right: 0.625rem; }

.gap-0 { gap: 0px; }
.gap-0\.5 { gap: 0.125rem; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }
.gap-12 { gap: 3rem; }
.gap-14 { gap: 3.5rem; }
.gap-x-3 { column-gap: 0.75rem; }
.gap-y-1 { row-gap: 0.25rem; }

.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.25rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem; }
.space-y-10 > :not([hidden]) ~ :not([hidden]) { margin-top: 2.5rem; }

.divide-y > :not([hidden]) ~ :not([hidden]) {
  border-top-width: 1px;
  border-top-style: solid;
  border-top-color: var(--border);
}

.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }
.border-y { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.border-l-2 { border-left: 2px solid var(--dew); }
.border-border { border-color: var(--border); }
.border-border-strong { border-color: var(--border-strong); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

.bg-background { background-color: var(--background); }
.bg-background\/80 { background-color: rgba(0, 0, 0, 0.8); }
.bg-background\/90 { background-color: rgba(0, 0, 0, 0.9); }
.bg-card { background-color: var(--card); }
.bg-secondary { background-color: var(--secondary); }
.bg-muted { background-color: var(--muted); }
.bg-accent { background-color: var(--accent); }
.bg-white { background-color: #ffffff; }
.bg-white\/\[0\.02\] { background-color: rgba(255, 255, 255, 0.02); }
.bg-white\/\[0\.03\] { background-color: rgba(255, 255, 255, 0.03); }
.bg-transparent { background-color: transparent; }
.bg-dew { background-color: var(--dew); }
.bg-dew\/5 { background-color: rgba(134, 217, 247, 0.05); }
.bg-success { background-color: var(--success); }
.bg-success\/10 { background-color: rgba(61, 214, 140, 0.1); }
.bg-warning { background-color: var(--warning); }
.bg-warning\/5 { background-color: rgba(245, 165, 36, 0.05); }
.bg-warning\/10 { background-color: rgba(245, 165, 36, 0.1); }
.bg-destructive { background-color: var(--destructive); }
.bg-destructive\/10 { background-color: rgba(229, 72, 77, 0.1); }
.bg-info { background-color: var(--info); }
.bg-subtle { background-color: var(--subtle); }

.text-foreground { color: var(--foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-subtle { color: var(--subtle); }
.text-dew { color: var(--dew); }
.text-dew-foreground { color: var(--dew-foreground); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-destructive { color: var(--destructive); }
.text-info { color: var(--info); }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.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; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.text-7xl { font-size: 4.5rem; line-height: 1; }

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

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.uppercase { text-transform: uppercase; }

.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-snug { line-height: 1.375; }
.leading-relaxed { line-height: 1.625; }

.underline { text-decoration: underline; }
.underline-offset-4 { text-underline-offset: 4px; }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.transition-transform { transition: transform 0.15s ease; }

.sticky { position: sticky; }
.fixed { position: fixed; }
.relative { position: relative; }
.absolute { position: absolute; }
.top-0 { top: 0px; }
.top-20 { top: 5rem; }
.top-1\/2 { top: 50%; }
.left-0 { left: 0px; }
.left-2\.5 { left: 0.625rem; }
.right-0 { right: 0px; }
.bottom-0 { bottom: 0px; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.pointer-events-none { pointer-events: none; }
.-translate-y-1\/2 { transform: translateY(-50%); }

.size-3 { width: 0.75rem; height: 0.75rem; }
.size-3\.5 { width: 0.875rem; height: 0.875rem; }
.size-4 { width: 1rem; height: 1rem; }
.size-5 { width: 1.25rem; height: 1.25rem; }
.size-6 { width: 1.5rem; height: 1.5rem; }
.size-8 { width: 2rem; height: 2rem; }
.size-9 { width: 2.25rem; height: 2.25rem; }
.size-10 { width: 2.5rem; height: 2.5rem; }
.size-11 { width: 2.75rem; height: 2.75rem; }
.size-12 { width: 3rem; height: 3rem; }
.size-16 { width: 4rem; height: 4rem; }
.size-72 { width: 18rem; height: 4rem; }

.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }

.w-10 { width: 2.5rem; }
.w-16 { width: 4rem; }
.w-24 { width: 6rem; }
.w-44 { width: 11rem; }
.w-48 { width: 12rem; }
.w-60 { width: 15rem; }
.w-64 { width: 16rem; }
.w-72 { width: 18rem; }
.min-w-60 { min-width: 15rem; }

/* ---------------- Components Styling ---------------- */

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  height: 2.5rem;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  opacity: 0.9;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-strong);
  color: var(--foreground);
}
.btn-outline:hover:not(:disabled) {
  background-color: var(--accent);
  color: var(--foreground);
}

.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--muted-foreground);
}
.btn-ghost:hover:not(:disabled) {
  background-color: var(--accent);
  color: var(--foreground);
}

.btn-destructive {
  background-color: var(--destructive);
  color: #ffffff;
}
.btn-destructive:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-sm {
  height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  height: 3rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-icon-sm {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Form Inputs */
.form-input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--input);
  background-color: transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--foreground);
  transition: border-color 0.15s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--ring);
}
.form-input::placeholder {
  color: var(--subtle);
}

.form-select {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--input);
  background-color: var(--card);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--foreground);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}
.form-select:focus {
  outline: none;
  border-color: var(--ring);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.375rem;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--secondary);
  border: 1px solid var(--border-strong);
  transition: .2s;
  border-radius: 9999px;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 1.125rem;
  width: 1.125rem;
  left: 2px;
  bottom: 2px;
  background-color: #ededed;
  transition: .2s;
  border-radius: 50%;
}
.switch input:checked + .switch-slider {
  background-color: var(--dew);
  border-color: var(--dew);
}
.switch input:checked + .switch-slider:before {
  transform: translateX(1.25rem);
  background-color: #03131b;
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.5rem;
  background: var(--secondary);
  border-radius: 9999px;
  outline: none;
  border: 1px solid var(--border);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: var(--dew);
  cursor: pointer;
  border: 2px solid #000;
  box-shadow: 0 0 10px rgba(134, 217, 247, 0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: var(--dew);
  cursor: pointer;
  border: 2px solid #000;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid transparent;
}
.status-badge-active {
  background-color: rgba(61, 214, 140, 0.1);
  color: var(--success);
  border-color: rgba(61, 214, 140, 0.2);
}
.status-badge-suspended {
  background-color: rgba(245, 165, 36, 0.1);
  color: var(--warning);
  border-color: rgba(245, 165, 36, 0.2);
}
.status-badge-deleted {
  background-color: rgba(229, 72, 77, 0.1);
  color: var(--destructive);
  border-color: rgba(229, 72, 77, 0.2);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Dialog / Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  background-color: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 32rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  overflow: hidden;
}
.modal-backdrop.open .modal-box {
  transform: scale(1);
}

/* Dropdown Menu */
.dropdown-container {
  position: relative;
  display: inline-block;
}
.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background-color: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
  min-width: 12rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 40;
  display: none;
}
.dropdown-content.show {
  display: block;
}
.dropdown-separator {
  height: 1px;
  background-color: var(--border);
  margin: 0.25rem -0.25rem;
}
td.sticky:has(.dropdown-content.show),
tr:has(.dropdown-content.show) td.sticky,
tr:has(.dropdown-content.show) {
  z-index: 45 !important;
  position: relative;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--foreground);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}
.dropdown-item:hover,
.dropdown-item:focus-visible {
  background-color: var(--accent);
  color: var(--accent-foreground);
  outline: none;
}
.dropdown-item.destructive {
  color: var(--destructive);
}
.dropdown-item.destructive:hover,
.dropdown-item.destructive:focus-visible {
  background-color: rgba(229, 72, 77, 0.15);
  color: var(--destructive);
}
.dropdown-item.active-locale {
  background-color: var(--sidebar-accent);
  color: var(--foreground);
  font-weight: 500;
}

/* User Dropdown Positioning */
/* Mobile (< 768px): opens above trigger, aligned to right of trigger, 8px gap, viewport safe */
@media (max-width: 767px) {
  .user-dropdown-menu {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 16rem !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 50 !important;
  }
}

/* Desktop (>= 768px): opens to the right of sidebar, bottom-aligned with trigger, 8px gap */
@media (min-width: 768px) {
  .user-dropdown-menu {
    top: auto !important;
    bottom: 0 !important;
    left: calc(100% + 8px) !important;
    right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    min-width: 15rem !important;
    width: max-content !important;
    max-width: 20rem !important;
    overflow: visible !important;
    z-index: 50 !important;
  }
}

/* Language Submenu */
.dropdown-submenu-container {
  position: relative;
}
.dropdown-sub-content {
  background-color: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 60;
  display: none;
}
.dropdown-sub-content.show {
  display: block;
}

@media (min-width: 768px) {
  .dropdown-sub-content {
    position: absolute;
    left: calc(100% + 4px);
    top: -4px;
    min-width: 10.5rem;
  }
  .dropdown-submenu-container:hover > .dropdown-sub-content {
    display: block;
  }
  .dropdown-sub-content.flip-left {
    left: auto !important;
    right: calc(100% + 4px) !important;
  }
  .dropdown-sub-content.flip-up {
    top: auto !important;
    bottom: 0 !important;
  }
}

@media (max-width: 767px) {
  .dropdown-sub-content {
    position: static;
    margin-top: 0.25rem;
    margin-left: 0.75rem;
    width: calc(100% - 0.75rem);
    border-left: 2px solid var(--dew);
    border-radius: var(--radius-sm);
    box-shadow: none;
    background: rgba(255, 255, 255, 0.03);
  }
  .dropdown-sub-trigger[aria-expanded="true"] .submenu-chevron {
    transform: rotate(90deg);
  }
}

/* Sidebar */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}
.app-sidebar {
  width: 16rem;
  background-color: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  z-index: 30;
  position: sticky;
  top: 0;
  height: 100vh;
}
.app-sidebar.collapsed {
  width: 3rem;
}
.app-sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.app-sidebar.collapsed .sidebar-header a {
  justify-content: center;
  width: 2rem;
  padding: 0;
}
.app-sidebar.collapsed .sidebar-text,
.app-sidebar.collapsed .sidebar-group-label {
  display: none !important;
}
.app-sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 0.5rem;
  width: 2rem;
  height: 2rem;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-md);
}
.app-sidebar.collapsed .sidebar-nav-item svg {
  margin: 0 !important;
}
.app-sidebar.collapsed .sidebar-footer {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.app-sidebar.collapsed .user-menu-btn {
  justify-content: center !important;
  padding: 0 !important;
  width: 2rem !important;
  height: 2rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.app-sidebar.collapsed .user-menu-btn img {
  width: 2rem !important;
  height: 2rem !important;
}

/* Sidebar Rail */
.sidebar-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  right: -8px;
  width: 16px;
  z-index: 25;
  cursor: ew-resize;
  background: transparent;
  border: none;
  padding: 0;
  outline: none;
  display: none;
}
@media (min-width: 768px) {
  .sidebar-rail {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
.sidebar-rail::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background-color: transparent;
  transition: background-color 0.15s ease;
}
.sidebar-rail:hover::after {
  background-color: var(--sidebar-border);
}

/* Sidebar Floating Tooltip on Desktop Collapsed */
#sidebar-tooltip {
  position: fixed;
  z-index: 70;
  background-color: #111111;
  color: #ededed;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
#sidebar-tooltip.show {
  opacity: 1;
  transform: translateX(0);
}

.app-main {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--sidebar-foreground);
  transition: all 0.15s ease;
}
.sidebar-nav-item:hover {
  color: var(--foreground);
  background-color: var(--sidebar-accent);
}
.sidebar-nav-item.active {
  color: var(--foreground);
  background-color: var(--sidebar-accent);
  font-weight: 500;
}

/* Toast Notification (matching react-hot-toast) */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast-msg {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #0a0a0a;
  color: #ededed;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  font-size: 14px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.2s ease forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive queries: Mobile Sidebar breakpoint is strictly 768px */
@media (max-width: 767px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 18rem;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    transition: transform 0.25s ease;
    z-index: 40;
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 35;
    display: none;
  }
  .sidebar-backdrop.active {
    display: block;
  }
}

/* Content layout breakpoint stays at lg (1024px) */
@media (max-width: 1023px) {
  .lg\:grid-cols-\[minmax\(0\,1fr\)_340px\] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .lg\:grid-cols-\[minmax\(0\,1fr\)_300px\] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-\[minmax\(0\,1fr\)_340px\] {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .lg\:grid-cols-\[minmax\(0\,1fr\)_300px\] {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .lg\:block {
    display: block !important;
  }
  .lg\:hidden {
    display: none !important;
  }
  .lg\:sticky {
    position: sticky;
  }
  .lg\:top-20 {
    top: 5rem;
  }
}

@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:text-7xl { font-size: 4.5rem; line-height: 1; }
  .sm\:items-center { align-items: center; }
  .sm\:items-end { align-items: flex-end; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:block { display: block; }
}

@media (min-width: 768px) {
  .md\:grid-cols-\[280px_minmax\(0\,1fr\)\] {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .md\:grid-cols-\[minmax\(0\,1fr\)_280px\] {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
  .md\:gap-12 { gap: 3rem; }
  .md\:border-t-0 { border-top-width: 0px; }
  .md\:border-l { border-left-width: 1px; border-left-style: solid; }
}

@media (min-width: 1280px) {
  .xl\:flex-row { flex-direction: row; }
  .xl\:items-end { align-items: flex-end; }
  .xl\:justify-between { justify-content: space-between; }
  .xl\:table-cell { display: table-cell; }
}

/* Public language selector (Vietnamese default + English) */
.language-switch{display:inline-flex;align-items:center;gap:3px;padding:3px;border:1px solid var(--border);border-radius:999px;background:rgba(255,255,255,.025)}
.language-option{border:0;border-radius:999px;background:transparent;color:var(--muted);padding:4px 8px;font-size:10px;font-weight:700;letter-spacing:.04em;cursor:pointer}
.language-option:hover{color:var(--foreground)}
.language-option.active{background:var(--accent);color:var(--accent-foreground)}
