:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1c1e21;
    --muted: #6b7280;
    --border: #e2e4e8;
    --accent: #2563eb;
    --danger: #dc2626;
    --ok: #16a34a;
}

* { box-sizing: border-box; }

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

.topbar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar-brand { font-weight: 700; }
.topbar-nav { display: flex; gap: 1.25rem; flex: 1; }
.topbar-nav a, .topbar-user a { color: var(--text); text-decoration: none; }
.topbar-nav a:hover { color: var(--accent); }
.topbar-user { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); }

.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

h1 { margin-top: 0; }

.tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tabs a { padding: 0.6rem 0.1rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { color: var(--text); }

.form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-width: 480px;
}
.form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--muted);
}
.form label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}
.form input, .form select {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
}
.form fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
}
.form button, button.secondary, button.danger {
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    width: fit-content;
}
button.secondary { background: var(--muted); }
button.danger { background: var(--danger); }
.link-button {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: 0.9rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field-error { color: var(--danger); font-size: 0.85rem; margin: -0.5rem 0 0; }

.alert { padding: 0.7rem 1rem; border-radius: 6px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-ok { background: #dcfce7; color: #166534; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); text-align: left; }
.thumb { width: 96px; height: auto; border-radius: 4px; border: 1px solid var(--border); }

.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--border); font-size: 0.8rem; }
.badge-ok { background: #dcfce7; color: #166534; }

.auth-box { max-width: 360px; margin: 4rem auto; background: var(--surface); padding: 2rem; border-radius: 10px; border: 1px solid var(--border); }

.form-with-map { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.side-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.preview-image { width: 100%; border: 1px solid var(--border); border-radius: 6px; }
.token-box { display: block; background: #eef0f3; padding: 0.6rem; border-radius: 6px; word-break: break-all; font-size: 0.85rem; margin: 0.4rem 0; }
.hint { color: var(--muted); font-size: 0.85rem; }
.empty-state { color: var(--muted); }
.debug-json { background: #1c1e21; color: #d4d4d4; padding: 0.8rem; border-radius: 6px; font-size: 0.75rem; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

.schedule-grid { border-collapse: collapse; background: var(--surface); }
.schedule-grid th, .schedule-grid td { border: 1px solid var(--border); padding: 0.15rem 0.4rem; text-align: center; }
.schedule-grid thead th { background: #f7f8fa; font-size: 0.8rem; }
.schedule-grid tbody th { font-size: 0.75rem; color: var(--muted); font-weight: 400; white-space: nowrap; }
.schedule-grid input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.schedule-grid .link-button { font: inherit; }
