/* =============================================
   VISIMOB DESIGN SYSTEM — Admin overrides
   Loaded only on admin/auth/superadmin pages.
   Public-facing forms keep the construtora's
   own primary_color/logo_url and DO NOT include
   this file.
   ============================================= */

/* ---- VisbyCF font face declarations ---- */
@font-face {
  font-family: 'VisbyCF';
  src: url('/static/fonts/VisbyCF-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'VisbyCF';
  src: url('/static/fonts/VisbyCF-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'VisbyCF';
  src: url('/static/fonts/VisbyCF-DemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'VisbyCF';
  src: url('/static/fonts/VisbyCF-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'VisbyCF';
  src: url('/static/fonts/VisbyCF-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'VisbyCF';
  src: url('/static/fonts/VisbyCF-Heavy.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --visimob-red:        #E8192C;
  --visimob-red-dark:   #C41020;
  --visimob-red-light:  #FF3B4E;
  --visimob-red-subtle: rgba(232, 25, 44, 0.12);
  --visimob-ink:        #181414;
  --visimob-ink-medium: #2C2626;
  --visimob-ink-muted:  #5A5050;
  --visimob-white:      #FFFFFF;
  --visimob-off-white:  #F8F5F5;
  --visimob-surface:    #F2EDED;
  --visimob-border:     #E5DEDE;
  --visimob-shadow-sm:  0 1px 3px rgba(24, 20, 20, 0.12);
  --visimob-shadow-md:  0 4px 16px rgba(24, 20, 20, 0.14);
  --visimob-shadow-lg:  0 12px 40px rgba(24, 20, 20, 0.18);
  --visimob-shadow-brand: 0 8px 32px rgba(232, 25, 44, 0.28);

  /* Bootstrap overrides — set the *-rgb variables so utilities like
     ``bg-primary bg-opacity-10`` (icon-tile circles in dashboard)
     keep working. Solid bg-* classes still resolve to rgba(rgb, 1)
     by default. */
  --bs-primary: #E8192C;
  --bs-primary-rgb: 232, 25, 44;
  --bs-success: #181414;
  --bs-success-rgb: 24, 20, 20;
  --bs-info: #5A5050;
  --bs-info-rgb: 90, 80, 80;
  --bs-warning: #F4A100;
  --bs-warning-rgb: 244, 161, 0;
  --bs-danger: #E8192C;
  --bs-danger-rgb: 232, 25, 44;
  --bs-secondary: #5A5050;
  --bs-secondary-rgb: 90, 80, 80;
  --bs-link-color: #E8192C;
  --bs-link-hover-color: #C41020;
  --bs-link-color-rgb: 232, 25, 44;
  --bs-body-font-family: 'VisbyCF', system-ui, -apple-system, sans-serif;
  --bs-body-color: #181414;
  --bs-body-bg: #F8F5F5;
  --bs-border-color: #E5DEDE;
  --bs-border-radius: 0.25rem;
  --bs-border-radius-sm: 0.25rem;
  --bs-border-radius-lg: 0.375rem;
}

/* ---- Base typography ---- */
body {
  font-family: 'VisbyCF', system-ui, -apple-system, sans-serif;
  background: var(--visimob-off-white);
  color: var(--visimob-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'VisbyCF', system-ui, sans-serif;
  font-weight: 800;
  color: var(--visimob-ink);
  letter-spacing: -0.01em;
}
h1, .h1 { font-weight: 900; }
h5, .h5, h6, .h6 { font-weight: 700; }

/* Section/field labels — design system spec:
   uppercase, weight 600, letter-spacing 0.06em, color fg3. */
.form-label,
label.form-label {
  font-family: 'VisbyCF', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--visimob-ink-muted);
  margin-bottom: 0.4rem;
}

/* Section eyebrow / tag style — design system .label */
.label-up {
  font-family: 'VisbyCF', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--visimob-ink-muted);
}
.label-up.text-red,
.label-red {
  color: var(--visimob-red);
}

/* ---- Sidebar (admin) ---- */
.sidebar {
  min-height: 100vh;
  background: var(--visimob-ink) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.25rem !important;
}
.sidebar h5 {
  color: var(--visimob-white) !important;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}
.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--visimob-white) !important;
  text-decoration: none;
}
.sidebar .nav-link.active {
  background: var(--visimob-red);
  color: var(--visimob-white) !important;
  font-weight: 600;
}
.sidebar .nav-link i {
  width: 1.1rem;
  display: inline-flex;
  justify-content: center;
}
.sidebar hr { border-color: rgba(255, 255, 255, 0.1); }
.sidebar .visimob-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0 0.25rem;
}
.sidebar .visimob-brand img {
  height: 26px;
  width: auto;
  letter-spacing: -0.02em;
}
.sidebar .visimob-brand-divider {
  margin: 0.25rem 0 1rem;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar .tenant-name {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  padding: 0 0.25rem 0.75rem;
}

/* ---- Buttons ----
   Design system spec: uppercase, weight 700, letter-spacing 0.04em.
   Brand voice is bold/confident — sentence-case buttons would dilute
   the visual identity in admin too. */
.btn {
  font-family: 'VisbyCF', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.825rem;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--visimob-red);
  border-color: var(--visimob-red);
  color: var(--visimob-white);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--visimob-red-dark);
  border-color: var(--visimob-red-dark);
  color: var(--visimob-white);
}
.btn-primary:disabled, .btn-primary.disabled {
  background: var(--visimob-red);
  border-color: var(--visimob-red);
  opacity: 0.55;
}
.btn-outline-primary {
  color: var(--visimob-red);
  border-color: var(--visimob-red);
  border-width: 1.5px;
}
.btn-outline-primary:hover {
  background: var(--visimob-red);
  border-color: var(--visimob-red);
  color: var(--visimob-white);
}
.btn-dark {
  background: var(--visimob-ink);
  border-color: var(--visimob-ink);
}
.btn-outline-dark {
  color: var(--visimob-ink);
  border-color: var(--visimob-ink);
  border-width: 1.5px;
}
.btn-link {
  color: var(--visimob-red);
  text-decoration: none;
  font-weight: 600;
}
.btn-link:hover { color: var(--visimob-red-dark); }
.btn-success {
  background: var(--visimob-ink);
  border-color: var(--visimob-ink);
}
.btn-success:hover {
  background: var(--visimob-ink-medium);
  border-color: var(--visimob-ink-medium);
}
.btn-warning {
  background: #F4A100;
  border-color: #F4A100;
  color: var(--visimob-ink);
}
.btn-outline-warning {
  color: #B36F00;
  border-color: #F4A100;
  border-width: 1.5px;
}
.btn-outline-warning:hover {
  background: #F4A100;
  border-color: #F4A100;
  color: var(--visimob-ink);
}
.btn-danger,
.btn-outline-danger:hover {
  background: var(--visimob-red);
  border-color: var(--visimob-red);
  color: var(--visimob-white);
}
.btn-danger:hover {
  background: var(--visimob-red-dark);
  border-color: var(--visimob-red-dark);
}
.btn-outline-danger {
  color: var(--visimob-red);
  border-color: var(--visimob-red);
  border-width: 1.5px;
}
.btn-secondary {
  background: var(--visimob-ink-muted);
  border-color: var(--visimob-ink-muted);
}
.btn-outline-secondary {
  color: var(--visimob-ink-muted);
  border-color: var(--visimob-border);
  border-width: 1.5px;
}
.btn-outline-secondary:hover {
  background: var(--visimob-ink);
  border-color: var(--visimob-ink);
  color: var(--visimob-white);
}
.btn-sm {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.85rem;
}

/* ---- Cards ----
   Design system spec: white bg, no border, shadow-md, radius-md (8px). */
.card {
  background: var(--visimob-white);
  border: none;
  border-radius: 8px;
  box-shadow: var(--visimob-shadow-md);
}
.card.border-0 { box-shadow: var(--visimob-shadow-md); }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--visimob-border);
  font-family: 'VisbyCF', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--visimob-ink);
  letter-spacing: -0.005em;
  padding: 0.85rem 1.1rem;
}
.shadow-sm { box-shadow: var(--visimob-shadow-sm) !important; }
.shadow    { box-shadow: var(--visimob-shadow-md) !important; }
.shadow-lg { box-shadow: var(--visimob-shadow-lg) !important; }

