* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0; background: #f5f6f8; color: #222; }
a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 1em 0 0.5em; }
pre { white-space: pre-wrap; word-break: break-all; margin: 0; font-size: 0.85em; }
.muted { color: #888; font-size: 0.9em; }

.admin-header { display: flex; align-items: center; gap: 1.5em; padding: 0.6em 1.2em; background: #1a1a2e; color: #fff; }
.admin-header h1 { margin: 0; font-size: 1.1em; }
.admin-header h1 a { color: #fff; }
.admin-header nav { display: flex; gap: 1em; flex: 1; }
.admin-header nav a { color: #cfcfe5; }
.admin-user { display: flex; align-items: center; gap: 0.6em; font-size: 0.9em; }
.admin-user button { background: transparent; border: 1px solid #cfcfe5; color: #fff; padding: 0.2em 0.6em; cursor: pointer; }

.admin-main { padding: 1.2em; max-width: 1400px; margin: 0 auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8em; }
.stat-card { background: #fff; padding: 1em; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); display: flex; flex-direction: column; gap: 0.3em; }
.stat-label { font-size: 0.85em; color: #666; }
.stat-value { font-size: 1.6em; font-weight: 600; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.06); margin-top: 0.6em; }
.data-table th, .data-table td { padding: 0.5em 0.7em; border-bottom: 1px solid #eee; text-align: left; font-size: 0.9em; }
.data-table th { background: #fafafa; font-weight: 600; }

.pager { margin: 1em 0; display: flex; gap: 1em; }
.filter { display: flex; gap: 1em; margin: 0.6em 0; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.3em 1em; background: #fff; padding: 1em; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
dl.kv dt { color: #666; font-size: 0.9em; }
dl.kv dd { margin: 0; font-size: 0.95em; }

form { background: #fff; padding: 1em; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); display: flex; gap: 0.6em; flex-wrap: wrap; align-items: center; margin-top: 0.5em; }
form label { display: flex; gap: 0.4em; align-items: center; font-size: 0.9em; }
form input, form select, form textarea { padding: 0.3em 0.5em; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9em; }
form button { padding: 0.4em 1em; background: #1a73e8; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9em; }
form button:hover { background: #1864c5; }
.inline-form { display: inline-flex; }
.notice-card { max-width: 680px; margin: 3em auto; padding: 1.5em; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.primary-link { display: inline-flex; align-items: center; min-height: 2.4em; padding: 0 0.9em; border-radius: 4px; background: #1a73e8; color: #fff; }
.primary-link:hover { background: #1864c5; text-decoration: none; }

.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #1a1a2e; }
.login-card { background: #fff; padding: 2em; border-radius: 8px; min-width: 320px; text-align: center; }
.login-button { display: inline-block; margin: 1em 0; padding: 0.6em 1.2em; background: #1a73e8; color: #fff; border-radius: 4px; }
.login-note { color: #888; font-size: 0.85em; }

.ui-template-main { display: flex; flex-direction: column; gap: 1.2em; }
.ui-template-section { display: flex; flex-direction: column; gap: 0.7em; }
.ui-template-section-header { display: flex; justify-content: space-between; gap: 1em; align-items: flex-end; }
.ui-template-section-header h2 { margin-bottom: 0.15em; }
.ui-template-badge { display: inline-flex; align-items: center; min-height: 2em; padding: 0 0.7em; border-radius: 999px; background: #e8f0fe; color: #174ea6; font-size: 0.85em; font-weight: 600; white-space: nowrap; }
.ui-template-action { display: inline-flex; align-items: center; min-height: 2em; padding: 0 0.7em; border: 1px solid #1a73e8; border-radius: 4px; background: #fff; font-size: 0.9em; }
.ui-template-status { display: inline-flex; align-items: center; min-height: 1.8em; padding: 0 0.55em; border-radius: 999px; font-size: 0.8em; font-weight: 600; white-space: nowrap; }
.ui-template-status.is-open { background: #e6f4ea; color: #137333; }
.ui-template-status.is-reviewing { background: #fef7e0; color: #b06000; }
.ui-template-status.is-danger { background: #fce8e6; color: #c5221f; }
.ui-template-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 1em; align-items: start; }
.ui-template-panel { margin-top: 0; align-items: stretch; flex-direction: column; }
.ui-template-panel h3 { margin: 0 0 0.2em; }
.ui-template-panel label { align-items: stretch; flex-direction: column; }
.ui-template-search { margin: 0; box-shadow: none; padding: 0; background: transparent; }

@media (max-width: 760px) {
    .ui-template-body .admin-header { align-items: flex-start; flex-direction: column; gap: 0.8em; }
    .ui-template-body .admin-header nav { flex-wrap: wrap; }
    .ui-template-body .admin-user { align-items: flex-start; flex-direction: column; }
    .ui-template-section-header { align-items: stretch; flex-direction: column; }
    .ui-template-split { grid-template-columns: 1fr; }
    .ui-template-body .data-table { display: block; overflow-x: auto; }
}
