/* cignyl-sftp 20260826 */
/* v2 (shadcn-like) component styles
 *
 * IMPORTANT:
 * - All variables + component styles are scoped under `.v2-theme` to avoid impacting legacy UI.
 * - All component class names are v2-prefixed to avoid collisions with layout.css + jQuery UI themes.
 */

/* ------------------------------ */
/* Shadcn theme variables (scoped) */
/* ------------------------------ */

.v2-theme {
  /* Base palette (shadcn) */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;

  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;

  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;

  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;

  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;

  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;

  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;

  --destructive: 354.3 70.5% 53.5%;
  --destructive-foreground: 0 0% 100%;
  --success: 152.2 68.8% 31.4%;
  --success-foreground: 0 0% 100%;
  --warning: 45 100% 51.4%;
  --warning-foreground: 210 10.8% 14.5%;
  --info: 221 83% 53%;
  --info-foreground: 210 40% 98%;

  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;

  --chart-1: 210 70% 50%;
  --chart-2: 28 90% 55%;
  --chart-3: 172 55% 45%;
  --chart-4: 2 72% 56%;
  --chart-5: 142 45% 42%;

  --radius: 0.4rem;

  /* v2 spacing scale (standardize component padding/margins/gaps; no computed spacing) */
  --v2-space-xsm: 0.5rem;
  --v2-space-sm: 0.75rem;
  --v2-space-md: 1rem;
  --v2-space-lg: 1.5rem;
  --v2-space-xl: 2rem;

  /* v2 basics */
  color-scheme: light;
  /* background-color: hsl(var(--background)); */
  color: hsl(var(--foreground));
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

html.v2-theme {
  background-color: hsl(var(--background));
}

.v2-theme.v2-theme-dark,
html.v2-theme-dark .v2-theme {
  /* Handoff: page well #020617, surfaces #0f172a, royal #0747a6. No page wash. */
  --background: 226 84% 5%;
  --foreground: 214 32% 91%;

  --card: 222 47% 11%;
  --card-foreground: 214 32% 91%;

  --popover: 222 47% 11%;
  --popover-foreground: 214 32% 91%;

  --primary: 216 92% 34%;
  --primary-foreground: 0 0% 100%;

  --secondary: 222 47% 11%;
  --secondary-foreground: 214 32% 91%;

  --muted: 222 47% 11%;
  --muted-foreground: 215 16% 65%;

  --radius: 0.125rem;

  --accent: 216 50% 16%;
  --accent-foreground: 214 32% 91%;

  --destructive: 0 91% 71%;
  --destructive-foreground: 0 0% 100%;

  --success: 142 71% 45%;
  --success-foreground: 0 0% 100%;
  --warning: 38 92% 50%;
  --warning-foreground: 222 47% 11%;
  --info: 216 92% 34%;
  --info-foreground: 0 0% 100%;

  --border: 215 16% 28%;
  --input: 215 16% 28%;
  --ring: 216 92% 34%;

  --chart-1: 199 89% 48%;
  --chart-2: 239 84% 67%;
  --chart-3: 167 77% 64%;
  --chart-4: 38 92% 50%;
  --chart-5: 142 71% 45%;

  --v2-canvas-deep: 226 84% 5%;
  --v2-glow-sky: 199 89% 48%;
  --v2-glow-teal: 167 77% 64%;

  color-scheme: dark;
  color: hsl(var(--foreground));
}

html.v2-theme-dark,
html.v2-theme-dark body {
  color-scheme: dark;
  color: hsl(var(--foreground));
  background: hsl(var(--background, 226 84% 5%));
}

/* ------------------------------ */
/* Scrollbar theming (scoped)     */
/* ------------------------------ */
/* Keep scrollbars aligned with v2 palette without leaking into legacy UI. */
.v2-theme {
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border)) hsl(var(--background));
}

/* Chromium / Safari */
.v2-theme *::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.v2-theme *::-webkit-scrollbar-track {
  background: hsl(var(--background));
}

.v2-theme *::-webkit-scrollbar-thumb {
  background-color: hsl(var(--muted-foreground) / 0.25);
  border: 3px solid hsl(var(--background));
  border-radius: 999px;
}

.v2-theme *::-webkit-scrollbar-thumb:hover {
  background-color: hsl(var(--muted-foreground) / 0.35);
}

.v2-theme *::-webkit-scrollbar-thumb:active {
  background-color: hsl(var(--muted-foreground) / 0.5);
}

.v2-theme *::-webkit-scrollbar-corner {
  background: hsl(var(--background));
}

/* Minimal scoped resets to avoid legacy bleed */
.v2-theme,
.v2-theme * {
  box-sizing: border-box;
}

.v2-theme label {
  /*
   * layout.css applies global form label rules (block layout, borders, clears, etc.).
   * v2 components must be visually isolated, so we reset the legacy label baseline here.
   */
  margin: 0;
  border: 0;
  clear: none;
  font: inherit;
  font-weight: inherit;
  display: inline;
}

.v2-theme label input,
.v2-theme label select,
.v2-theme label textarea,
.v2-theme label a.ui-button {
  float: none;
  margin: 0;
}

.v2-theme a {
  color: inherit;
}

.v2-theme .v2-is-hidden {
  display: none !important;
}

.v2-theme [data-v2-hidden="true"] {
  display: none !important;
}

