/* ============================================================
   ClarioDB — master stylesheet
   ------------------------------------------------------------
   Single source of truth. Change a token here, every page on
   www / my / admin updates after a hard refresh.
   ============================================================ */

:root {
  /* Brand */
  --ink:        #0F1729;
  --teal:       #0D9488;
  --teal-dark:  #0F766E;
  --teal-light: #5EEAD4;
  --teal-mist:  #CCFBF1;

  /* Surfaces & text */
  --cream:      #FAFAF7;
  --surface:    #FFFFFF;
  --text:       #1F1F1D;
  --muted:      #6B6A64;
  --faint:      #9A998F;
  --border:        rgba(15, 23, 41, 0.08);
  --border-strong: rgba(15, 23, 41, 0.16);

  /* Semantic */
  --success: #10B981;
  --warning: #F59E0B;
  --danger:  #DC2626;
  --info:    #0EA5E9;

  /* Shape */
  --radius:    8px;
  --radius-lg: 12px;

  /* Type */
  --font: -apple-system, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- RESET ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- APP SHELL (my, admin) ---------- */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
}

.sidebar {
  background: var(--cream);
  border-right: 0.5px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}
.brand img { width: 26px; height: 26px; }
.brand-name {
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.brand-lockup img {
  width: auto;
  height: 40px;
  display: block;
}
.brand-tag {
  font-size: 10px;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-left: 4px;
}

.section-label {
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 6px 6px;
}

.conn-card {
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.conn-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.conn-meta {
  font-size: 11px;
  color: var(--faint);
  margin-top: 2px;
}

.tables-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.tables-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 6px;
}
.add-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--faint);
  padding: 0;
  line-height: 1;
}
.add-btn:hover { color: var(--teal); }

.filter-input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border: 0.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  margin-bottom: 8px;
}
.filter-input:focus {
  outline: 2px solid var(--teal-mist);
  border-color: var(--teal);
}

.table-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.table-item {
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 0.5px solid transparent;
}
.table-item:hover { background: rgba(15, 23, 41, 0.03); }
.table-item.active {
  background: var(--surface);
  border-color: var(--border-strong);
  font-weight: 500;
}
.table-item .count {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.nav-bottom {
  border-top: 0.5px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  padding: 7px 8px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
}
.nav-item:hover { background: rgba(15, 23, 41, 0.03); }

/* ---------- MAIN PANEL ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
}

.topbar {
  height: 52px;
  border-bottom: 0.5px solid var(--border);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.breadcrumb .sep { color: var(--faint); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switch {
  font-size: 11px;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 6px;
  border: 0.5px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
}
.lang-switch:hover {
  background: var(--cream);
  color: var(--teal);
  border-color: var(--teal);
}

.mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--cream);
  padding: 3px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
}
.mode-toggle button {
  border: 0.5px solid transparent;
  background: transparent;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
}
.mode-toggle button.active {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  font-weight: 500;
}

/* ---------- TOOLBAR + DATA TABLE ---------- */
.toolbar {
  padding: 12px 18px;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.btn {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover {
  background: var(--cream);
  border-color: var(--ink);
}
.btn-accent {
  border-color: var(--teal);
  color: var(--teal);
}
.btn-accent:hover {
  background: var(--teal-mist);
  border-color: var(--teal);
  color: var(--teal-dark);
}
.toolbar-spacer { flex: 1; }
.row-count {
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.table-wrap { flex: 1; overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 500;
  color: var(--muted);
  background: var(--cream);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  white-space: nowrap;
}
table.data thead th .col-badge {
  font-size: 10px;
  color: var(--faint);
  margin-left: 5px;
  font-weight: 400;
}
table.data thead th .col-badge.fk { color: var(--teal); }
table.data tbody td {
  padding: 9px 14px;
  border-bottom: 0.5px solid var(--border);
}
table.data tbody tr:hover { background: var(--cream); }
td.mono { font-family: var(--mono); font-size: 12px; color: var(--ink); }
td.muted { color: var(--muted); }

.pill {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 500;
}
.pill-success  { background: var(--teal-mist); color: var(--teal-dark); }
.pill-warning  { background: #FEF3C7; color: #92400E; }
.pill-danger   { background: #FEE2E2; color: #991B1B; }

/* ---------- SITE SHELL (www) ---------- */
.shell-site { background: var(--surface); }

.site-nav {
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav-links a {
  font-size: 14px;
  color: var(--muted);
}
.site-nav-links a:hover { color: var(--text); }
.site-nav-links .btn { color: var(--teal); }

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 32px;
}
.hero h1 {
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 20px;
  line-height: 1.05;
}
.hero p {
  font-size: 19px;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.5;
  margin: 0 0 36px;
}
.hero .btn-hero {
  display: inline-block;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
  background: var(--teal);
  color: white;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
}
.hero .btn-hero:hover { background: var(--teal-dark); }

/* ---------- SCROLLBARS ---------- */
.table-list::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.table-list::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 41, 0.12);
  border-radius: 4px;
}
