/* Foundation tokens shared with partials/design_tokens.php. */
:root {
  --pine-900: #0E2A1E;
  --pine-700: #14503A;
  --pine-500: #1E7A56;
  --pine-50: #E8F1EC;
  --brass-700: #7E6231;
  --brass-500: #A98544;
  --brass-300: #C6A461;
  --brass-50: #F7EFDD;
  --rose-700: #9A3B32;
  --ink: #101A15;
  --ink-2: #2A2E28;
  --muted: #5F635B;
  --bone: #F6F3EC;
  --line: #E6E1D6;
  --line-input: #D8D2C5;
}

body {
  font-family: 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  background-color: var(--bone);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 600;
}

/* Compatibility class for views scheduled in subsequent phases. */
.brand-gradient {
  background-color: var(--pine-700);
  background-image: none;
}

a, button {
  outline-color: var(--pine-700);
}

*:focus-visible {
  outline: 2px solid var(--pine-700);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(20,80,58,.08);
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--pine-700);
}

/* Event Overview — icon-forward detail cards (see resources/views/events/show.php) */
.detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: none;
}

.detail-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px 8px;
}

.detail-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--pine-50);
  color: var(--pine-700);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.detail-item {
  display: flex;
  gap: 14px;
  padding: 21px 4px;
  border-bottom: 1px dashed var(--line);
}

.detail-item:last-child {
  border-bottom: 0;
}

.detail-item .sym {
  width: 28px;
  color: var(--pine-700);
  font-size: 20px;
  flex-shrink: 0;
}

.detail-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
}

.detail-value {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
}

.detail-summary-box {
  padding: 15px 16px;
  border: 1px solid var(--line);
  background: var(--pine-50);
  border-radius: 13px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.member-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.member-row:last-child {
  border-bottom: 0;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pine-50);
  color: var(--pine-700);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.role-pill {
  font-size: 11px;
  border-radius: 999px;
  background: var(--bone);
  color: var(--muted);
  padding: 6px 10px;
  white-space: nowrap;
}

.role-pill.is-owner {
  background: var(--pine-50);
  color: var(--pine-700);
}

/* Toast auto-dismiss animation */
.toast-enter {
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Simple loading spinner used by .loading-spinner */
.loading-spinner {
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--pine-700);
  border-radius: 9999px;
  width: 1.25rem;
  height: 1.25rem;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Generic tab widget (Settings/Profile) — see [data-tabs] in app.js */
.tab-btn {
  position: relative;
  flex-shrink: 0;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ink-2);
}

.tab-btn.is-active {
  color: var(--pine-700);
  border-bottom-color: var(--pine-700);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--line-input);
  border-radius: 9999px;
}

/* App-native table controls: dependency-free search + sortable columns. */
.smart-table-shell {
  position: relative;
}

.smart-table-toolbar {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: min(100%, 36rem);
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  background: #FAF8F3;
}

.smart-table-search {
  position: relative;
  display: block;
  width: min(100%, 24rem);
}

.smart-table-search input {
  width: 100%;
  border: 1px solid var(--line-input);
  border-radius: 0.65rem;
  padding: 0.55rem 3.25rem 0.55rem 2.25rem;
  background: #fff;
  color: var(--ink-2);
  font-size: 0.875rem;
}

.smart-table-search input:focus {
  border-color: var(--pine-700);
  box-shadow: 0 0 0 3px rgba(20,80,58,.08);
  outline-offset: 1px;
}

.smart-table-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
}

.smart-table-clear {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pine-700);
  font-size: 0.75rem;
  font-weight: 600;
}

.smart-table-result {
  flex: none;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.smart-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: inherit;
}

.smart-table-sort:hover {
  color: var(--pine-700);
}

.smart-table-sort-indicator {
  color: var(--muted);
  font-size: 0.8rem;
}

.smart-table th[aria-sort='ascending'] .smart-table-sort-indicator,
.smart-table th[aria-sort='descending'] .smart-table-sort-indicator {
  color: var(--pine-700);
}

.smart-table-empty td {
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
}

.smart-server-search:focus-within {
  border-color: var(--pine-700);
  box-shadow: 0 0 0 3px rgba(20,80,58,.08);
}

@media (max-width: 640px) {
  .smart-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .smart-table-search {
    width: 100%;
  }

  .smart-table-result {
    padding-left: 0.1rem;
  }
}
