@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #1d4ed8;
  --accent-strong: #1e40af;
  --border: #e2e8f0;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --table-head: #eef4ff;
  --table-row: #ffffff;
  --table-row-alt: #f8fafc;
  --kr-accent: #e0ecff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef3fb 0%, #f4f7fb 45%, #f8fafc 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.glow,
.grain {
  display: none;
}

.page {
  position: relative;
  z-index: 2;
  width: min(1240px, 92vw);
  display: grid;
  gap: 22px;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  height: 46px;
  width: auto;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--muted);
}

.subtitle {
  margin: 0;
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

.content {
  display: grid;
  gap: 24px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 24px;
}

.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  align-self: start;
}

.profile-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.profile-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.email {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: #f1f5ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: var(--accent);
}

.avatar-fallback {
  text-transform: uppercase;
}

.meta-grid {
  display: grid;
  gap: 12px;
}

.meta-item {
  display: grid;
  gap: 4px;
}

.meta-label {
  font-size: 12px;
  color: var(--muted);
}

.meta-value {
  font-size: 14px;
  font-weight: 600;
}

.profile-note {
  background: #f1f5ff;
  border: 1px solid #dbe4ff;
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.form-card,
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.form-card h1,
.login-card h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

button,
.button {
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.18);
}

button:active,
.button:active {
  transform: translateY(0);
}

button:disabled,
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost {
  background: #fff;
  color: var(--accent);
  border: 1px solid #dbe4ff;
}

.ghost:hover {
  background: #eef4ff;
}

.message {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.message.success {
  background: #ecfdf3;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.message.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.table-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
}

.okr-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.okr-table thead {
  background: var(--table-head);
}

.okr-table th,
.okr-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.okr-table th {
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.okr-table tbody tr:last-child td {
  border-bottom: none;
}

.okr-table tbody tr:nth-child(even) {
  background: var(--table-row-alt);
}

.empty-row td {
  text-align: center;
  color: var(--muted);
}

.objective-row {
  background: #f5f9ff;
  font-weight: 600;
}

.kr-row {
  background: var(--table-row);
}

.kr-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--kr-accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.owner-cell {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.owner-cell strong {
  font-size: 13px;
}

.owner-cell span {
  color: var(--muted);
}

.objective-cell {
  font-weight: 600;
  font-size: 13px;
}

.table-kr-button {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  background: #eef4ff;
  color: var(--accent);
  border: 1px solid #dbe4ff;
}

.table-kr-button:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

.muted {
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.footer {
  color: var(--muted);
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 99;
}

.modal.is-open {
  display: flex;
}

.modal-content {
  width: min(640px, 92vw);
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
}

.modal-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.modal-subtle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-error {
  font-size: 12px;
  color: #b91c1c;
  margin: 0;
}

label {
  font-weight: 600;
  font-size: 13px;
}

textarea,
input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.freq-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.freq-options input {
  margin-right: 6px;
}

.field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .profile-card {
    order: 2;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 0 32px;
  }

  .brand-logo {
    height: 44px;
  }

  .form-card,
  .login-card,
  .topbar {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
