/* assets/style.css - minimale strakke styling */
:root {
    --bg: #f5f6f8;
    --card: #fff;
    --text: #1f2430;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2b5cd4;
    --primary-hover: #1e46a8;
    --error: #b91c1c;
    --error-bg: #fee2e2;
    --ok: #166534;
    --ok-bg: #dcfce7;
    --radius: 10px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
body.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.topbar {
    background: #fff;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
}
.topbar .spacer { flex: 1; }
.topbar a { color: var(--primary); text-decoration: none; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.grid {
    display: grid;
    gap: 20px;
    padding: 24px;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    max-width: 1200px;
    margin: 0 auto;
}
.grid .card { max-width: none; }
h1 { margin: 0 0 4px; font-size: 1.5rem; }
h2 { margin: 0 0 16px; font-size: 1.15rem; }
h3 { margin: 24px 0 8px; font-size: 1rem; }
.subtitle { margin: 0 0 20px; color: var(--muted); }
label {
    display: block;
    margin-bottom: 14px;
    font-size: .9rem;
    color: var(--text);
}
input, select, button {
    font: inherit;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    margin-top: 4px;
}
input:focus, select:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
    border-color: transparent;
}
button {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    cursor: pointer;
    font-weight: 600;
}
button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.alert { padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; font-size: .9rem; }
.alert.error { background: var(--error-bg); color: var(--error); }
.result { margin-top: 12px; font-size: .9rem; padding: 8px 10px; border-radius: 6px; min-height: 0; }
.result.ok { background: var(--ok-bg); color: var(--ok); }
.result.err { background: var(--error-bg); color: var(--error); }
.result .notice {
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(255,255,255,.6);
    border-left: 3px solid #2b5cd4;
    font-size: .85rem;
    color: #1f2430;
    border-radius: 4px;
}
.hint {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.35;
}
.hint code {
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: .85em;
    color: #1f2430;
}
.sub-input { display: flex; align-items: stretch; }
.sub-input input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.sub-input .suffix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 6px 6px 0;
    color: var(--muted);
    margin-top: 4px;
    font-size: .9rem;
}
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Autocomplete */
.autocomplete { position: relative; }
.autocomplete-list {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,.08);
    z-index: 10;
    max-height: 320px;
    overflow-y: auto;
}
.ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    line-height: 1.4;
}
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover:not(.ac-disabled) { background: #f3f4f6; }
.ac-icon {
    font-size: 1rem;
    width: 20px;
    flex-shrink: 0;
    text-align: center;
}
.ac-text {
    flex: 1;
    min-width: 0;
}
.ac-item .ac-sub {
    display: block;
    font-size: .8rem;
    color: var(--muted);
    margin-top: 2px;
}
.ac-disabled {
    cursor: not-allowed;
    opacity: .55;
}
.ac-disabled:hover { background: transparent; }
.ac-empty {
    padding: 10px 12px;
    color: var(--muted);
    font-size: .85rem;
    font-style: italic;
}