:root {
  --ink: #1b2430;
  --ink-soft: #5b6472;
  --line: #e4e7ec;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --accent: #3457d5;
  --accent-soft: #eaefff;
  --danger: #d64545;
  --ok: #2f9e58;
  --radius: 10px;
  font-family: 'Segoe UI', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* --- Login --- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f6f7f9 0%, #eef1fb 100%);
}
.login-card {
  width: 340px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(20,30,60,0.06);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.brand h1 { font-size: 16px; margin: 0; }
.brand p { font-size: 12px; color: var(--ink-soft); margin: 2px 0 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.login-card label, .modal-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--ink-soft);
}
.login-card input, .modal-card input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; color: var(--ink);
}
.login-card button[type="submit"], .primary-btn {
  background: var(--accent); color: white; border: none;
  padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.secondary-btn {
  background: white; border: 1px solid var(--line); color: var(--ink);
  padding: 10px 14px; border-radius: 8px; font-size: 14px;
}
.error-text { color: var(--danger); font-size: 12.5px; min-height: 14px; margin: 0; }

/* --- Dashboard layout --- */
.dashboard { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #17203a; color: #cfd6e8;
  display: flex; flex-direction: column; padding: 20px 14px;
  flex-shrink: 0;
}
.sidebar .brand h1 { color: white; }
.sidebar .brand p { color: #8b93ab; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; flex: 1; }
.nav-item {
  text-align: left; background: transparent; border: none; color: #cfd6e8;
  padding: 10px 12px; border-radius: 8px; font-size: 14px;
}
.nav-item:hover { background: #212c4d; }
.nav-item.active { background: var(--accent); color: white; }
.sidebar-footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: #8b93ab; padding-top: 12px; border-top: 1px solid #2a3556;
}
.link-btn { background: none; border: none; color: #8b93ab; text-decoration: underline; font-size: 12.5px; }

.content { flex: 1; padding: 32px 40px; overflow-y: auto; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-header h2 { margin: 0; font-size: 20px; }
.hint { font-size: 12.5px; color: var(--ink-soft); }

/* --- Table --- */
.data-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.data-table th { background: #fafbfc; color: var(--ink-soft); font-weight: 600; }
.data-table tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge.admin { background: #fdeee0; color: #b25b12; }
.badge.user { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.on { background: var(--ok); }
.dot.off { background: #c3c8d2; }
.row-danger { color: var(--danger); background: none; border: none; font-size: 12.5px; text-decoration: underline; }
.row-btn { color: var(--accent); background: none; border: none; font-size: 12.5px; text-decoration: underline; margin-right: 10px; }

/* --- Issue list --- */
.issue-list { display: flex; flex-direction: column; gap: 12px; }
.issue-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; gap: 16px; align-items: flex-start;
}
.issue-thumb {
  width: 120px; height: 76px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--line); cursor: pointer; background: #eee; flex-shrink: 0;
}
.issue-body { flex: 1; }
.issue-title-row { display: flex; align-items: center; gap: 10px; }
.issue-title-row h3 { margin: 0; font-size: 15px; }
.issue-meta { font-size: 12px; color: var(--ink-soft); margin: 4px 0 8px; }
.issue-desc { font-size: 13.5px; color: var(--ink); white-space: pre-wrap; }
.status-pill { font-size: 11px; padding: 2px 9px; border-radius: 20px; font-weight: 600; }
.status-pill.open { background: #fdeaea; color: var(--danger); }
.status-pill.resolved { background: #e8f6ec; color: var(--ok); }

/* --- Status --- */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.status-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.status-label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 8px; }
.status-value { font-size: 22px; font-weight: 700; }

/* --- Modal --- */
.modal { position: fixed; inset: 0; background: rgba(15,20,35,0.4); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card {
  width: 340px; background: var(--panel); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.modal-card h3 { margin: 0 0 4px; }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 8px !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.image-modal { width: min(80vw, 800px); align-items: center; }
.image-modal img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
