@font-face {
  font-family: 'Inter';
  src: url('../../fonts/Inter-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}


:root {
  --color-bg: #0d0f1a;
  --color-surface: rgba(255, 255, 255, 0.06);
  --color-surface-hover: rgba(255, 255, 255, 0.1);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-text: #e8eaf0;
  --color-text-muted: rgba(232, 234, 240, 0.5);
  --color-accent: #6c63ff;
  --color-accent-glow: rgba(108, 99, 255, 0.35);
  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-danger: #f87171;
  --color-in: #4ade80;
  --color-out: #f87171;
  --color-rest: #60a5fa;
  --color-travel: #f59e0b;
  --color-remote: #a78bfa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.3);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --brand-gradient: linear-gradient(135deg, #6c63ff, #a855f7);
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(255, 255, 255, 0.18);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.32);
  --popover-surface: rgb(25, 25, 25);
  --popover-border-default: rgba(255, 255, 255, 0.25);
  --tooltip-surface: rgb(25, 25, 25);
  --tooltip-border: rgba(255, 255, 255, 0.25);
  --tooltip-text: #e9edf6;
  --popover-icon-default: rgba(255, 255, 255, 0.6);
  --button-icon-size: 18px;
  --toast-surface: rgb(25, 25, 25);
  --toast-border: rgba(255, 255, 255, 0.25);
  --toast-text: #e9edf6;
  --toast-shadow: none;
}

html[data-theme="light"] {
  --color-bg: #f6f7fb;
  --color-surface: rgba(15, 23, 42, 0.06);
  --color-surface-hover: rgba(15, 23, 42, 0.1);
  --color-border: rgba(15, 23, 42, 0.14);
  --color-text: #0f172a;
  --color-text-muted: rgba(15, 23, 42, 0.55);
  --color-accent: #2952ff;
  --color-accent-glow: rgba(41, 82, 255, 0.25);
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-in: #16a34a;
  --color-out: #dc2626;
  --color-rest: #2563eb;
  --color-travel: #ea580c;
  --color-remote: #7c3aed;
  --brand-gradient: linear-gradient(135deg, #2952ff, #14b8a6);
  --scrollbar-track: rgba(15, 23, 42, 0.06);
  --scrollbar-thumb: rgba(15, 23, 42, 0.26);
  --scrollbar-thumb-hover: rgba(15, 23, 42, 0.38);
  --popover-surface: #ffffff;
  --popover-border-default: rgba(15, 23, 42, 0.28);
  --tooltip-surface: #ffffff;
  --tooltip-border: rgba(15, 23, 42, 0.28);
  --tooltip-text: #0f172a;
  --popover-icon-default: rgba(15, 23, 42, 0.55);
  --toast-surface: #ffffff;
  --toast-border: rgba(15, 23, 42, 0.2);
  --toast-text: #0f172a;
  --toast-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-text);
  box-shadow: none;
  transition: background-color 9999s ease-in-out 0s;
  caret-color: var(--color-text);
}

input:autofill,
textarea:autofill,
select:autofill {
  box-shadow: none;
  color: var(--color-text);
  caret-color: var(--color-text);
}

h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
}

/* Glass card */
.glass {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.02) 55%, rgba(0,0,0,0.0) 100%),
    var(--color-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: var(--radius);
  box-shadow: none;
}

.glass-strong {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 55%, rgba(0,0,0,0.0) 100%),
    rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  box-shadow: none;
}

html[data-theme="light"] .modal.glass-strong {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

html[data-theme="light"] .modal.glass-strong .modal-subtitle,
html[data-theme="light"] .modal.glass-strong .form-label,
html[data-theme="light"] .modal.glass-strong .summary-label {
  color: rgba(15, 23, 42, 0.6);
}

.blue {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.06) 0%, rgba(108, 99, 255, 0.03) 55%, rgba(108, 99, 255, 0) 100%);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: var(--radius);
    box-shadow: none;
}
.blue-strong {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.15) 0%, rgba(108, 99, 255, 0.05) 50%);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: var(--radius);
    box-shadow: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  text-decoration: none;
}

.btn:disabled,
.btn.is-disabled,
.action-btn:disabled,
.action-btn.is-disabled,
.type-action-btn:disabled,
.type-action-btn.is-disabled,
.entry-action-btn:disabled,
.entry-action-btn.is-disabled {
  opacity: 0.4;
  cursor: default;
}

