*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #16181c;
  --surface: #1e2126;
  --surface2: #252830;
  --border: #2d3038;
  --text: #e5e7eb;
  --text-muted: #9b9d9f;
  --accent: #ef6136;
  --accent-hover: #d4522a;
  --success: #22c55e;
  --danger: #ef4444;
}

html { font-size: 14px; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }

/* ── Nav ── */
.nav { background: #26282c; border-bottom: 1px solid var(--border); padding: 0 20px; display: flex; align-items: center; height: 52px; gap: 8px; position: sticky; top: 0; z-index: 100; }
.nav-logo { font-weight: 700; font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.nav-logo img { height: 22px; display: block; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-user { font-size: 12px; color: var(--text-muted); }

/* ── Layout ── */
.page { padding: 24px; max-width: 1200px; margin: 0 auto; }
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.page-title { font-size: 20px; font-weight: 700; }
.spacer { flex: 1; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-ghost { background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 5px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-icon { padding: 6px 8px; }
.btn-login { width: 100%; padding: 11px; font-size: 14px; }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.form-control { width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 9px 12px; font-size: 13px; }
.form-control:focus { outline: none; border-color: var(--accent); }

.error-msg { background: #450a0a; border: 1px solid var(--danger); border-radius: 7px; padding: 10px 12px; color: #fca5a5; font-size: 13px; margin-bottom: 12px; }
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-width: 420px; width: 100%; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ── Ops hub tiles ── */
.category-block { margin-bottom: 28px; }
.category-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; transition: border-color 0.15s, transform 0.1s; }
.tile:hover { border-color: var(--accent); }
.tile-link { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.tile-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.tile-name { font-size: 13px; font-weight: 600; color: var(--text); }
.tile-empty { font-size: 11px; color: var(--text-muted); }
.tile-actions { position: absolute; top: 6px; right: 6px; display: none; gap: 4px; }
.tile.edit-mode .tile-actions { display: flex; }
.tile-action-btn { width: 22px; height: 22px; border-radius: 5px; background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 11px; }
.tile-action-btn:hover { color: var(--text); border-color: var(--accent); }
.tile-add { border-style: dashed; cursor: pointer; color: var(--text-muted); }
.tile-add:hover { color: var(--accent); border-color: var(--accent); border-style: dashed; }

@media (max-width: 480px) {
  .page { padding: 16px; }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
