* { box-sizing: border-box; }
body { font-family: Arial, sans-serif; margin: 0; background: #f5f7fa; color: #1f2937; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 18px; margin-bottom: 16px; overflow-x: auto; }
h1, h2 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.btn { display: inline-block; padding: 8px 12px; border-radius: 8px; border: 0; background: #2563eb; color: #fff; text-decoration: none; cursor: pointer; }
.btn.secondary { background: #475569; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; color: #334155; }
.field-full { grid-column: 1 / -1; }
.checkbox-field label { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; }
input[type="text"], input[type="password"], input[type="file"], select {
  width: 100%;
  max-width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}
.error { color: #b91c1c; font-weight: 700; }
.nav { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.small { color: #64748b; font-size: 13px; }
.actions-cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.permissions-user-block {
  margin-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 14px;
}
.permissions-user-title {
  margin: 0 0 10px 0;
}
.permissions-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.permissions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.permissions-filter {
  margin-bottom: 10px;
  max-width: 360px;
}
.permissions-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}
code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; }
.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
  font-size: 15px;
}
.icon-btn:hover { background: #e2e8f0; }
.icon-btn.danger { color: #b91c1c; border-color: #fca5a5; background: #fff1f2; }
.icon-btn.danger:hover { background: #ffe4e6; }
.actions-cell form { margin: 0; }
.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.launcher-admin-filter {
  margin-bottom: 12px;
  max-width: 420px;
}
.launcher-admin-table-wrapper {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.launcher-admin-table {
  min-width: 1500px;
}
.launcher-admin-table th,
.launcher-admin-table td {
  font-size: 12px;
  padding: 9px 10px;
}
.launcher-admin-table th {
  position: relative;
}
.launcher-no-wrap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.launcher-icon-preview {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border: 1px solid #d9dee5;
  border-radius: 6px;
  background: #ffffff;
  padding: 2px;
}
.icon-fallback {
  font-size: 10px;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 3px 5px;
  background: #f8fafc;
}

/* Keep first 4 columns visible while scrolling */
.launcher-admin-table th:nth-child(1),
.launcher-admin-table td:nth-child(1) {
  position: sticky;
  left: 0;
  min-width: 70px;
  max-width: 70px;
  background: #fff;
  z-index: 3;
}

.launcher-admin-table th:nth-child(2),
.launcher-admin-table td:nth-child(2) {
  position: sticky;
  left: 70px;
  min-width: 130px;
  max-width: 130px;
  background: #fff;
  z-index: 3;
}

.launcher-admin-table th:nth-child(3),
.launcher-admin-table td:nth-child(3) {
  position: sticky;
  left: 200px;
  min-width: 130px;
  max-width: 130px;
  background: #fff;
  z-index: 3;
}

.launcher-admin-table th:nth-child(4),
.launcher-admin-table td:nth-child(4) {
  position: sticky;
  left: 330px;
  min-width: 110px;
  max-width: 110px;
  background: #fff;
  z-index: 3;
}

.launcher-admin-table thead th:nth-child(-n+4) {
  background: var(--table-header);
  z-index: 4;
}

.launcher-admin-table td:nth-child(-n+4) {
  box-shadow: 1px 0 0 #e5e7eb;
}

.launcher-admin-table td.actions-cell {
  white-space: nowrap;
}

.launcher-admin-table .actions-cell {
  flex-wrap: nowrap;
}

:root {
  --bg: #f4f6f8;
  --card-bg: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #d9dee5;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --table-header: #eef2f7;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  --radius: 14px;
}

.page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 18px;
}

.header { margin-bottom: 24px; }

.header-card {
  background: linear-gradient(135deg, #1f2937, #334155);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.header-card h1 {
  margin: 0 0 8px 0;
  font-size: 30px;
  font-weight: 700;
}

.header-card p {
  margin: 0;
  color: #dbe4ef;
  font-size: 15px;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.header-link {
  display: inline-flex;
  color: #bfdbfe;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.header-link:hover {
  color: #dbeafe;
  border-bottom-color: #dbeafe;
}

.content-card,
.java-card,
.guide-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.content-card { overflow: hidden; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.toolbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toolbar-title strong { font-size: 17px; }

.toolbar-title span {
  font-size: 13px;
  color: var(--muted);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 430px;
  justify-content: flex-end;
}

.table-filter {
  width: 100%;
  max-width: 250px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

.table-filter:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--muted);
  background: #f9fafb;
  white-space: nowrap;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead { background: var(--table-header); }

th {
  text-align: left;
  padding: 13px 16px;
  font-size: 13px;
  color: #374151;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

.mono {
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  color: #334155;
}

.env {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.download-button,
.java-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.download-button:hover,
.java-download-link:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.java-card,
.guide-card {
  margin-top: 18px;
  padding: 22px;
}

.java-card h2,
.guide-card h2 {
  margin: 0 0 10px 0;
  font-size: 20px;
  color: #1f2937;
}

.java-card p,
.guide-card p {
  margin: 0 0 12px 0;
  color: #374151;
  font-size: 14px;
}

.java-card ul {
  margin: 0 0 14px 18px;
  padding: 0;
  color: #374151;
  font-size: 14px;
}

.guide-steps {
  margin: 0;
  padding-left: 20px;
  color: #374151;
  font-size: 14px;
}

.guide-steps li { margin-bottom: 10px; }

.guide-code {
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 13px;
  color: #1f2937;
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.filter-empty {
  display: none;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.filter-empty.visible { display: block; }

.footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 700px) {
  .container { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  th, td { padding: 8px; }

  .page { padding: 18px 12px; }
  .header-card { padding: 22px; }
  .header-card h1 { font-size: 24px; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .toolbar-actions {
    max-width: none;
    width: 100%;
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
  }
  .table-filter { max-width: none; }
  .badge { width: 100%; justify-content: center; }
  table { min-width: 680px; }
}

@media (max-width: 420px) {
  .header-card h1 { font-size: 21px; }
  .header-card p { font-size: 14px; }
  .toolbar { padding: 16px; }
}

.login-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(700px 360px at 15% -10%, rgba(37, 99, 235, 0.28), transparent 60%),
    radial-gradient(760px 380px at 100% 110%, rgba(30, 64, 175, 0.22), transparent 62%),
    linear-gradient(145deg, #eef2ff 0%, #f8fafc 38%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 500px;
}

.login-card-modern {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.14);
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.login-logo {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #cbd5e1;
  background: #fff;
  box-shadow: 0 6px 16px rgba(30, 41, 59, 0.12);
}

.login-brand h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  color: #0f172a;
}

.login-brand p {
  margin: 4px 0 0 0;
  color: #475569;
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 8px;
}

.login-form label {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
  margin-top: 6px;
}

.login-form input {
  height: 40px;
}

.login-submit {
  margin-top: 10px;
  height: 42px;
  font-size: 14px;
}

.login-help {
  margin: 12px 0 0 0;
  color: #64748b;
  font-size: 12px;
}

.login-error {
  margin: 4px 0 10px 0;
}
