/* ==========================================================================
   F/ONE Design System v1.0
   Replaces Tailwind CSS for Flask admin panel
   Color palette extracted from fedoseev.one
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Custom Fonts
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Onest';
  src: url('../fonts/Onest-ExtraBold.woff2') format('woff2'),
       url('../fonts/Onest-ExtraBold-latin.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Commissioner';
  src: url('../fonts/Commissioner-Regular.woff2') format('woff2'),
       url('../fonts/Commissioner-Regular-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   1. CSS Custom Properties
   -------------------------------------------------------------------------- */

:root {
  --background: #f9f6f3;
  --foreground: #1e1916;
  --heading-foreground: #0c0806;
  --card: #ffffff;
  --card-foreground: #1e1916;
  --muted: #ece7e1;
  --muted-foreground: #787069;
  --accent-brand: #da915f;
  --accent-brand-glow: rgba(218, 145, 95, 0.08);
  --destructive: #e40014;
  --destructive-foreground: #ffffff;
  --success: #059669;
  --success-foreground: #ffffff;
  --warning: #d97706;
  --warning-foreground: #ffffff;
  --border: #dcd6cf;
  --input: #dcd6cf;
  --secondary: #f0ece7;
  --secondary-foreground: #26201d;
  --primary: #0c0806;
  --primary-foreground: #f9f6f3;
  --sidebar-bg: #f7f5f1;
  --sidebar-foreground: #0c0806;
  --sidebar-active: #ece7e1;
  --sidebar-border: #dcd6cf;
  --ring: #787069;
  --radius: 14px;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Commissioner', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--foreground);
  background-color: var(--background);
  cursor: default;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Onest', 'Commissioner', sans-serif;
  color: var(--heading-foreground);
  line-height: 1.2;
}

h1 { font-size: 56px; font-weight: 800; }
h2 { font-size: 40px; font-weight: 800; }
h3 { font-size: 28px; font-weight: 700; }
h4 { font-size: 22px; font-weight: 700; }
h5 { font-size: 18px; font-weight: 600; }
h6 { font-size: 15px; font-weight: 600; }

a {
  color: var(--accent-brand);
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  text-decoration: underline;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

button, [role="button"], a {
  cursor: pointer;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="tel"],
textarea {
  cursor: text;
}

input:disabled,
button:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent-brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--accent-brand-glow);
}

/* --------------------------------------------------------------------------
   3. Layout Utilities
   -------------------------------------------------------------------------- */