/* Unified icon size inside button-like controls */
:is(button, a.btn, a.action-btn, .type-action-btn, .entry-action-btn) svg {
  width: var(--button-icon-size);
  height: var(--button-icon-size);
  min-width: var(--button-icon-size);
  min-height: var(--button-icon-size);
  flex-shrink: 0;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: none;
}

.btn-primary:hover {
  background: #7b74ff;
  transform: translateY(-1px);
  box-shadow: none;
}

.btn-ghost {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-surface-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.2);
  color: var(--color-danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.3);
}

.btn-success {
  background: rgba(74, 222, 128, 0.2);
  color: var(--color-success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.btn-success:hover {
  background: rgba(74, 222, 128, 0.3);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 18px;
}

/* Form elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.5rem;
}

.form-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5em 0.7em;
  color: var(--color-text);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
  width: 100%;
  box-shadow: none;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: none;
  background: rgba(108, 99, 255, 0.08);
}

.form-input:disabled {
  opacity: 0.4;
  cursor: default;
}

.form-input::placeholder {
  color: rgba(232, 234, 240, 0.3);
}

html[data-theme="light"] .form-input::placeholder {
  color: rgba(15, 23, 42, 0.45);
}

select.form-input {
  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='rgba(232,234,240,0.5)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.select-wrap {
  position: relative;
  width: 100%;
}

.select-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
}

.select-ui {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--color-text);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
  cursor: pointer;
  box-shadow: none;
}

.select-ui svg,
.select-ui .select-chevron {
  font-size: 16px;
  color: var(--color-text-muted);
}

.select-value {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.select-emoji {
  font-size: 16px;
}

.select-item .select-value {
  gap: 12px;
}

.select-wrap.open .select-ui {
  border-color: var(--color-accent);
  background: rgba(108, 99, 255, 0.08);
}

.select-wrap.is-disabled .select-ui {
  opacity: 0.4;
  cursor: default;
}

.select-wrap.is-disabled .select-ui,
.select-wrap.is-disabled .select-ui * {
  cursor: default;
}

.select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgb(25, 25, 25);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: none;
  padding: 6px;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  z-index: 1200;
}

.select-wrap.open .select-menu { display: block; }

.select-menu.floating {
  position: fixed;
  display: block;
  right: auto;
}

.select-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font-size: 13px;
}

.select-search {
  margin-bottom: 10px;
}

.select-search input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--color-text);
  font-size: 13px;
  outline: none;
  font-family: 'Inter', sans-serif;
  box-shadow: none;
}

.select-empty {
  padding: 8px 10px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.select-item:hover {
  background: rgba(255,255,255,0.06);
}

.select-item.selected {
  background: rgba(108, 99, 255, 0.18);
  color: #dbe0ff;
}

.select-item:disabled {
  opacity: 0.4;
  cursor: default;
}

.select-wrap.config-select-inline { width: 180px; }
.select-wrap.filter-select { width: 160px; }
.select-wrap .select-ui { width: 100%; }

html[data-theme="light"] .select-ui {
  background: rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .select-wrap.open .select-ui {
  background: rgba(41, 82, 255, 0.08);
}

html[data-theme="light"] .select-menu {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .select-item:hover {
  background: rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .select-item.selected {
  background: rgba(41, 82, 255, 0.14);
  color: #0f172a;
}

html[data-theme="light"] .select-search input {
  background: rgba(15, 23, 42, 0.04);
}

.popover,
.field-error {
  --popover-border: var(--popover-border-default);
  --popover-icon: var(--popover-icon-default);
  position: absolute;
  z-index: 20;
  display: none;
  max-width: 260px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--popover-border);
  background: var(--popover-surface);
  border: 1px solid var(--popover-border);
  border-radius: 8px;
  box-shadow: none;
  pointer-events: none;
  top: calc(100% + 6px);
  left: 0;
}

.popover.is-visible,
.field-error.is-visible { display: block; }

.popover::after,
.field-error::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--popover-surface);
  border-left: 1px solid var(--popover-border);
  border-top: 1px solid var(--popover-border);
  top: -5px;
  left: 12px;
  transform: rotate(45deg);
}

.popover[data-popover="top"],
.field-error[data-popover="top"] {
  top: auto;
  bottom: calc(100% + 6px);
}

.popover[data-popover="top"]::after,
.field-error[data-popover="top"]::after {
  top: auto;
  bottom: -5px;
  transform: rotate(225deg);
}

.popover[data-popover="right"],
.field-error[data-popover="right"] {
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%);
}

.popover[data-popover="right"]::after,
.field-error[data-popover="right"]::after {
  top: 50%;
  left: -5px;
  transform: translateY(-50%) rotate(315deg);
}

.popover[data-popover="left"],
.field-error[data-popover="left"] {
  top: 50%;
  left: auto;
  right: calc(100% + 8px);
  transform: translateY(-50%);
}

.popover[data-popover="left"]::after,
.field-error[data-popover="left"]::after {
  top: 50%;
  left: auto;
  right: -5px;
  transform: translateY(-50%) rotate(135deg);
}

.popover--normal {
  --popover-border: rgba(255, 255, 255, 0.25);
  --popover-icon: rgba(255, 255, 255, 0.6);
}

.popover--info {
  --popover-border: rgba(96, 165, 250, 0.75);
  --popover-icon: rgba(96, 165, 250, 0.95);
}

.popover--warning {
  --popover-border: rgba(250, 204, 21, 0.75);
  --popover-icon: rgba(250, 204, 21, 0.95);
}

.popover--error,
.field-error {
  --popover-border: rgba(241, 20, 20, 0.75);
  --popover-icon: rgba(241, 20, 20, 0.95);
}

.popover--normal,
.popover--info,
.popover--warning,
.popover--error,
.field-error {
  color: var(--popover-border);
}

.popover.has-icon,
.popover--info,
.popover--warning,
.popover--error,
.field-error {
  padding-left: 30px;
}

.popover.has-icon::before,
.popover--info::before,
.popover--warning::before,
.popover--error::before,
.field-error::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background-color: var(--popover-icon);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.popover--info::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 10v6'/%3E%3Cpath d='M12 7h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 10v6'/%3E%3Cpath d='M12 7h.01'/%3E%3C/svg%3E");
}

.popover--warning::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M12 3l9 16H3z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M12 3l9 16H3z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.popover--error::before,
.field-error::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M15 9l-6 6'/%3E%3Cpath d='M9 9l6 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M15 9l-6 6'/%3E%3Cpath d='M9 9l6 6'/%3E%3C/svg%3E");
}

/* Tooltips */
.has-tooltip { position: relative; }

.tooltip {
  position: absolute;
  z-index: 25;
  display: none;
  max-width: 220px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--tooltip-text);
  background: var(--tooltip-surface);
  border: 1px solid var(--tooltip-border);
  border-radius: 8px;
  box-shadow: none;
  pointer-events: none;
  top: auto;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.tooltip::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--tooltip-surface);
  border-left: 1px solid var(--tooltip-border);
  border-top: 1px solid var(--tooltip-border);
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(225deg);
}