/* ---- Forms ---- */
.form-control,
.form-select {
  font-family: 'VisbyCF', sans-serif;
  border: 1.5px solid var(--visimob-border);
  border-radius: 4px;
  padding: 0.55rem 0.85rem;
  color: var(--visimob-ink);
  background: var(--visimob-white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--visimob-red);
  box-shadow: 0 0 0 3px rgba(232, 25, 44, 0.12);
  outline: none;
}
.form-control[disabled],
.form-control[readonly] {
  background: var(--visimob-surface);
  color: var(--visimob-ink-muted);
}
.form-text {
  color: var(--visimob-ink-muted);
  font-size: 0.825rem;
}
.input-group-text {
  background: var(--visimob-surface);
  border: 1.5px solid var(--visimob-border);
  color: var(--visimob-ink-muted);
  font-weight: 500;
}

/* ---- Form switches & checkboxes ---- */
.form-check-input:checked {
  background-color: var(--visimob-red);
  border-color: var(--visimob-red);
}
.form-check-input:focus {
  border-color: var(--visimob-red);
  box-shadow: 0 0 0 0.2rem rgba(232, 25, 44, 0.18);
}

/* ---- Tables ----
   Spec: Visimob Design System / preview/comp_density.html (.dt).
   Comfortable preset: padding 13/18px, font 13px, header 10px uppercase
   weight 800, letter-spacing 0.1em. No zebra striping — apenas
   border-bottom em cada linha. */
