/* AMARBARO shared chrome.
   Class-based, framework-free CSS for the pieces every AMARBARO service needs
   to read as the same product: nav bar, brand lockup, footer, buttons, form
   fields, card surface. Nothing else: layout of a page's own content stays in
   that service's own stylesheet.

   Requires brand/tokens.css to be loaded first (or included ahead of this
   file); every value here is a var(--token), never a hardcoded colour.
   Classes are prefixed `ab-` so they drop into an existing template (Jinja,
   a Python f-string, anything) without colliding with that service's own
   `.nav`, `.footer`, `.card`, etc. */

/* Nav bar */
.ab-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.ab-nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.ab-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: inherit;
  text-decoration: none;
}

.ab-brand-symbol {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-accent);
}

.ab-brand-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text-1);
}

.ab-brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.ab-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.ab-nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.ab-nav-link:hover {
  color: var(--accent);
}

/* Footer */
.ab-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-8) var(--space-6);
  background: var(--bg);
}

.ab-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.ab-footer-links {
  display: flex;
  gap: var(--space-3);
}

.ab-footer-links a {
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.ab-footer-links a:hover {
  color: var(--accent);
}

/* Buttons */
.ab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-md);
  padding: 10px var(--space-5);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.ab-btn-primary {
  color: var(--text-inverse);
  background: var(--accent);
}

.ab-btn-primary:hover:not(:disabled) {
  background: var(--accent-light);
}

.ab-btn-secondary {
  color: var(--text-2);
  background: none;
  border-color: var(--border);
}

.ab-btn-secondary:hover:not(:disabled) {
  color: var(--text-1);
  border-color: var(--text-3);
}

.ab-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.ab-btn-danger {
  color: var(--text-inverse);
  background: var(--alert);
}

.ab-btn-danger:hover:not(:disabled) {
  filter: brightness(1.1);
}

.ab-btn-sm {
  padding: 6px var(--space-3);
  font-size: 13px;
  border-radius: var(--radius);
}

/* Form fields */
.ab-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ab-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.ab-input,
.ab-textarea,
.ab-select {
  /* Fields fill their container by default: a plain <select> or <input
     type=number> otherwise sizes to its own content, which blows out any
     grid/flex row it sits in the moment the row is narrower than that
     content wants. Fine to override per call site with an inline width. */
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 15px;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-4);
}

.ab-textarea {
  resize: vertical;
  min-height: 6rem;
}

/* The caret can't read a CSS custom property inside a data-URI background
   image, so it stays a fixed neutral grey rather than a token: the same
   constraint the pre-brand admin.css select rule already lived with. */
.ab-select {
  appearance: none;
  padding-right: calc(var(--space-4) + 20px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237b8794' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 1 1 .708.708L8 8.293l2.646-2.646a.5.5 0 1 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
}

.ab-input:focus-visible,
.ab-textarea:focus-visible,
.ab-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.ab-hint {
  font-size: 12px;
  color: var(--text-3);
}

.ab-error {
  font-size: 14px;
  color: var(--alert);
  background: var(--alert-soft);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin: 0;
}

/* Card surface */
.ab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}
