:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f4f7f8;
  color: #000000;
  --green: #007f59;
  --green-dark: #006544;
  --green-soft: #e0f4ec;
  --muted: #66767d;
  --muted-2: #829096;
  --line: #e2eaec;
  --bg: #f4f7f8;
  --panel: #ffffff;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body { margin: 0; }

button {
  background: var(--green);
  border: 0;
  color: #fff;
  border-radius: 9px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
}
button:disabled { opacity: 0.5; cursor: default; }
button svg { width: 16px; height: 16px; flex: none; }

/* ── app shell (sidebar + content) ─────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 44px;
  padding-left: 4px;
}
.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: block;
}
.brand-mark .eyebrow {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #000;
}
.sidebar-label {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 800;
  margin: 0 0 12px;
  padding-left: 12px;
}
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-link {
  background: transparent;
  color: #66767d;
  text-decoration: none;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  justify-content: flex-start;
  width: 100%;
  color: #66767d;
}
.sidebar-link svg { width: 16px; height: 16px; flex: none; }
.sidebar-link:hover, .sidebar-link.active {
  background: var(--green-soft);
  color: var(--green-dark);
}
.sidebar-footer {
  margin-top: auto;
  color: var(--muted-2);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

/* ── content ───────────────────────────────────────────────────────────── */
.content {
  min-width: 0;
  width: 100%;
  padding: 40px 40px 80px;
}
.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.content-header h1 { font-size: 30px; margin: 4px 0 6px; letter-spacing: -0.5px; }
.breadcrumb {
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 800;
  margin: 0;
}
.page-subtitle { color: var(--muted); font-size: 14px; margin: 0; }
.header-actions { display: flex; gap: 8px; flex: none; }
.ghost-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: #333;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
}
.ghost-btn:hover { border-color: var(--green); color: var(--green-dark); background: #fff; }

.view[hidden] { display: none !important; }

/* ── toolbar ───────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 380px;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #000;
}
.search-wrap input:focus { outline: 2px solid var(--green-soft); border-color: var(--green); }
.count { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.seg-btn {
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
}
.seg-btn.active { background: var(--green); color: #fff; }

/* ── panel / table ─────────────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  width: 100%;
}
.table-scroll { overflow-x: auto; width: 100%; }
.data-table { width: 100%; min-width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: #fbfdfd;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f4f4;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fbfa; }
.email-cell { font-weight: 650; }
.user-id-cell { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.user-id-link { color: var(--green-dark); text-decoration: none; }
.user-id-link:hover { text-decoration: underline; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
  background: #eef1f1;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag.free { background: #f3f4f6; color: #4b5563; }
.tag.developer { background: #e0f4fe; color: #0369a1; }
.tag.pro { background: #dcfce7; color: #166534; }
.tag.active { background: #dcfce7; color: #166534; }
.tag-warn { background: #fef3c7; color: #92400e; }
.muted-text { color: var(--muted-2); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #d1d5db; }
.dot.ok { background: #10b981; }

/* ── user details ─────────────────────────────────────────────────────── */
.back-link { text-decoration: none; margin-bottom: 18px; }
.user-detail { padding: 26px; }
.user-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.user-detail-header h2 { font-size: 22px; margin: 6px 0 0; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 28px; margin: 0; padding-top: 24px; }
.detail-grid dt { color: var(--muted-2); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.detail-grid dd { margin: 6px 0 0; font-size: 14px; }

/* ── feedback cards ────────────────────────────────────────────────────── */
.feedback-list { display: grid; gap: 12px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.card.cancel { border-left: 4px solid #f59e0b; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; }
.badge.support { background: #e0f4fe; color: #0369a1; }
.badge.cancellation { background: #fef3c7; color: #92400e; }
.email { font-weight: 650; font-size: 14px; }
.user-id { color: var(--muted); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.time { margin-left: auto; font-size: 12px; color: var(--muted); }
.card-body { margin-top: 10px; }
.subject { font-weight: 700; font-size: 15px; margin: 0 0 6px; }
.message { font-size: 14px; color: #374151; margin: 0; white-space: pre-wrap; line-height: 1.5; }

.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 60px 0; }
.error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}

/* ── pagination ────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 18px;
}
.page-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: #333;
  border-radius: 8px;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-btn svg { width: 15px; height: 15px; }
.page-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green-dark); background: #fff; }
.page-btn.active { background: var(--green); border-color: var(--green); color: #fff; }
.page-btn:disabled { opacity: 0.4; }
.page-ellipsis { color: var(--muted); padding: 0 2px; }

/* ── login ─────────────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.login-card {
  width: min(400px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  text-align: left;
}
.login-card .brand { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-card .brand img { width: 52px; height: 52px; border-radius: 12px; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card .sub { font-size: 13px; color: var(--muted); margin: 0 0 24px; }
.login-card form { display: grid; gap: 12px; }
.login-card input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 15px;
  text-align: left;
  font-family: inherit;
}
.login-card button { padding: 13px; font-size: 15px; }
.form-error { color: var(--danger); font-size: 13px; }

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .brand-mark { margin: 0 12px 0 0; flex: none; }
  .brand-icon { width: 40px; height: 40px; }
  .sidebar-label { display: none; }
  .sidebar-nav { display: flex; }
  .sidebar-footer { display: none; }
  .content { padding: 24px 16px 60px; }
  .content-header { flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
