* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; margin: 0; padding: 24px; background: #f0f4f8; color: #1a202c; }
h1 { margin-top: 0; font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin-top: 0; margin-bottom: 16px; }
nav { margin-bottom: 24px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
nav a { margin-right: 20px; color: #2b6cb0; text-decoration: none; font-weight: 500; }
nav a:hover { text-decoration: underline; }
.card { background: white; padding: 24px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e2e8f0; }
th { background: #f7fafc; font-weight: 600; }
th:last-child:not([colspan]), td:last-child:not([colspan]) { text-align: right; }
button { padding: 10px 18px; cursor: pointer; background: #2b6cb0; color: white; border: none; border-radius: 6px; font-weight: 500; }
button:hover { background: #2c5282; }
button.secondary { background: #718096; }
button.secondary:hover { background: #4a5568; }
button.danger { background: #c53030; }
button.danger:hover { background: #9b2c2c; }
button:disabled { background: #a0aec0; cursor: not-allowed; }
button:disabled:hover { background: #a0aec0; }
input, select { padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 6px; margin-right: 8px; margin-bottom: 8px; }
input:focus, select:focus { outline: none; border-color: #2b6cb0; }
.form-row { margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-row-actions > button:last-of-type { margin-left: auto; }
.refresh-row { text-align: right; margin-top: 12px; }
.form-row label { min-width: 100px; font-weight: 500; }
.form-hint { font-size: 0.9em; color: #718096; margin: -8px 0 12px 0; }
.form-actions { margin-top: 16px; }
.form-actions button { margin-right: 8px; }
.message { padding: 12px; border-radius: 6px; margin-bottom: 12px; }
.message.success { background: #c6f6d5; color: #22543d; }
.message.error { background: #fed7d7; color: #742a2a; }
.message.info { background: #bee3f8; color: #2c5282; }
.collapsible { cursor: pointer; user-select: none; }
.collapsible::after { content: " ▼"; font-size: 0.8em; opacity: 0.7; }
.collapsible.collapsed::after { content: " ▶"; }
.collapsible-content { margin-top: 12px; }
.collapsible.collapsed + .collapsible-content { display: none; }
.inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
a.download { color: #2b6cb0; font-weight: 500; }
a.download:hover { text-decoration: underline; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: white; padding: 24px; border-radius: 10px; max-width: 440px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.modal h3 { margin-top: 0; }
.modal h3.edit { color: #2b6cb0; }
.modal h3.warning { color: #c53030; }
.modal p { margin-bottom: 20px; }
.modal .form-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.modal .form-row > label { flex: 0 0 130px; font-weight: 500; padding-top: 10px; line-height: 1.2; }
.modal .form-row > input:not([type="hidden"]),
.modal .form-row > select { flex: 1 1 0; min-width: 0; margin: 0; }
.modal .form-row > select[multiple] { min-height: 120px; }
.modal .form-actions { display: flex; gap: 8px; margin-top: 20px; }
.modal .form-actions button { width: auto; flex: 1; }
.ecowitt-ok { color: #38a169; }
.ecowitt-fail { color: #c53030; }
.project-expand { cursor: pointer; display: inline-block; width: 20px; user-select: none; }
.project-expand:hover { opacity: 0.8; }
.project-stations-row td { background: #f7fafc; padding: 12px 12px 12px 36px; vertical-align: top; }
.project-stations-content { font-size: 0.95em; }
.station-section { margin-bottom: 16px; }
.station-section h4 { margin: 0 0 8px 0; font-size: 0.9em; color: #4a5568; }
.station-section table { width: 100%; font-size: 0.9em; border-collapse: collapse; table-layout: fixed; }
.station-section th { text-align: left; padding: 6px 8px; font-weight: 600; background: #edf2f7; }
.station-section td { padding: 6px 8px; border-bottom: 1px solid #e2e8f0; }
.station-section col:nth-child(1) { width: 40%; }
.station-section col:nth-child(2) { width: 12%; }
.station-section col:nth-child(3) { width: 12%; }
.station-section col:nth-child(4) { width: 12%; }
.station-section col:nth-child(5) { width: 24%; }
.report-status { margin-top: 8px; }
.login-card { max-width: 400px; margin: 48px auto; }
.login-card .form-row > label { min-width: 90px; }
.login-card .form-actions { flex-direction: column; }
.login-card .form-actions button { width: 100%; }
.login-register-link { margin-top: 16px; font-size: 0.95em; color: #718096; }
.login-register-link a { color: #2b6cb0; }
.oauth-buttons { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.oauth-btn { display: block; padding: 10px 18px; text-align: center; border-radius: 6px; font-weight: 500; text-decoration: none; color: #1a202c; border: 1px solid #cbd5e0; }
.oauth-btn:hover { background: #f7fafc; }
.oauth-google { background: #fff; }
.oauth-microsoft { background: #fff; }
#login-screen { display: none; }
#login-screen.visible { display: block; }
#app-screen { display: none; }
#app-screen.visible { display: block; }