.has-tooltip:hover .tooltip,
.has-tooltip:focus-visible .tooltip {
  display: block;
}

.has-tooltip[data-popover="bottom"] .tooltip {
  top: calc(100% + 6px);
  bottom: auto;
}

.has-tooltip[data-popover="bottom"] .tooltip::after {
  top: -5px;
  bottom: auto;
  transform: translateX(-50%) rotate(45deg);
}

.has-tooltip[data-popover="right"] .tooltip {
  top: 50%;
  bottom: auto;
  left: calc(100% + 8px);
  transform: translateY(-50%);
}

.has-tooltip[data-popover="right"] .tooltip::after {
  top: 50%;
  left: -5px;
  bottom: auto;
  transform: translateY(-50%) rotate(315deg);
}

.has-tooltip[data-popover="left"] .tooltip {
  top: 50%;
  bottom: auto;
  left: auto;
  right: calc(100% + 8px);
  transform: translateY(-50%);
}

.has-tooltip[data-popover="left"] .tooltip::after {
  top: 50%;
  left: auto;
  right: -5px;
  bottom: auto;
  transform: translateY(-50%) rotate(135deg);
}

/* Toggle / Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  transition: var(--transition);
}

html[data-theme="light"] .switch-slider {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.switch-slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 1px;
  top: 50%;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  transform: translateY(-50%);
}

html[data-theme="light"] .switch-slider:before {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.switch input:checked + .switch-slider {
  background: var(--color-accent);
}

.switch input:checked + .switch-slider:before {
  transform: translate(20px, -50%);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-inactive {
  background: rgba(248, 113, 113, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.badge-admin {
  background: rgba(108, 99, 255, 0.15);
  color: #6e81d9;
  border: 1px solid rgba(108, 99, 255, 0.3);
}

.badge-root {
  background: rgba(251, 191, 36, 0.15);
  color: var(--color-warning);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-user-status {
  gap: 6px;
}

.badge-user-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  animation: badge-pulse 2s infinite;
}

.badge-user-status.badge-active::before {
  background: var(--color-success);
}

.badge-user-status.badge-inactive::before {
  background: var(--color-danger);
}

.badge-user-status.badge-admin::before {
  background: #6e81d9;
}

.badge-user-status.badge-root::before {
  background: var(--color-warning);
}

@keyframes badge-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* Avatar */
.avatar {
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 48px; height: 48px; font-size: 18px; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }

