:root { --gap: 6px; --cell: 70px; font-family: system-ui, Arial, sans-serif; }
body { margin: 0; }
header { position: sticky; top: 0; background: #ffffff; border-bottom: 1px solid #eee; padding: 12px 16px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#status { margin-left: 8px; font-size: 12px; color: #666; }
.grid-wrapper { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; column-gap: var(--gap); row-gap: var(--gap); padding: 16px; align-items: start; }
.grid-corner { width: 44px; height: 32px; }
.column-labels { display: grid; grid-template-columns: repeat(var(--cols, 9), var(--cell)); gap: var(--gap); justify-items: center; font-size: 12px; font-weight: 600; color: #555; }
.row-labels { display: grid; grid-template-rows: repeat(var(--cols, 9), var(--cell)); gap: var(--gap); justify-items: center; width: 44px; }
.row-label, .col-label { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #555; }
.grid { display: grid; grid-template-columns: repeat(var(--cols, 9), var(--cell)); gap: var(--gap); }
.cell { width: var(--cell); height: var(--cell); border: 1px solid #ddd; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; user-select: none; }
.cell.highlight { outline: 3px solid gold; }
.cell .label { font-size: 12px; text-align: center; padding: 2px; line-height: 1.1; }
.search-results { display: none; flex-direction: column; gap: 8px; padding: 0 16px; }
.search-results.has-query { display: flex; }
.search-summary { font-size: 14px; color: #333; }
.search-results-list { display: flex; flex-wrap: wrap; gap: 8px; }
.search-result-btn { border: 1px solid #ccc; border-radius: 999px; background: #f5f5f5; padding: 6px 12px; cursor: pointer; font: inherit; transition: background .2s, color .2s, border-color .2s; }
.search-result-btn:hover { background: #e8e8e8; }
.search-result-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.menu { position: absolute; background: #fff; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: none; flex-direction: column; min-width: 120px; z-index: 10; }
.menu button { padding: 8px 10px; border: 0; background: #fff; text-align: left; cursor: pointer; }
.menu button:hover { background: #f5f5f5; }
dialog { border: none; border-radius: 12px; padding: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.2); }
dialog form { display: grid; gap: 8px; }
dialog label { display: grid; gap: 4px; font-size: 14px; }
dialog input { padding: 8px; border: 1px solid #ccc; border-radius: 8px; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.secondary { background:#eee; }
.danger { background: #fee2e2; color: #b91c1c; }
.danger:hover { background: #fecaca; }
.restore-description { font-size: 14px; color: #4b5563; margin: 0 0 8px; }
.backup-list { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.backup-section + .backup-section { border-top: 1px solid #e5e7eb; padding-top: 10px; }
.backup-section-title { font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.backup-option { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.backup-option:hover { border-color: #2563eb; box-shadow: 0 4px 10px rgba(37,99,235,0.08); }
.backup-option input { margin-top: 4px; }
.backup-details { display: flex; flex-direction: column; gap: 2px; }
.backup-name { font-weight: 600; color: #1f2937; }
.backup-meta { font-size: 12px; color: #4b5563; }
.backup-empty { font-size: 14px; color: #6b7280; margin: 12px 0; }
.toolbar .user-chip { background: #e0ecff; color: #1d4ed8; border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.toolbar .logout-link { text-decoration: none; border: 1px solid #2563eb; color: #2563eb; padding: 6px 14px; border-radius: 8px; font-size: 14px; transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.toolbar .logout-link:hover { background: #2563eb; color: #fff; border-color: #1d4ed8; }
.login-page { min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center; background: #f1f5f9; }
.login-wrapper { width: 100%; display: flex; justify-content: center; padding: 24px; }
.login-card { background: #fff; border-radius: 16px; box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12); padding: 32px; max-width: 420px; width: min(420px, 100%); display: grid; gap: 20px; text-align: center; }
.login-logo { max-width: 120px; width: 100%; margin: 0 auto; }
.login-card h1 { margin: 0; font-size: 24px; color: #0f172a; }
.login-form { display: grid; gap: 16px; text-align: left; }
.login-form label { display: grid; gap: 6px; font-size: 14px; color: #1f2937; }
.login-form input { padding: 10px 12px; border-radius: 8px; border: 1px solid #cbd5f5; font-size: 15px; }
.login-form input:focus { outline: 2px solid #2563eb; outline-offset: 1px; border-color: #2563eb; }
.login-form button { background: #2563eb; color: #fff; border: none; border-radius: 8px; padding: 10px 14px; font-size: 15px; cursor: pointer; transition: background-color 0.2s, box-shadow 0.2s; }
.login-form button:hover { background: #1d4ed8; box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25); }
.login-error { margin: 0; color: #b91c1c; font-weight: 600; }
.login-hint { margin: 0; font-size: 13px; color: #475569; }
.login-hint code { background: #e2e8f0; padding: 2px 5px; border-radius: 6px; font-size: 12px; }
