:root {
  color-scheme: light dark;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eaf0fe;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #dde1e7;
  --text: #1c2128;
  --text-muted: #667085;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --warning: #92400e;
  --warning-bg: #fef3c7;
  --success: #067647;
  --success-bg: #e7f7ef;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 1px rgba(16, 24, 40, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #6d9bff;
    --accent-hover: #8bafff;
    --accent-soft: #1c2b4d;
    --bg: #14161a;
    --surface: #1c1f26;
    --border: #30343d;
    --text: #e6e8eb;
    --text-muted: #8a909c;
    --danger: #ff8073;
    --danger-bg: #3a1c1c;
    --warning: #f5c563;
    --warning-bg: #3a2f13;
    --success: #5fd196;
    --success-bg: #163527;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  max-width: 760px;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

nav a:hover {
  color: var(--text);
}

nav .nav-links a {
  margin-right: 1.25rem;
}

nav .nav-links a.active {
  color: var(--accent);
}

nav .nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

nav .nav-user {
  color: var(--text-muted);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--surface);
  font-weight: 500;
}

.btn-logout:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

p {
  margin: 0.5rem 0;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

button {
  margin-top: 1.5rem;
  padding: 0.6rem 1.3rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover {
  background: var(--accent-hover);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-top: 1rem;
}

.card-success {
  border-left: 3px solid var(--success);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
}

.badge.status-pending,
.badge.status-crawling {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.status-crawled,
.badge.status-ticket_created {
  background: var(--success-bg);
  color: var(--success);
}

.badge.status-crawl_failed,
.badge.status-ticket_failed {
  background: var(--danger-bg);
  color: var(--danger);
}

.warning-banner {
  background: var(--warning-bg);
  color: var(--warning);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.92rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  text-align: left;
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

tbody tr:hover {
  background: var(--bg);
}

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

td a:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}
