/* ═══════════════════════════════════════════════════════════════
   TRIBECA OS — Design System Compartilhado
   ═══════════════════════════════════════════════════════════════ */

@import url('https://api.fontshare.com/v2/css?f[]=clash-display@400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@300;400;500;600;700;800;900&family=Montserrat:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

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

:root {
  --bg:        #0C0C0A;
  --bg2:       #141210;
  --bg3:       #1D1A15;
  --bg-elev:   #201C17;
  --corten:    #7D4222;
  --corten-hi: #9A5530;
  --corten-lo: #4A2814;
  --gold:      #C2B67C;
  --gold-lo:   #7A6E40;
  --ivory:     #EDEAE4;
  --ivory-mut: rgba(237,234,228,.7);
  --ivory-dim: rgba(237,234,228,.4);
  --line:      rgba(237,234,228,.12);
  --line-hi:   rgba(237,234,228,.22);
  --success:   #8AC59A;
  --warning:   #E2B34E;
  --danger:    #C56E5E;

  --display:   'Clash Display', 'Barlow Condensed', sans-serif;
  --cond:      'Barlow Condensed', sans-serif;
  --body:      'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --mono:      'JetBrains Mono', monospace;

  --nav-h: 64px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ivory);
  font-family: var(--body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ─── GLOBAL NAV (all sub-apps) ─── */
.os-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 10, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 32px;
  color: var(--ivory);
  font-family: var(--cond);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 500;
}
.os-nav-brand {
  font-weight: 700;
  letter-spacing: .28em;
  color: var(--ivory);
  font-size: 13px;
  padding-right: 24px;
  border-right: 1px solid var(--line);
}
.os-nav-brand em { color: var(--gold); font-style: normal; font-weight: 500; font-size: 10px; margin-left: 4px; vertical-align: super; }
.os-nav-app {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
  text-transform: none;
  color: var(--gold);
  padding: 4px 10px;
  border: 1px solid var(--gold);
  background: rgba(194, 182, 124, .08);
}
.os-nav-links { display: flex; gap: 22px; margin-left: auto; }
.os-nav-links a { color: var(--ivory-mut); transition: color .2s; }
.os-nav-links a:hover { color: var(--ivory); }
.os-nav-links a.active { color: var(--gold); }
.os-nav-cta {
  padding: 7px 16px;
  background: var(--corten);
  color: var(--ivory);
  border: 1px solid var(--corten);
  transition: background .2s;
  font-weight: 700;
  letter-spacing: .18em;
}
.os-nav-cta:hover { background: var(--corten-hi); }

/* ─── BUTTON SYSTEM ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--cond);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: all .25s cubic-bezier(.16,1,.3,1);
  border: none;
  cursor: pointer;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}
.btn-primary { background: var(--corten); color: var(--ivory); border: 1px solid var(--corten); }
.btn-primary:hover { background: var(--corten-hi); border-color: var(--corten-hi); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ivory); border: 1px solid var(--ivory-dim); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-gold { background: var(--gold); color: var(--bg); border: 1px solid var(--gold); }
.btn-gold:hover { background: transparent; color: var(--gold); }
.btn-sm { padding: 8px 14px; font-size: 10px; }
.btn-lg { padding: 16px 30px; font-size: 12px; }
.btn-block { width: 100%; }

/* ─── COMMON HEADINGS ─── */
.h-display {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.05;
}
.section-tag {
  font-family: var(--cond);
  font-size: 10px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-tag::before {
  content: '';
  width: 26px; height: 1px;
  background: var(--gold);
}

/* ─── PANEL / CARD ─── */
.panel {
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 24px;
  transition: border-color .3s;
}
.panel:hover { border-color: var(--line-hi); }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.panel-head h3 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ivory);
  letter-spacing: -.01em;
}
.panel-head .k {
  font-family: var(--cond);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: .28em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ─── APP LAYOUT ─── */
.app-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--nav-h));
}
.app-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--line);
  padding: 24px 0;
}
.app-sidebar h5 {
  font-family: var(--cond);
  font-size: 9px;
  letter-spacing: .3em;
  color: var(--ivory-dim);
  text-transform: uppercase;
  padding: 12px 24px 8px 24px;
}
.app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: var(--ivory-mut);
  font-size: 13px;
  transition: background .2s, color .2s;
  border-left: 2px solid transparent;
}
.app-sidebar-link:hover { background: var(--bg3); color: var(--ivory); }
.app-sidebar-link.active { color: var(--gold); border-left-color: var(--gold); background: var(--bg3); }
.app-sidebar-link svg { width: 16px; height: 16px; }

