@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0c0c0e;
  --bg-secondary: #141416;
  --bg-tertiary: #1a1a1f;
  --bg-elevated: #1e1e24;
  --bg-hover: #25252d;
  --border: #2a2a35;
  --border-light: #35354a;
  --text-primary: #ececf1;
  --text-secondary: #8e8ea0;
  --text-tertiary: #5a5a6e;
  --accent: #e5a430;
  --accent-hover: #f0b442;
  --accent-muted: rgba(229, 164, 48, 0.12);
  --accent-glow: rgba(229, 164, 48, 0.06);
  --danger: #e5484d;
  --danger-hover: #f06b6e;
  --danger-muted: rgba(229, 72, 77, 0.12);
  --success: #30a46c;
  --info-bg: rgba(59, 130, 246, 0.08);
  --info-border: rgba(59, 130, 246, 0.2);
  --info-text: #93b4f5;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.6);
  --font-sans: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.15s ease;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

small {
  color: var(--text-tertiary);
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

small a {
  color: var(--text-secondary);
}

/* ─── Navbar ───────────────────────────────────────────── */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  transform: rotate(45deg);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-email {
  color: var(--text-tertiary);
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 400;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ─── Container ────────────────────────────────────────── */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 32px 40px;
}

.container-narrow {
  max-width: 700px;
}

/* ─── Auth Pages ───────────────────────────────────────── */
.auth-container {
  min-width: 420px;
  max-width: 500px;
  width: 30vw;
  margin: 0 auto;
  padding: 44px 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-lg), 0 0 80px rgba(229, 164, 48, 0.03);
}

.auth-container h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.auth-subtitle {
  color: var(--text-tertiary);
  margin-bottom: 32px;
  font-size: 14px;
}

.auth-form {
  text-align: left;
}

.auth-switch {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 500;
}

/* ─── Forms ────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
  background: var(--bg-elevated);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238e8ea0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-group select option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.char-limit {
  color: var(--text-tertiary);
  font-weight: 400;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.form-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  margin-top: 28px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all var(--transition);
  font-family: var(--font-sans);
  letter-spacing: -0.1px;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 16px rgba(229, 164, 48, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--danger-muted);
  color: var(--danger);
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: rgba(229, 72, 77, 0.2);
  border-color: rgba(229, 72, 77, 0.3);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: -2px;
}

/* ─── Page Header ──────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.back-link {
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 6px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--accent);
}

/* ─── App Grid ─────────────────────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.app-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.app-card:hover {
  border-color: var(--border-light);
  background: var(--bg-tertiary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.app-card:hover::before {
  opacity: 1;
}

.app-header-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-icon-lg {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.app-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
}

.app-icon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

.app-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.app-bundle {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.app-versions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-ver {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  letter-spacing: -0.2px;
}

.ver-live {
  background: rgba(48, 164, 108, 0.15);
  color: #30a46c;
}

.ver-draft {
  background: var(--accent-muted);
  color: var(--accent);
}

.ver-review {
  background: rgba(59, 130, 246, 0.12);
  color: #6ea8fe;
}

.ver-pending {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
}

.ver-rejected {
  background: var(--danger-muted);
  color: var(--danger);
}

.ver-default {
  background: rgba(142, 142, 160, 0.12);
  color: var(--text-secondary);
}

.app-date {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ─── Empty State ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}

/* ─── Sections ─────────────────────────────────────────── */
.section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.section-actions {
  display: flex;
  gap: 8px;
}

/* ─── Version Bar ──────────────────────────────────────── */
.version-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 20px;
}

.version-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.version-selector label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.version-selector select {
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238e8ea0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.version-selector select:focus {
  outline: none;
  border-color: var(--accent);
}

.version-actions {
  display: flex;
  gap: 8px;
}

/* ─── Tabs ─────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-count {
  display: inline-block;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ─── Language List ────────────────────────────────────── */
.lang-search {
  margin-bottom: 12px;
}

.lang-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: all var(--transition);
}

.lang-search input::placeholder {
  color: var(--text-tertiary);
}

.lang-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.lang-list {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background: var(--bg-tertiary);
}