.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.flex-1      { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap   { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-start   { justify-content: flex-start; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.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)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

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

.overflow-hidden  { overflow: hidden; }
.overflow-y-auto  { overflow-y: auto; }
.overflow-x-auto  { overflow-x: auto; }

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

.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0   { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0  { left: 0; }

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

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

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

.whitespace-nowrap { white-space: nowrap; }

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

/* --------------------------------------------------------------------------
   4. Spacing
   -------------------------------------------------------------------------- */

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.px-8 { padding-left: 32px; padding-right: 32px; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 4px; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.pt-6 { padding-top: 24px; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 4px; }
.pb-2 { padding-bottom: 8px; }
.pb-3 { padding-bottom: 12px; }
.pb-4 { padding-bottom: 16px; }
.pb-6 { padding-bottom: 24px; }

.pl-0 { padding-left: 0; }
.pl-2 { padding-left: 8px; }
.pl-3 { padding-left: 12px; }
.pl-4 { padding-left: 16px; }

.pr-0 { padding-right: 0; }
.pr-2 { padding-right: 8px; }
.pr-3 { padding-right: 12px; }
.pr-4 { padding-right: 16px; }

/* Margin */
.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }
.m-6 { margin: 24px; }
.m-8 { margin: 32px; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.mx-4 { margin-left: 16px; margin-right: 16px; }

.my-2 { margin-top: 8px; margin-bottom: 8px; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }
.ml-4 { margin-left: 16px; }
.ml-auto { margin-left: auto; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }
.mr-4 { margin-right: 16px; }
.mr-auto { margin-right: auto; }

/* Space between children */
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }

.space-x-1 > * + * { margin-left: 4px; }
.space-x-2 > * + * { margin-left: 8px; }
.space-x-3 > * + * { margin-left: 12px; }
.space-x-4 > * + * { margin-left: 16px; }

/* --------------------------------------------------------------------------
   5. Sizing
   -------------------------------------------------------------------------- */

.w-4  { width: 16px; }
.w-5  { width: 20px; }
.w-6  { width: 24px; }
.w-8  { width: 32px; }
.w-10 { width: 40px; }
.w-12 { width: 48px; }

.h-4  { height: 16px; }
.h-5  { height: 20px; }
.h-6  { height: 24px; }
.h-8  { height: 32px; }
.h-10 { height: 40px; }
.h-12 { height: 48px; }

.min-w-0 { min-width: 0; }

.max-w-xs  { max-width: 320px; }
.max-w-sm  { max-width: 384px; }
.max-w-md  { max-width: 448px; }
.max-w-lg  { max-width: 512px; }
.max-w-xl  { max-width: 576px; }
.max-w-2xl { max-width: 672px; }
.max-w-3xl { max-width: 768px; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }
.max-w-full { max-width: 100%; }

/* --------------------------------------------------------------------------
   6. Typography
   -------------------------------------------------------------------------- */

.text-xs   { font-size: 12px; line-height: 1.5; }
.text-sm   { font-size: 14px; line-height: 1.5; }
.text-base { font-size: 16px; line-height: 1.6; }
.text-lg   { font-size: 18px; line-height: 1.5; }
.text-xl   { font-size: 22px; line-height: 1.3; }
.text-2xl  { font-size: 28px; line-height: 1.2; }
.text-3xl  { font-size: 40px; line-height: 1.15; }
.text-4xl  { font-size: 56px; line-height: 1.1; }

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

.tracking-wide    { letter-spacing: 0.025em; }
.tracking-wider   { letter-spacing: 0.05em; }
.tracking-widest  { letter-spacing: 0.1em; }

.uppercase   { text-transform: uppercase; }
.lowercase   { text-transform: lowercase; }
.capitalize  { text-transform: capitalize; }
.normal-case { text-transform: none; }

.font-mono { font-family: 'Courier New', Courier, monospace; font-size: 13px; }
.font-heading { font-family: 'Onest', 'Commissioner', sans-serif; }

.leading-none    { line-height: 1; }
.leading-tight   { line-height: 1.25; }
.leading-normal  { line-height: 1.5; }
.leading-relaxed { line-height: 1.75; }

.tabular-nums { font-variant-numeric: tabular-nums; }

/* Section label: uppercase small label */
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
}

/* Caption */
.caption {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-foreground);
}

/* --------------------------------------------------------------------------
   7. Colors
   -------------------------------------------------------------------------- */

/* Text colors */
.text-foreground   { color: var(--foreground); }
.text-heading      { color: var(--heading-foreground); }
.text-muted        { color: var(--muted-foreground); }
.text-accent       { color: var(--accent-brand); }
.text-destructive  { color: var(--destructive); }
.text-success      { color: var(--success); }
.text-warning      { color: var(--warning); }
.text-white        { color: #ffffff; }
.text-inherit      { color: inherit; }

/* Background colors */
.bg-background    { background-color: var(--background); }
.bg-card          { background-color: var(--card); }
.bg-muted         { background-color: var(--muted); }
.bg-secondary     { background-color: var(--secondary); }
.bg-accent-subtle { background-color: var(--accent-brand-glow); }
.bg-primary       { background-color: var(--primary); }
.bg-destructive   { background-color: var(--destructive); }
.bg-success       { background-color: var(--success); }
.bg-warning       { background-color: var(--warning); }
.bg-transparent   { background-color: transparent; }

/* Border colors */
.border-default     { border-color: var(--border); }
.border-accent      { border-color: var(--accent-brand); }
.border-destructive { border-color: var(--destructive); }
.border-transparent { border-color: transparent; }

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-family: 'Commissioner', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 150ms ease;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.38;
  pointer-events: none;
  cursor: not-allowed;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-brand-glow);
  border-color: var(--accent-brand);
  outline: none;
}