.table {
  --bs-table-color: var(--visimob-ink);
  --bs-table-bg: var(--visimob-white);
  --bs-table-hover-bg: rgba(232, 25, 44, 0.04);
  --bs-table-striped-bg: transparent;
  font-family: 'VisbyCF', sans-serif;
  font-size: 0.825rem;
  background: var(--visimob-white);
  border: 1px solid var(--visimob-border);
  border-collapse: collapse;
  margin-bottom: 0;
}
.table thead th {
  background: var(--visimob-off-white);
  color: var(--visimob-ink-muted);
  font-weight: 800;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--visimob-border);
  border-top: none;
  vertical-align: middle;
}
.table tbody td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--visimob-border);
  border-top: none;
  font-weight: 500;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover > * { background-color: rgba(232, 25, 44, 0.04); }

/* Neutralize Bootstrap striped — design system não usa zebra. */
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: transparent;
}
.table-responsive { border-radius: 0; overflow-x: auto; }

/* ---- Badges ---- */
.badge {
  font-family: 'VisbyCF', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
  padding: 0.35em 0.7em;
  border-radius: 9999px;
}
.badge.bg-primary { background-color: var(--visimob-red) !important; }
.badge.bg-success { background-color: var(--visimob-ink) !important; }
.badge.bg-warning { background-color: #F4A100 !important; color: var(--visimob-ink) !important; }
.badge.bg-danger  { background-color: var(--visimob-red) !important; }
.badge.bg-info    { background-color: var(--visimob-ink-muted) !important; color: var(--visimob-white); }
.badge.bg-secondary { background-color: var(--visimob-ink-muted) !important; }

/* ---- Alerts ---- */
.alert {
  font-family: 'VisbyCF', sans-serif;
  border-radius: 4px;
  border-width: 0;
  border-left: 4px solid;
  padding: 0.85rem 1rem;
}
.alert-success {
  background-color: rgba(24, 20, 20, 0.06);
  color: var(--visimob-ink);
  border-left-color: var(--visimob-ink);
}
.alert-danger {
  background-color: rgba(232, 25, 44, 0.08);
  color: var(--visimob-red-dark);
  border-left-color: var(--visimob-red);
}
.alert-warning {
  background-color: rgba(244, 161, 0, 0.10);
  color: #8a5b00;
  border-left-color: #F4A100;
}
.alert-info {
  background-color: var(--visimob-surface);
  color: var(--visimob-ink-medium);
  border-left-color: var(--visimob-ink-muted);
}

/* ---- Pagination ---- */
.page-link {
  color: var(--visimob-red);
  border-color: var(--visimob-border);
}
.page-item.active .page-link {
  background-color: var(--visimob-red);
  border-color: var(--visimob-red);
}

/* ---- Misc admin tweaks ---- */
a {
  color: var(--visimob-red);
  text-decoration: none;
}
a:hover { color: var(--visimob-red-dark); text-decoration: underline; }
.text-primary { color: var(--visimob-red) !important; }
.text-danger  { color: var(--visimob-red-dark) !important; }
.text-success { color: var(--visimob-ink) !important; }
.text-info    { color: var(--visimob-ink-muted) !important; }
.text-warning { color: #B36F00 !important; }
.text-muted   { color: var(--visimob-ink-muted) !important; }

/* Background utilities resolve via --bs-*-rgb in the :root block
   above. Bootstrap's own .bg-primary { background-color: rgba(var(
   --bs-primary-rgb), var(--bs-bg-opacity, 1)) } now produces brand
   colors, and bg-opacity-10/25/50 modifiers continue working
   correctly for icon-tile circles in the dashboard. */

hr { border-color: var(--visimob-border); }

main {
  background: var(--visimob-off-white);
}

/* ---- Toast/flash overrides ---- */
.alert-dismissible {
  border-radius: 4px;
}

/* Code blocks (correlation IDs etc) */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--visimob-surface);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: var(--visimob-red-dark);
  font-size: 0.85em;
}