.app-main {
  padding: 40px 48px;
  overflow-y: auto;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.app-header h1 {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
}
.app-header .sub {
  font-size: 13px;
  color: var(--ivory-mut);
  margin-top: 6px;
}

/* ─── FORM ELEMENTS ─── */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--cond);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ivory-mut);
  font-weight: 600;
  margin-bottom: 6px;
}
.field label .req { color: var(--corten-hi); }
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ivory);
  font-size: 14px;
  transition: border-color .2s;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 100px; }
.field .radio-group,
.field .chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.field .chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ivory-mut);
  font-family: var(--cond);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
}
.field .chip:hover { border-color: var(--gold); color: var(--gold); }
.field .chip.selected { background: var(--corten); border-color: var(--corten); color: var(--ivory); }

/* ─── STATS / KPIs ─── */
.stat {
  padding: 20px 24px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--corten);
}
.stat .k {
  font-family: var(--cond);
  font-size: 10px;
  color: var(--ivory-dim);
  letter-spacing: .24em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
}
.stat .v {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  color: var(--ivory);
  letter-spacing: -.01em;
  line-height: 1;
}
.stat .d {
  font-size: 11px;
  color: var(--ivory-mut);
  margin-top: 6px;
}
.stat.gold { border-top-color: var(--gold); }
.stat.gold .v { color: var(--gold); }

/* ─── TABLE ─── */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg2);
  color: var(--gold);
  font-family: var(--cond);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ivory-mut);
}
table.data tbody tr:hover { background: var(--bg2); }
table.data .num { text-align: right; font-family: var(--mono); }

/* ─── BADGES ─── */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--cond);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--bg3);
  color: var(--ivory-mut);
  border: 1px solid var(--line);
}
.badge.success { background: rgba(138, 197, 154, .12); color: var(--success); border-color: var(--success); }
.badge.warning { background: rgba(226, 179, 78, .12); color: var(--warning); border-color: var(--warning); }
.badge.danger  { background: rgba(197, 110, 94, .12);  color: var(--danger);  border-color: var(--danger); }
.badge.gold    { background: rgba(194, 182, 124, .12); color: var(--gold);    border-color: var(--gold); }

/* ─── REVEAL ─── */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.rv.in { opacity: 1; transform: translateY(0); }
.rv.d1 { transition-delay: .08s; }
.rv.d2 { transition-delay: .16s; }
.rv.d3 { transition-delay: .24s; }
.rv.d4 { transition-delay: .32s; }

/* ─── UTILS ─── */
.mono { font-family: var(--mono); }
.gold { color: var(--gold); }
.corten { color: var(--corten-hi); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.flex { display: flex; } .flex-1 { flex: 1; } .gap-2 { gap: 8px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 900px) {
  .app-container { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .app-main { padding: 24px 20px; }
  .app-header h1 { font-size: 28px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .os-nav { gap: 16px; padding: 0 16px; }
  .os-nav-links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════════
   BUILD MANAGEMENT SYSTEM — componentes específicos
   ═══════════════════════════════════════════════════════════════ */

/* ── Sub-nav horizontal (dentro do Build) ── */
.build-subnav {
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  padding: 0 48px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.build-subnav::-webkit-scrollbar { display: none; }
.build-subnav a {
  padding: 14px 18px;
  color: var(--ivory-mut);
  font-family: var(--cond);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.build-subnav a:hover { color: var(--ivory); }
.build-subnav a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.build-subnav a .n {
  font-family: var(--mono);
  font-size: 9px;
  background: var(--bg3);
  padding: 2px 6px;
  color: var(--ivory-dim);
  font-weight: 700;
  letter-spacing: 0;
}
.build-subnav a.active .n { background: var(--gold); color: var(--bg); }

/* ── Kanban board ── */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 32px 48px;
}
.kanban-col {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--corten);
  min-height: 500px;
  display: flex;
  flex-direction: column;
}
.kanban-col.todo { border-top-color: var(--ivory-dim); }
.kanban-col.doing { border-top-color: var(--warning); }
.kanban-col.review { border-top-color: var(--gold); }
.kanban-col.done { border-top-color: var(--success); }
.kanban-col-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-col-head h4 {
  font-family: var(--cond);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ivory);
  font-weight: 700;
}
.kanban-col-head .count {
  background: var(--bg3);
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gold);
  font-weight: 700;
}
.kanban-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}
.kanban-card {
  background: var(--bg3);
  border: 1px solid var(--line);
  padding: 12px;
  cursor: grab;
  transition: border-color .2s, transform .2s;
}
.kanban-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .4; }
.kanban-card .phase {
  font-family: var(--cond);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--corten-hi);
  font-weight: 700;
  margin-bottom: 4px;
}
.kanban-card h5 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ivory);
  line-height: 1.25;
  margin-bottom: 6px;
}
.kanban-card .meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ivory-dim);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
}
.kanban-card .meta .avatar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kanban-card .meta .avatar::before {
  content: '';
  width: 14px; height: 14px;
  background: var(--corten);
  border-radius: 50%;
  display: inline-block;
}