/* Primary */
.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover {
  opacity: 0.9;
}

/* Accent */
.btn-accent {
  background-color: var(--accent-brand);
  color: #ffffff;
}
.btn-accent:hover {
  filter: brightness(1.1);
}

/* Outline */
.btn-outline {
  background-color: transparent;
  border: 1.5px solid var(--border);
  color: var(--foreground);
}
.btn-outline:hover {
  background-color: var(--secondary);
}

/* Ghost */
.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
}
.btn-ghost:hover {
  background-color: var(--muted);
}

/* Destructive */
.btn-destructive {
  background-color: var(--destructive);
  color: #ffffff;
}
.btn-destructive:hover {
  filter: brightness(1.1);
}

/* Ghost destructive */
.btn-ghost-destructive {
  background-color: transparent;
  color: var(--destructive);
}
.btn-ghost-destructive:hover {
  background-color: rgba(228, 0, 20, 0.08);
}

/* Size variants */
.btn-sm {
  height: 32px;
  font-size: 13px;
  padding: 0 12px;
}

.btn-lg {
  height: 44px;
  font-size: 16px;
}

.btn-icon {
  width: 38px;
  padding: 0;
}
.btn-icon.btn-sm {
  width: 32px;
}
.btn-icon.btn-lg {
  width: 44px;
}

/* --------------------------------------------------------------------------
   9. Form Inputs
   -------------------------------------------------------------------------- */

.input {
  height: 38px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--foreground);
  font-family: 'Commissioner', sans-serif;
  font-size: 14px;
  line-height: 1;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input:focus {
  border-color: rgba(218, 145, 95, 0.5);
  box-shadow: 0 0 0 3px var(--accent-brand-glow);
  outline: none;
}

.input-error {
  border-color: var(--destructive);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--muted);
}

.input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}

/* Textarea */
.textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--foreground);
  font-family: 'Commissioner', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.textarea:focus {
  border-color: rgba(218, 145, 95, 0.5);
  box-shadow: 0 0 0 3px var(--accent-brand-glow);
  outline: none;
}

.textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--muted);
}

/* Select */
.select {
  height: 38px;
  width: 100%;
  padding: 0 36px 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--foreground);
  font-family: 'Commissioner', sans-serif;
  font-size: 14px;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23787069' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.select:focus {
  border-color: rgba(218, 145, 95, 0.5);
  box-shadow: 0 0 0 3px var(--accent-brand-glow);
  outline: none;
}

.select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--muted);
}

/* Checkbox */
.checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--input);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--card);
  transition: background-color 150ms ease, border-color 150ms ease;
  flex-shrink: 0;
  position: relative;
}

.checkbox:checked {
  background-color: var(--foreground);
  border-color: var(--foreground);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.checkbox:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-brand-glow);
  outline: none;
}

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

/* Label */
.label {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  cursor: default;
  margin-bottom: 4px;
  display: block;
}

/* Helper & Error text */
.helper-text {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

.error-text {
  font-size: 12px;
  color: var(--destructive);
  margin-top: 4px;
}

/* Form group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   10. Cards
   -------------------------------------------------------------------------- */

.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Onest', 'Commissioner', sans-serif;
  color: var(--heading-foreground);
}

.card-interactive {
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.card-interactive:hover {
  transform: translateY(-2px);
  border-color: rgba(218, 145, 95, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   11. Tables
   -------------------------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  cursor: default;
  white-space: nowrap;
}

.table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--foreground);
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color 100ms ease;
}

.table tbody tr:hover {
  background-color: rgba(218, 145, 95, 0.04);
}

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

/* Table wrapper for overflow */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table-wrapper .table th:first-child,
.table-wrapper .table td:first-child {
  padding-left: 20px;
}

.table-wrapper .table th:last-child,
.table-wrapper .table td:last-child {
  padding-right: 20px;
}