.avatar-gradient {
  background: var(--brand-gradient);
  color: white;
}

.avatar-photo {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-accent { color: var(--color-accent); }
.text-rest { color: var(--color-rest); }

.sidebar-logo-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-img {
  max-width: 100px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.sidebar-section-bottom {
  margin-top: auto;
  padding-top: 32px;
}

.link-danger { color: var(--color-danger); }
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--color-surface-hover);
}
.inline-form { display: inline; }
.row-clickable { cursor: pointer; }
.btn-sm { font-size: 13px; }
.btn-xs { font-size: 12px; padding: 8px 14px; }
.btn-full { width: 100%; justify-content: center; }

.is-hidden { display: none; }

.btn.is-loading {
  pointer-events: none;
  opacity: 0.9;
  gap: 0;
  justify-content: center;
  cursor: default;
  transform: none;
}

.btn-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,0.38);
  border-top-color: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: inline-block;
  animation: btn-spin 0.8s linear infinite;
}

.btn-primary.is-loading:disabled {
  background: var(--color-accent);
  color: #fff;
  opacity: 0.92;
}

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

/* Toasts */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--toast-surface);
  color: var(--toast-text);
  border: 1px solid var(--toast-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: var(--toast-shadow);
  min-width: 220px;
  text-align: center;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(0);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.toast.hide {
  opacity: 0;
  transform: translateY(8px);
}

.toast-success {
  border-color: #166534;
  color: #ecfdf5;
  background: #166534;
}
.toast-error {
  border-color: #991b1b;
  color: #fee2e2;
  background: #991b1b;
}
.toast-info {
  border-color: #1d4ed8;
  color: #dbeafe;
  background: #1d4ed8;
}
.toast-warning {
  border-color: #92400e;
  color: #fef3c7;
  background: #92400e;
}

.toast-text { flex: 1; }

/* Sidebar */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #0b0d14;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: transform 0.25s ease;
}

html[data-theme="light"] .sidebar {
  background: #f0f2f8;
  border-right-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .sidebar-link {
  color: rgba(15, 23, 42, 0.7);
}

html[data-theme="light"] .sidebar-link:hover,
html[data-theme="light"] .sidebar-link.active {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

html[data-theme="light"] .sidebar-section-label {
  color: rgba(15, 23, 42, 0.45);
}

.sidebar-logo {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  padding: 8px 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  width: 100%;
}

.sidebar-logo span {
  color: var(--color-accent);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link.theme-toggle-sidebar {
  border: none;
  background: none;
  padding: 10px 12px;
  justify-content: flex-start;
  gap: 8px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  width: auto;
  height: auto;
  font-weight: 500;
}

.sidebar-link.theme-toggle-sidebar .theme-toggle-label {
  font-weight: 500;
  display: inline-flex;
}

.sidebar-link.theme-toggle-sidebar svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sidebar-link svg,
.sidebar-toggle svg,
.sidebar-close svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sidebar-link:hover, .sidebar-link.active {
  background: var(--color-surface);
  color: var(--color-text);
}

.sidebar-link.active {
  background: rgba(108, 99, 255, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(108, 99, 255, 0.2);
}

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

.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.sidebar-toggle,
.sidebar-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle:hover,
.sidebar-close:hover {
  background: var(--color-surface-hover);
}

.sidebar-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1100;
}

.sidebar-toggle.inline {
  position: static;
  z-index: auto;
}

.sidebar-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1050;
}

.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1024px) {
  .main-content { padding: 24px; }
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 1200;
    padding: 20px 16px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle,
  .sidebar-close { display: inline-flex; }
  .sidebar-logo { padding: 8px 12px 16px; }
  .sidebar-section-bottom { margin-top: auto; }
}

@media (max-width: 640px) {
  .main-content { padding: 16px; }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .table-wrapper { border-radius: var(--radius); }
  table { min-width: 520px; }
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
}

.page-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition);
}

tbody tr:hover {
  background: var(--color-surface);
}