.lang-list::-webkit-scrollbar {
  width: 6px;
}

.lang-list::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  transition: background var(--transition);
  color: var(--text-primary);
}

.lang-item:last-child {
  border-bottom: none;
}

.lang-item:hover {
  background: var(--bg-hover);
}

.lang-item.lang-disabled {
  opacity: 0.4;
  cursor: default;
}

.lang-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.lang-code {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-left: auto;
}

/* ─── Info Box ─────────────────────────────────────────── */
.info-box {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--info-text);
  line-height: 1.6;
  margin-bottom: 22px;
}

.info-box strong {
  color: #b0c9f7;
}

.info-box a {
  color: #93b4f5;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Table ────────────────────────────────────────────── */
.loc-table {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.loc-table table {
  width: 100%;
  border-collapse: collapse;
}

.loc-table th,
.loc-table td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.loc-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
}

.loc-table tr:last-child td {
  border-bottom: none;
}

.loc-table tr:hover td {
  background: var(--bg-tertiary);
}

.td-truncate {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.td-editable {
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 4px;
}

.td-editable:hover {
  background: var(--accent-muted) !important;
  color: var(--accent);
}

.th-check,
.td-check {
  width: 40px;
  text-align: center;
}

.td-locale {
  cursor: pointer;
  user-select: none;
}

.th-col-check {
  cursor: pointer;
  user-select: none;
}

.th-col-check input[type="checkbox"] {
  margin-right: 5px;
  vertical-align: middle;
  accent-color: var(--accent);
}

.td-check input[type="checkbox"],
.th-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.td-actions {
  white-space: nowrap;
}

.td-actions .btn {
  margin-left: 4px;
}

.td-actions .btn:first-child {
  margin-left: 0;
}

.badge {
  display: inline-block;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.apple-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E") no-repeat center;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E") no-repeat center;
}

.primary-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(229, 164, 48, 0.4);
}

/* ─── Modal ────────────────────────────────────────────── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modalOverlayIn 0.15s ease;
}

@keyframes modalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.2s ease;
}

.modal-content.modal-wide {
  max-width: 720px;
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.modal-close {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-desc a {
  color: var(--accent);
}

.modal-desc strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ─── Settings ─────────────────────────────────────────── */
.settings-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 14px;
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.section-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 18px;
}

.section-desc a {
  color: var(--text-secondary);
}

.fetch-icon {
  cursor: pointer;
  font-size: 14px;
  color: var(--text-tertiary);
  margin-left: 4px;
  transition: all 0.2s;
  display: inline-block;
}

.fetch-icon:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

/* ─── Localization Form ────────────────────────────────── */
.loc-form {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 32px;
}

/* ─── Alert ────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
}

.alert-error {
  background: var(--danger-muted);
  color: var(--danger);
  border: 1px solid rgba(229, 72, 77, 0.25);
}

/* ─── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ─── Custom Dialog ────────────────────────────────────── */
.dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: modalOverlayIn 0.12s ease;
}

.dialog-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.15s ease;
}

.dialog-icon {
  margin-bottom: 14px;
}

.dialog-body {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
  user-select: text;
  -webkit-user-select: text;
  word-break: break-word;
}

.dialog-body p {
  margin-bottom: 4px;
}

.dialog-body p:first-child {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ─── History Version Group ─────────────────────────────── */
.history-version-group {
  margin-bottom: 24px;
}

.history-version-title {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

/* ─── Snapshot View ────────────────────────────────────── */
.snapshot-body {
  max-height: 500px;
  overflow-y: auto;
}

.snapshot-locale {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.snapshot-locale:last-child {
  border-bottom: none;
}

.snapshot-locale h4 {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 8px;
}

.snapshot-fields {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.snapshot-label {
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ─── Progress Overlay ─────────────────────────────────── */
.progress-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: modalOverlayIn 0.12s ease;
}

.progress-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.15s ease;
  min-width: 260px;
}

.progress-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-message {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.progress-detail {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .navbar {
    padding: 0 16px;
  }

  .container {
    padding: 20px 16px;
  }

  .auth-container {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 40px auto;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }
}