/* --------------------------------------------------------------------------
   12. Badges
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  cursor: default;
  white-space: nowrap;
  line-height: 1;
}

.badge-default {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-accent {
  background-color: rgba(218, 145, 95, 0.12);
  color: #b5713e;
}

.badge-destructive {
  background-color: rgba(228, 0, 20, 0.1);
  color: var(--destructive);
}

.badge-success {
  background-color: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.badge-warning {
  background-color: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.badge-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  background-color: currentColor;
}

/* --------------------------------------------------------------------------
   13. Modals
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  max-width: 448px;
  width: calc(100% - 32px);
  animation: modal-enter 200ms ease-out;
}

.modal-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: 'Onest', 'Commissioner', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  padding: 0 24px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(218, 145, 95, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  transition: background-color 150ms ease;
}

.modal-close:hover {
  background-color: var(--muted);
}

/* --------------------------------------------------------------------------
   14. Confirmation Dialog
   -------------------------------------------------------------------------- */

.confirm-dialog .modal-content {
  text-align: center;
}

.confirm-dialog .modal-header {
  justify-content: flex-end;
  padding: 12px 16px 0;
}

.confirm-dialog .esc-label {
  font-size: 11px;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 150ms ease;
}

.confirm-dialog .esc-label:hover {
  color: var(--foreground);
}

.confirm-dialog-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-dialog-icon.destructive {
  background-color: rgba(228, 0, 20, 0.1);
  color: var(--destructive);
}

.confirm-dialog .modal-footer {
  justify-content: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   15. Toasts
   -------------------------------------------------------------------------- */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-width: 380px;
}

.toast {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toast-slide-in 200ms ease-out;
  position: relative;
  overflow: hidden;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  animation: toast-countdown 4s linear forwards;
}

.toast:hover .toast-progress {
  animation-play-state: paused;
}

.toast-success .toast-progress { background-color: var(--success); }
.toast-error .toast-progress   { background-color: var(--destructive); }
.toast-warning .toast-progress { background-color: var(--warning); }
.toast-info .toast-progress    { background-color: var(--accent-brand); }

.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted-foreground);
  transition: opacity 150ms ease;
}

.toast:hover .toast-close {
  opacity: 0.6;
}

.toast-close:hover {
  opacity: 1 !important;
}

.toast-title {
  font-family: 'Onest', 'Commissioner', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.toast-message {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   16. Accordion
   -------------------------------------------------------------------------- */

.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  cursor: pointer;
  font-family: 'Commissioner', sans-serif;
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--foreground);
  transition: background-color 100ms ease;
  text-align: left;
}

.accordion-trigger:hover {
  background-color: rgba(218, 145, 95, 0.04);
}

.accordion-chevron {
  width: 16px;
  height: 16px;
  transition: transform 250ms ease;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.accordion-trigger[aria-expanded="true"] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  overflow: hidden;
  transition: max-height 300ms ease-in-out;
}

.accordion-content[aria-hidden="true"] {
  max-height: 0;
}

/* --------------------------------------------------------------------------
   17. Sidebar
   -------------------------------------------------------------------------- */

.sidebar {
  width: 256px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  flex-shrink: 0;
}

.sidebar-brand {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-text {
  font-family: 'Onest', 'Commissioner', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--heading-foreground);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background-color: var(--sidebar-active);
  color: var(--foreground);
  text-decoration: none;
}

.sidebar-link.active {
  background-color: var(--sidebar-active);
  color: var(--foreground);
  font-weight: 600;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  padding: 16px 12px 6px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
}

/* --------------------------------------------------------------------------
   18. Cursors
   -------------------------------------------------------------------------- */