tbody td {
  padding: 14px 16px;
  font-size: 14px;
  vertical-align: middle;
}

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

/* Top nav bar for user screens */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--color-border);
  gap: 16px;
}

.topbar-brand {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.topbar-brand span {
  color: var(--color-accent);
}

/* Stats card */
.stat-card {
  padding: 20px;
  border-radius: var(--radius);
  min-width: 0;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
}

.stat-sub {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Progress bar */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

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

/* Animated gradient background */
.grad-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.grad-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orb-float 8s ease-in-out infinite;
  opacity: 0.5;
  display: none;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

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

.fade-in {
  animation: fade-in 0.5s ease forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

/* Calendar shared styles */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  width: 520px; max-width: calc(100vw - 32px);
  padding: 32px; animation: fade-in 0.3s ease;
}

.modal-title {
  font-size: 20px; font-weight: 700;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.week-card {
  margin-bottom: 16px;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.weekday-btn {
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,0.04);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.weekday-btn.active {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
  border-color: rgba(74, 222, 128, 0.35);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
  padding-bottom: 96px;
}

.calendar-grid.is-readonly .day-cell {
  cursor: default;
}

.month-card {
  padding: 14px;
}

.month-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 10px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.month-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-cell {
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 6px;
  text-align: left;
  min-height: 46px;
  cursor: pointer;
  color: var(--color-text);
  transition: var(--transition);
}

.day-cell.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.day-cell.day-off {
  opacity: 0.5;
}

.day-cell.day-holiday {
  border-color: rgba(248,113,113,0.5);
  background: rgba(248,113,113,0.12);
}

.day-cell.day-vacation {
  border-color: rgba(148,163,184,0.5);
  background: rgba(148,163,184,0.18);
}

.calendar-grid .day-cell {
  border-color: rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.calendar-grid .day-cell.day-holiday {
  border-color: rgba(248,113,113,0.5);
  background: rgba(248,113,113,0.12);
}

.calendar-grid .day-cell.day-vacation {
  border-color: rgba(148,163,184,0.5);
  background: rgba(148,163,184,0.18);
}


.calendar-grid:not(.is-readonly) .day-cell:not(.empty):hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}

.day-num {
  font-weight: 700;
  font-size: 12px;
}

.day-label {
  display: block;
  font-size: 9px;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.2;
}

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

.year-nav .week-nav-btn,
.year-nav button {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  text-decoration: none;
}

.year-nav .week-nav-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.year-nav .is-disabled {
  opacity: 0.4;
  cursor: default;
}

.year-label {
  font-weight: 700;
  font-size: 16px;
  min-width: 60px;
  text-align: center;
}

.save-bar-inline {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.save-bar {
  position: fixed;
  bottom: 0;
  left: 220px;
  right: 0;
  padding: 16px 32px;
  background: rgba(13, 15, 26, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 100;
}

html[data-theme="light"] .save-bar {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(15, 23, 42, 0.12);
}

.save-actions {
  display: flex;
  gap: 10px;
}

.save-info {
  font-size: 13px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-popover {
  position: absolute;
  z-index: 1400;
  background: rgb(25,25,25);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 10px;
  box-shadow: none;
  width: 240px;
  display: none;
}

html[data-theme="light"] .day-popover {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
}

.day-popover.open { display: block; }

.popover-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.popover-actions {
  margin-bottom: 12px;
}

.popover-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  padding: 4px;
  border-radius: 10px;
}

html[data-theme="light"] .popover-tabs {
  background: rgba(15, 23, 42, 0.08);
}

.popover-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.popover-tab.active {
  background: var(--color-accent);
  color: white;
}

@media (max-width: 640px) {
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; justify-content: center; }
  .save-bar { left: 0; padding: 12px 16px; }
  .save-actions { width: 100%; flex-direction: column; }
  .save-actions .btn { width: 100%; justify-content: center; }
}

.popover-label {
  display: none;
  margin-top: 12px;
}

.popover-label .form-label {
  display: block;
  margin-bottom: 8px;
}

.popover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
}

.popover-delete-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: var(--transition);
}

.popover-delete-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--color-danger);
}

.table-title {
  font-weight: 700;
  margin-bottom: 12px;
}

@media (max-width: 1500px) {
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row .form-group { width: 100%; }
  .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
  .calendar-grid { grid-template-columns: 1fr; }
  .weekdays { grid-template-columns: repeat(4, 1fr); }
}

.card-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.week-card {
  padding: 18px;
  margin-bottom: 16px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}
