/* =========================================================================
   Digtechs UI — component CSS
   A thin layer on top of colors_and_type.css that produces real components.
   ========================================================================= */

/* Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Sizes */
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-md { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-icon { padding: 0; width: 36px; }
.btn-icon.btn-sm { width: 32px; }
.btn-icon.btn-lg { width: 40px; }

/* Variants */
.btn-main {
  background: var(--brand-blue-700); color: #fff;
}
.btn-main:hover { background: var(--brand-blue-600); }
.btn-main:active { background: var(--brand-blue-800); }

.btn-secondary {
  background: var(--brand-blue-200); color: var(--brand-blue-700);
}
.btn-secondary:hover { background: #a5ddfa; }

.btn-tertiary {
  background: transparent; color: var(--fg-default);
  border-color: var(--border-default);
}
.btn-tertiary:hover { background: var(--bg-muted); }

.btn-destructive {
  background: var(--negative-600); color: #fff;
}
.btn-destructive:hover { background: var(--negative-700); }

.btn-ghost {
  background: transparent; color: var(--fg-default);
}
.btn-ghost:hover { background: var(--bg-muted); }

.btn-ghost-active {
  background: var(--bg-muted); color: var(--fg-default); font-weight: 500;
}

.btn-link {
  background: transparent; color: var(--interactive-default);
  padding: 0; height: auto;
}
.btn-link:hover { text-decoration: underline; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px;
  font-size: 11px; font-weight: 500; line-height: 1;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}
.badge-main       { background: var(--brand-blue-700); color: #fff; }
.badge-secondary  { background: var(--brand-blue-200); color: var(--brand-blue-700); }
.badge-tertiary   { background: #fff; color: var(--fg-muted); border-color: var(--border-default); }
.badge-success    { background: var(--positive-500); color: #fff; }
.badge-destructive{ background: var(--negative-500); color: #fff; }

/* ---------------- Alerts ---------------- */
.alert {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: #fff;
}
.alert-icon { flex: 0 0 auto; color: var(--fg-muted); padding-top: 1px; }
.alert-body .t { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--fg-default); margin-bottom: 2px; }
.alert-body .d { font-size: 12px; color: var(--fg-muted); line-height: 1.4; }
.alert-neutral     { }
.alert-destructive { background: var(--negative-50); border-color: #fecaca; }
.alert-destructive .t { color: var(--negative-700); }
.alert-destructive .d, .alert-destructive .alert-icon { color: var(--negative-600); }
.alert-info        { background: var(--informative-50); border-color: var(--brand-blue-200); }
.alert-info .t { color: var(--brand-blue-700); }
.alert-info .d, .alert-info .alert-icon { color: var(--brand-blue-700); }

/* ---------------- Form fields ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--fg-default); }
.field-hint  { font-size: 12px; color: var(--fg-muted); }
.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--fg-default);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-blue-500);
  box-shadow: var(--focus-ring);
}
.input::placeholder { color: var(--fg-subtle); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.input-group {
  display: flex; align-items: center; gap: 0;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  height: 36px; padding: 0 12px;
}
.input-group .icon { color: var(--fg-subtle); flex-shrink: 0; }
.input-group input { flex: 1; border: 0; background: transparent; outline: none; padding: 0 8px; }

/* ---------------- Cards ---------------- */
.card {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-padded { padding: 20px; }
.card-lg { padding: 24px; }

/* ---------------- Menu ---------------- */
.menu {
  background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px; min-width: 180px;
}
.menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--fg-default); cursor: pointer;
}
.menu-item:hover { background: var(--bg-muted); }
.menu-item .icon { color: var(--fg-muted); }
.menu-sep { height: 1px; background: var(--border-default); margin: 4px 0; }

/* ---------------- Tabs ---------------- */
.tabs { display: inline-flex; border-bottom: 1px solid var(--border-default); gap: 0; }
.tab {
  padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--fg-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--fg-default); }
.tab-active { color: var(--brand-blue-700); border-bottom-color: var(--brand-blue-700); }

/* ---------------- Status dot ---------------- */
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-muted); }
.status-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--positive-500);
}
.status-dot.available::before   { background: var(--positive-500); }
.status-dot.unavailable::before { background: var(--negative-500); }
.status-dot.busy::before        { background: var(--warning-500); }
.status-dot.away::before        { background: var(--fg-subtle); }

/* ---------------- Divider ---------------- */
.divider { height: 1px; background: var(--border-default); }
.divider-v { width: 1px; align-self: stretch; background: var(--border-default); }

/* ---------------- Utilities ---------------- */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.stack-1 { display: flex; flex-direction: column; gap: 4px; }
.stack-2 { display: flex; flex-direction: column; gap: 8px; }
.stack-3 { display: flex; flex-direction: column; gap: 12px; }
.stack-4 { display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1; }
.muted { color: var(--fg-muted); }
.mono-11 { font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); }