.cursor-text        { cursor: text; }
.cursor-default     { cursor: default; }
.cursor-pointer     { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-grab        { cursor: grab; }
.cursor-grabbing    { cursor: grabbing; }

/* --------------------------------------------------------------------------
   19. Animations & Keyframes
   -------------------------------------------------------------------------- */

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-countdown {
  from { width: 100%; }
  to   { width: 0%; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

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

/* --------------------------------------------------------------------------
   20. Drag & Drop
   -------------------------------------------------------------------------- */

.drag-handle {
  cursor: grab;
  color: var(--muted-foreground);
  padding: 4px;
  display: flex;
  opacity: 0.5;
  transition: opacity 150ms ease;
}

.drag-handle:hover {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.sortable-ghost {
  opacity: 0.4;
  background-color: rgba(218, 145, 95, 0.08);
}

.sortable-chosen {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.sortable-drag {
  transform: rotate(1deg);
}

/* --------------------------------------------------------------------------
   21. Miscellaneous Utilities
   -------------------------------------------------------------------------- */

.divider {
  height: 1px;
  background-color: var(--border);
  margin: 16px 0;
  border: none;
}

.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-60  { opacity: 0.6; }
.opacity-100 { opacity: 1; }

.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; -webkit-user-select: none; }

.transition {
  transition: all 150ms ease;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-shimmer {
  animation: shimmer 2s linear infinite;
  background-size: 200% 100%;
}

.rounded-full { border-radius: 9999px; }
.rounded-xl   { border-radius: 14px; }
.rounded-lg   { border-radius: 10px; }
.rounded-md   { border-radius: 6px; }
.rounded-sm   { border-radius: 4px; }
.rounded-none { border-radius: 0; }

.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07); }
.shadow-lg { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); }
.shadow-none { box-shadow: none; }

.ring-1 { box-shadow: 0 0 0 1px 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-0 { border: none; }

/* --------------------------------------------------------------------------
   22. Pagination
   -------------------------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 150ms ease;
}

.pagination-btn:hover {
  background-color: var(--muted);
}

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

.pagination-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.pagination-ellipsis {
  color: var(--muted-foreground);
  cursor: default;
  padding: 0 4px;
}

/* --------------------------------------------------------------------------
   23. Status Indicators
   -------------------------------------------------------------------------- */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot-success     { background-color: var(--success); }
.status-dot-destructive { background-color: var(--destructive); }
.status-dot-warning     { background-color: var(--warning); }
.status-dot-muted       { background-color: var(--muted-foreground); }

/* --------------------------------------------------------------------------
   24. Save Bar
   -------------------------------------------------------------------------- */

.save-bar {
  position: sticky;
  bottom: 0;
  background-color: var(--card);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  z-index: 40;
  animation: fade-in-up 200ms ease-out;
}

/* --------------------------------------------------------------------------
   25. Steps / Wizard
   -------------------------------------------------------------------------- */

.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Onest', 'Commissioner', sans-serif;
  flex-shrink: 0;
}

.step-number.active {
  background-color: var(--accent-brand);
  color: #ffffff;
}

.step-number.completed {
  background-color: var(--success);
  color: #ffffff;
}

.step-number.pending {
  background-color: var(--muted);
  color: var(--muted-foreground);
}

.step-line {
  width: 40px;
  height: 2px;
  background-color: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.step-line.completed {
  background-color: var(--success);
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
}

/* --------------------------------------------------------------------------
   26. Scrollbar Styling
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted-foreground);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* --------------------------------------------------------------------------
   27. Responsive Breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .md-hidden { display: none; }

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

  .sidebar {
    position: fixed;
    left: -256px;
    z-index: 50;
    transition: left 250ms ease;
  }

  .sidebar.open {
    left: 0;
  }

  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }

  .modal-content {
    max-width: calc(100% - 16px);
  }

  .toast-container {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

@media (min-width: 769px) {
  .md-flex  { display: flex; }
  .md-block { display: block; }
  .md-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   28. Reduced Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   29. Code Blocks
   -------------------------------------------------------------------------- */

code, pre {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
}

code {
  background-color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
}

pre {
  background-color: #2d2d2d;
  color: #f8f8f2;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   30. App Layout Helpers
   -------------------------------------------------------------------------- */

.app-layout {
  display: flex;
  min-height: 100vh;
}

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

.app-header {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background-color: var(--card);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-content {
  flex: 1;
  padding: 24px;
}

/* --------------------------------------------------------------------------
   End of F/ONE Design System
   ========================================================================== */
