:root {
  --green-950: #032e24;
  --green-900: #063d2e;
  --green-800: #07533c;
  --green-700: #006b49;
  --green-600: #087e57;
  --green-100: #d9f2e8;
  --green-50: #edf9f4;
  --surface: #fff;
  --surface-alt: #f2f6f4;
  --border: #d2ddd8;
  --text: #17251f;
  --muted: #627169;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--surface-alt);
}

button { border-color: var(--border); color: #263c33; }
.primary { background: var(--green-700); border-color: var(--green-700); }
.primary:hover { background: var(--green-800); border-color: var(--green-800); }
.link { color: #a9e7cf; }
.muted { color: var(--muted); }
.center-card { background: radial-gradient(circle at 25% 10%, #c9eadc, transparent 34%), #eef5f1; }
.auth-card { text-align: center; border-color: #cadbd3; }
.auth-card .stack { text-align: left; }
.auth-logo { width: 76px; height: 76px; border-radius: 18px; object-fit: cover; box-shadow: 0 8px 24px #064b3738; }
.auth-card h1 { margin-bottom: 8px; }

.app-shell { height: 100vh; overflow: hidden; display: flex; flex-direction: column; background: var(--surface-alt); }
.app-shell > .shell { height: 100vh; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.app-shell aside { min-height: 0; background: var(--green-900); color: #d9eee6; padding: 18px 14px 14px; gap: 20px; overflow: hidden; }
.brand { padding: 0 7px; }
.brand img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.brand strong { font-size: 14px; line-height: 1.2; }
.app-shell nav { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 8px; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; color: #a9d8c7; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.nav-add { width: 26px; height: 26px; padding: 0; border: 1px solid #3c745f; background: #0a4a37; color: #dff8ee; border-radius: 7px; font-size: 18px; line-height: 1; }
.nav-add:hover { background: var(--green-800); border-color: #75bda1; }
.project-nav { display: grid; gap: 4px; overflow: auto; min-height: 72px; padding: 1px 2px 8px; }
.project-nav-item { display: grid; gap: 2px; text-align: left; background: transparent; border: 0; color: #d2e7df; padding: 9px 10px; border-radius: 8px; min-width: 0; }
.project-nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-nav-item small { color: #91b9aa; font-size: 11px; }
.project-nav-item:hover, .project-nav-item.active { background: var(--green-800); color: #fff; }
.project-nav-item.active { box-shadow: inset 3px 0 #56d7a5; }
.project-nav-item.active small { color: #bde8d7; }
.nav-empty { font-size: 12px; color: #91b9aa; padding: 4px 10px; }
.admin-nav { display: grid; gap: 4px; border-top: 1px solid #2d6552; padding-top: 15px; margin-top: auto; }
.admin-nav .nav-heading { margin-bottom: 2px; }
.nav { text-align: left; background: transparent; border: 0; color: #b8d4c9; padding: 9px 11px; }
.nav:hover, .nav.active { background: var(--green-800); color: #fff; }
.account { border-color: #2d6552; padding: 13px 8px 0; gap: 4px; }
.account span { font-size: 13px; color: #e2f2ec; }
.account .link { color: #9fd3c0; }

.workspace { min-width: 0; min-height: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.admin-view { flex: 1; min-height: 0; overflow: auto; padding: 20px 22px 22px; }
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.view-header h1 { font-size: 23px; }
.header-actions { display: flex; gap: 9px; }
.project-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.project-toolbar { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; background: var(--surface); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 14px; }
.project-identity { display: grid; min-width: 150px; max-width: 260px; }
.project-identity strong, .project-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-identity span { font-size: 11px; color: var(--muted); }
.voice-field { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: #4a5e55; }
.voice-field select { min-width: 150px; max-width: 230px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 30px 8px 9px; background: #fff; }
.toolbar-spacer { flex: 1; }
.button-link { display: inline-flex; align-items: center; text-decoration: none; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 9px 14px; color: #263c33; }
.button-link:hover { border-color: #789b8b; }
.project-toolbar button { white-space: nowrap; }
#project-more { font-size: 20px; padding: 5px 11px; }

.term-table { flex: 1; min-height: 0; border: 0; border-radius: 0; overflow: auto; background: #fff; }
.term-table table { min-width: 1180px; table-layout: fixed; }
.term-table th { position: sticky; top: 0; z-index: 2; background: #e9f2ee; color: #40594e; }
.term-table th:nth-child(1) { width: 22%; }
.term-table th:nth-child(2) { width: 22%; }
.term-table th:nth-child(3) { width: 30%; }
.term-table th:nth-child(4) { width: 18%; }
.term-table th:nth-child(5) { width: 8%; }
.term-table td { padding: 10px; vertical-align: top; }
.term-table td input, .term-table td textarea { border-color: #dbe4e0; background: #fbfdfc; }
.term-table td input:focus, .term-table td textarea:focus { outline: 2px solid #9dd8c1; border-color: var(--green-600); }
.field-with-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; align-items: start; }
.field-with-actions textarea { min-height: 38px; }
.pronunciation-meta { display: flex; align-items: center; gap: 6px; min-height: 24px; margin-top: 5px; }
.hidden-toggle { display: inline-flex; align-items: center; gap: 5px; color: #4a5e55; font-size: 12px; font-weight: 600; cursor: pointer; }
.term-table .hidden-toggle input, .hidden-toggle input { width: 14px; min-width: 14px; height: 14px; margin: 0; accent-color: var(--green-700); }
.info-hint { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid #8baca0; border-radius: 50%; color: var(--green-800); font: 700 11px/1 "Segoe UI", sans-serif; cursor: help; outline: none; }
.info-hint::after { content: attr(data-tooltip); position: absolute; z-index: 8; left: 50%; top: calc(100% + 7px); width: 290px; transform: translateX(-50%); padding: 9px 11px; border-radius: 8px; background: var(--green-950); color: #fff; box-shadow: 0 8px 24px #032e2440; font-size: 12px; font-weight: 400; line-height: 1.35; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s ease; }
.info-hint:hover::after, .info-hint:focus::after { opacity: 1; visibility: visible; }
.audio-action { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border-color: #b9d1c6; background: var(--green-50); color: var(--green-800); }
.audio-action:hover { background: var(--green-100); border-color: #6db596; }
.audio { display: block; width: min(100%, 310px); height: 32px; margin-top: 7px; }
.row-actions-heading, .row-actions { text-align: center; }
.row-actions { white-space: nowrap; }
.row-actions .status { display: block; margin: 6px 0 9px; }
.status.pending { color: #976400; }
.delete-icon { border: 0; background: transparent; color: #a43d35; padding: 6px; font-size: 18px; }
.delete-icon:hover { background: #fff0ef; }
.badge { background: var(--green-50); color: var(--green-800); }
.status.ready { color: var(--green-700); }
.card { border-color: var(--border); }

@media (max-width: 900px) {
  .app-shell > .shell { grid-template-columns: 210px minmax(0, 1fr); }
  .workspace { padding: 0; }
  .admin-view { padding: 14px; }
  .brand strong { font-size: 12px; }
  .project-toolbar { align-items: flex-end; }
  .project-identity { width: 100%; max-width: none; }
  .toolbar-spacer { display: none; }
}

@media (max-width: 620px) {
  .app-shell > .shell { grid-template-columns: 170px minmax(0, 1fr); }
  .app-shell aside { position: static; flex-direction: column; align-items: stretch; padding: 12px 8px; }
  .app-shell nav { display: flex; }
  .brand img { width: 30px; height: 30px; }
  .brand strong { display: block; font-size: 11px; }
  .workspace { padding: 0; }
  .admin-view { padding: 12px 9px; }
  .project-toolbar { padding: 9px; }
  .project-toolbar .button-link, .project-toolbar button { padding: 7px 9px; }
  .voice-field { width: 100%; }
  .voice-field select { flex: 1; min-width: 0; }
  .account { margin: auto 0 0; border-top: 1px solid #2d6552; padding: 10px 8px 0; }
  .split { grid-template-columns: 1fr; }
}