/* ── Data table (many uses) ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg2);
}
.data-table thead th {
  padding: 12px 14px;
  background: var(--bg3);
  color: var(--gold);
  font-family: var(--cond);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ivory-mut);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg3); color: var(--ivory); }
.data-table td.num { text-align: right; font-family: var(--mono); }
.data-table td.mono { font-family: var(--mono); font-size: 12px; }
.data-table .strong { color: var(--ivory); font-weight: 500; }

/* ── Metric strip ── */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 24px 48px;
}
.metric-strip > div {
  background: var(--bg2);
  padding: 16px 20px;
}
.metric-strip .k {
  font-family: var(--cond);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--ivory-dim);
  text-transform: uppercase;
  font-weight: 700;
}
.metric-strip .v {
  font-family: var(--display);
  font-size: 24px;
  color: var(--ivory);
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -.01em;
  line-height: 1;
}
.metric-strip .v.gold { color: var(--gold); }
.metric-strip .v.success { color: var(--success); }
.metric-strip .v.warning { color: var(--warning); }
.metric-strip .v.danger { color: var(--danger); }
.metric-strip .d {
  font-size: 11px;
  color: var(--ivory-mut);
  margin-top: 4px;
}

/* ── Content section wrapper ── */
.build-section {
  padding: 32px 48px;
}
.build-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.build-section-head h2 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1;
}
.build-section-head .sub {
  color: var(--ivory-mut);
  font-size: 13px;
  margin-top: 6px;
}
.build-section-head .actions { display: flex; gap: 8px; }

/* ── Avatar (people) ── */
.avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--corten-lo), var(--corten-hi));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  color: var(--ivory);
}
.avatar-circle.g2 { background: linear-gradient(135deg, #4a2c40, #7a5b6b); }
.avatar-circle.g3 { background: linear-gradient(135deg, #2c4a4a, #5b7a7a); }
.avatar-circle.g4 { background: linear-gradient(135deg, #4a4a2c, #7a7a5b); }
.avatar-circle.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-circle.lg { width: 44px; height: 44px; font-size: 15px; }

/* ── Photo grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.photo-item {
  aspect-ratio: 4/3;
  background: var(--bg3);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.photo-item:hover { border-color: var(--gold); transform: scale(1.02); }
.photo-item .placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  color: var(--ivory-dim);
}
.photo-item .meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(12,12,10,.9), transparent);
  font-family: var(--cond);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ivory);
  font-weight: 600;
}
.photo-item .meta .date { color: var(--gold); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ivory-dim);
}
.empty-state svg { width: 60px; height: 60px; opacity: .3; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--display); font-size: 20px; color: var(--ivory-mut); margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 340px; margin: 0 auto; }

/* Mobile */
@media (max-width: 900px) {
  .build-subnav { padding: 0 20px; }
  .kanban { grid-template-columns: 1fr; padding: 20px; }
  .metric-strip { margin: 16px 20px; grid-template-columns: 1fr 1fr; }
  .build-section { padding: 20px; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
}
