/* shared.css — Common styles for all management UIs */

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* Base */
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #0f0f0f; color: #e0e0e0; min-height: 100vh; padding: 24px; }
.container { max-width: 900px; margin: 0 auto; }
h1 { color: #7cb3ff; margin-bottom: 4px; font-size: 1.4rem; }
.subtitle { color: #888; font-size: 0.85rem; margin-bottom: 24px; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tab { padding: 8px 20px; border: 1px solid #333; background: #1a1a1a; color: #aaa; cursor: pointer; border-radius: 6px 6px 0 0; font-size: 0.9rem; transition: all 0.15s; }
.tab:hover { background: #222; }
.tab.active { background: #222; color: #7cb3ff; border-bottom-color: #222; }
.panel { display: none; background: #1a1a1a; border: 1px solid #333; border-radius: 0 8px 8px 8px; padding: 20px; }
.panel.active { display: block; }

/* Forms */
label { display: block; color: #aaa; font-size: 0.8rem; margin-bottom: 4px; margin-top: 12px; }
label:first-child { margin-top: 0; }
input, textarea { width: 100%; padding: 8px 10px; background: #111; border: 1px solid #333; border-radius: 4px; color: #e0e0e0; font-family: 'Consolas', monospace; font-size: 0.85rem; }
input:focus, textarea:focus { outline: none; border-color: #7cb3ff; }
textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
.row { display: flex; gap: 12px; }
.row > div { flex: 1; }

/* Buttons */
button { padding: 6px 14px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.82rem; transition: background 0.15s; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:hover { filter: brightness(0.9); }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }
.btn-ghost { background: none; border: 1px solid #444; color: #aaa; }
.btn-ghost:hover { border-color: #7cb3ff; color: #7cb3ff; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { text-align: left; color: #888; font-weight: 600; padding: 8px 10px; border-bottom: 2px solid #333; }
td { padding: 8px 10px; border-bottom: 1px solid #222; vertical-align: middle; }
tr:hover td { background: #111; }
.empty-row { text-align: center; color: #555; padding: 24px; }

/* Stats */
.stats { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.stat { background: #111; border: 1px solid #333; border-radius: 6px; padding: 10px 16px; min-width: 100px; }
.stat-val { font-size: 1.3rem; font-weight: 700; color: #7cb3ff; }
.stat-label { font-size: 0.75rem; color: #888; }

/* Toolbar */
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; align-items: flex-end; flex-wrap: wrap; }
.toolbar input { max-width: 260px; }

/* Content card */
.content-card { background: #1a1a1a; border: 1px solid #333; border-radius: 8px; padding: 20px; }

/* Modals */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #1a1a1a; border: 1px solid #333; border-radius: 8px; padding: 24px; width: 100%; max-width: 420px; }
.modal h2 { font-size: 1.1rem; color: #e0e0e0; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Response boxes */
.response-box { margin-top: 12px; padding: 10px; background: #111; border: 1px solid #333; border-radius: 4px; font-family: 'Consolas', monospace; font-size: 0.82rem; white-space: pre-wrap; word-break: break-all; min-height: 40px; display: none; }
.response-box.show { display: block; }
.response-box.error { border-color: #f87171; color: #f87171; }
.response-box.success { border-color: #4ade80; color: #4ade80; }

/* JSON validation */
.json-status { margin-top: 6px; font-size: 0.78rem; min-height: 18px; font-family: monospace; }
.json-status.valid { color: #4ade80; }
.json-status.invalid { color: #f87171; }
textarea.json-invalid { border-color: #f87171; }
textarea.json-valid { border-color: #4ade80; }

/* Quick fields grid */
.quick-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* Badges */
.user-badge { display: inline-block; background: #111; border: 1px solid #333; border-radius: 4px; padding: 2px 8px; font-family: 'Consolas', monospace; font-size: 0.8rem; color: #7cb3ff; margin-left: 8px; }
.owner-badge { background: #2a1a00; border-color: #f59e0b; color: #f59e0b; }

/* Auth error */
.auth-error { text-align: center; padding: 60px 20px; color: #f87171; }
