:root {
    --primary: #ff8a00;
    --primary-dark: #cc6e00;
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1a1a1a;
    --muted: #6b7280;
    --border: #e5e7eb;
    --error: #dc2626;
    --success: #16a34a;
}
* { 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;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 0;
}
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--primary); text-decoration: none; }
nav { display: flex; gap: 1.25rem; align-items: center; }
nav a { color: var(--text); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--primary); }
.user-info { color: var(--muted); font-size: 0.9rem; }
.logout-btn {
    background: transparent; border: 1px solid var(--border); padding: 0.4rem 0.8rem;
    border-radius: 6px; cursor: pointer; font-size: 0.85rem;
}
.logout-btn:hover { background: var(--bg); }
main { padding: 2rem 0; min-height: 70vh; }
footer { background: #fff; border-top: 1px solid var(--border); padding: 1rem 0; color: var(--muted); font-size: 0.85rem; }
footer a { color: var(--muted); }

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }

.btn-primary, .btn-secondary, .btn-mini {
    display: inline-block; padding: 0.55rem 1.1rem; border-radius: 8px;
    border: 1px solid transparent; font-weight: 600; cursor: pointer;
    text-decoration: none; font-size: 0.95rem; line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-large { padding: 0.85rem 1.5rem; font-size: 1rem; width: 100%; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-mini { padding: 0.3rem 0.65rem; font-size: 0.8rem; background: #fff; color: var(--text); border-color: var(--border); }
.btn-mini:hover { background: var(--bg); }
.btn-mini.ok, .btn-primary.ok { background: var(--success); color: #fff; border-color: var(--success); }
.btn-copy { width: 100%; margin-top: 0.75rem; }

.login-card, .form-card, .result-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 1.5rem; max-width: 480px; margin: 0 auto;
}
.result-card { max-width: none; }
.form-card { max-width: 600px; }
form label { display: block; margin: 1rem 0 0.35rem; font-weight: 600; font-size: 0.92rem; }
form input, form textarea {
    width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--border);
    border-radius: 8px; font-size: 1rem; font-family: inherit;
}
form input:focus, form textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
form textarea { resize: vertical; }
form button[type=submit] { margin-top: 1.25rem; }
.hint { color: var(--muted); font-size: 0.82rem; margin: 0.3rem 0 0; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.data-table th, .data-table td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.data-table th { background: var(--bg); font-weight: 600; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tr:last-child td { border-bottom: none; }
.data-table code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

.status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }
.status-active { background: #dcfce7; color: #15803d; }
.status-inactive { background: #fee2e2; color: #991b1b; }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-state p { margin-bottom: 1rem; }

.result-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; }
@media (max-width: 800px) { .result-grid { grid-template-columns: 1fr; } }
.result-card dl { margin: 0; }
.result-card dt { font-weight: 600; color: var(--muted); font-size: 0.85rem; margin-top: 0.7rem; }
.result-card dd { margin: 0.15rem 0 0; word-break: break-all; }
.result-card code { background: var(--bg); padding: 3px 8px; border-radius: 6px; font-size: 0.92em; }
.copy-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.copy-row input { flex: 1; }
.result-card textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.85rem; }

/* === v1.1 additions === */
.header-actions { display: flex; gap: .5rem; align-items: center; }
.btn-secondary { display: inline-block; padding: .55rem 1rem; background: #f4f4f4; color: #222; border: 1px solid #ccc; border-radius: 6px; text-decoration: none; cursor: pointer; font-size: .95rem; }
.btn-secondary:hover { background: #e8e8e8; }
.btn-link { color: #ff8a00; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.kv-table { border-collapse: collapse; margin: 1rem 0; }
.kv-table th { text-align: left; padding: .5rem 1rem .5rem 0; color: #666; font-weight: 500; vertical-align: top; }
.kv-table td { padding: .5rem 0; }
.key-box { display: flex; gap: 1rem; align-items: center; padding: 1rem; background: #fff8f0; border: 1px solid #ffd9a8; border-radius: 8px; margin: 1rem 0; }
.key-box code { font-size: 1rem; word-break: break-all; flex: 1; }
.hint { color: #777; font-size: .9rem; }
