/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid #e4e6ea;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-logout:hover { color: #e53e3e; }

/* ── Views ───────────────────────────────────────────────────────────────── */
main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  min-height: calc(100vh - 52px);
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  padding: 32px 28px;
}

/* ── Login card ──────────────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 80px;
}

.login-card h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 12px;
}

.login-card label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
}

/* ── Input wrap ──────────────────────────────────────────────────────────── */
.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: #999;
  pointer-events: none;
}

.input-wrap input,
.detail-card input[type="text"] {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1.5px solid #dde1e7;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #f7f8fa;
  outline: none;
  transition: border-color .18s;
}

.detail-card input[type="text"] {
  padding-left: 12px;
}

.input-wrap input:focus,
.detail-card input[type="text"]:focus {
  border-color: #2563eb;
  background: #fff;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 12px;
  margin-top: 14px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #93b4f5; cursor: not-allowed; }

.btn-back {
  background: none;
  border: none;
  cursor: pointer;
  color: #2563eb;
  font-size: 0.9rem;
  padding: 0;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-back:hover { text-decoration: underline; }

/* ── Messages ────────────────────────────────────────────────────────────── */
.error   { color: #e53e3e; font-size: 0.85rem; margin-top: 4px; }
.success { color: #38a169; font-size: 0.85rem; margin-top: 4px; }

/* ── Panels grid ─────────────────────────────────────────────────────────── */
#view-panels {
  align-items: flex-start;
}

.panels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 900px;
}

.panel-card {
  background: #fff;
  border: 1.5px solid #e4e6ea;
  border-radius: 12px;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow .18s, border-color .18s;
}
.panel-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  border-color: #c3d4fb;
}

.panel-card span.name {
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
}

/* ── Detail card ─────────────────────────────────────────────────────────── */
.detail-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-card h2 { font-size: 1.25rem; }

.rows-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-top: 6px;
}

#rows-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#rows-inputs input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #dde1e7;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #f7f8fa;
  outline: none;
  transition: border-color .18s;
}
#rows-inputs input:focus {
  border-color: #2563eb;
  background: #fff;
}
#rows-inputs input.invalid {
  border-color: #e53e3e;
}
