:root {
  --fx-bg: #f4f5f7;
  --fx-surface: #ffffff;
  --fx-border: #e2e4e9;
  --fx-text: #1c1e21;
  --fx-muted: #6b7280;
  --fx-primary: #2f5fef;
  --fx-primary-dark: #2347c4;
  --fx-error-bg: #fdecec;
  --fx-error-text: #b3261e;
  --fx-ok-bg: #e8f7ee;
  --fx-ok-text: #1c7a3f;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--fx-bg);
  color: var(--fx-text);
}

.fx-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--fx-surface);
  border-bottom: 1px solid var(--fx-border);
}

.fx-brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.fx-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fx-btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--fx-border);
  background: var(--fx-surface);
  color: var(--fx-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.fx-btn--primary {
  background: var(--fx-primary);
  border-color: var(--fx-primary);
  color: #fff;
}

.fx-btn--primary:hover { background: var(--fx-primary-dark); }

.fx-hero {
  min-height: calc(100vh - 65px);
}

.fx-app { min-height: 100vh; }

.fx-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}

.fx-container--narrow { max-width: 620px; }

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

.fx-muted { color: var(--fx-muted); font-size: 13px; }

.fx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

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

.fx-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--fx-surface);
  border: 1px solid var(--fx-border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.fx-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.fx-card {
  background: var(--fx-surface);
  border: 1px solid var(--fx-border);
  border-radius: 14px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
}

.fx-card h1 { margin-top: 0; font-size: 20px; }

form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
}

form input[type="text"],
form input[type="password"],
form input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--fx-border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--fx-text);
}

form input:focus { outline: 2px solid var(--fx-primary); outline-offset: 1px; }

.fx-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
  cursor: pointer;
}

.fx-checkbox input { width: auto; margin: 0; }

.fx-subblock {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--fx-border);
  border-radius: var(--radius);
  background: #fafbfc;
}

.fx-hint { margin: 6px 0 0; font-size: 12px; color: var(--fx-muted); }

.fx-dropzone {
  margin-top: 8px;
  border: 2px dashed #c7cbd4;
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--fx-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.fx-dropzone.fx-dragover {
  background: #eef2ff;
  border-color: var(--fx-primary);
  color: var(--fx-primary);
}

.fx-file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 12px;
  color: var(--fx-muted);
}

.fx-file-list li { padding: 2px 0; }

button.fx-btn { margin-top: 24px; width: 100%; font-size: 15px; padding: 11px; }

.fx-error { color: var(--fx-error-text); font-size: 13px; margin: 10px 0 0; }
.fx-ok { color: var(--fx-ok-text); font-size: 13px; margin: 10px 0 0; }

.fx-error-box, .fx-ok-box {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}

.fx-error-box { background: var(--fx-error-bg); color: var(--fx-error-text); }
.fx-error-box ul { margin: 0; padding-left: 18px; }
.fx-ok-box { background: var(--fx-ok-bg); color: var(--fx-ok-text); }
.fx-ok-box a { color: inherit; font-weight: 600; }

.fx-section {
  background: var(--fx-surface);
  border: 1px solid var(--fx-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.fx-section h2 { margin: 0 0 12px; font-size: 16px; }
.fx-section form { margin-top: 0; }
.fx-section .fx-subblock form { margin-top: 10px; }

.fx-btn--danger {
  background: var(--fx-error-bg);
  border-color: #f3c6c3;
  color: var(--fx-error-text);
}

.fx-btn--small { padding: 5px 10px; font-size: 12px; margin-top: 0; width: auto; }

.fx-file-list--manage li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--fx-border);
}

.fx-file-list--manage li:last-child { border-bottom: none; }
.fx-file-list--manage form { display: inline; }

.fx-table-scroll { overflow-x: auto; }

.fx-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  white-space: nowrap;
}

.fx-table th, .fx-table td {
  border: 1px solid var(--fx-border);
  padding: 8px 10px;
  text-align: left;
}

.fx-table th {
  background: #f7f8fa;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.fx-table tbody tr:nth-child(even) { background: #fafbfc; }
