/* Carketa-themed styling for the investor portal.
   Palette mirrors carketa-next: green primary hsl(137 44% 45%), muted gray
   foreground, Inter type, 0.5rem radius. */

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

:root {
  --primary: hsl(137 43.9% 44.7%);
  --primary-hover: hsl(137 43.9% 38%);
  --primary-soft: hsl(137 60% 96%);
  --foreground: hsl(264 6% 28%);
  --muted-foreground: hsl(215 12% 52%);
  --background: hsl(240 20% 99%);
  --card: #ffffff;
  --border: hsl(214 25% 91%);
  --input-border: hsl(214 20% 84%);
  --error: hsl(358 70% 52%);
  --error-soft: hsl(358 100% 97%);
  --success-soft: hsl(137 60% 96%);
  --radius: 0.5rem;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.85rem;
}

.muted {
  color: var(--muted-foreground);
}
.small {
  font-size: 0.85rem;
}

.brand {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

/* ---- buttons & inputs ---------------------------------------------------- */

button,
.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
button:hover,
.btn:hover {
  background: var(--primary-hover);
}
button:active {
  transform: translateY(1px);
}

button.danger {
  background: transparent;
  color: var(--error);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}
button.danger:hover {
  background: var(--error-soft);
  border-color: var(--error);
}

.link-btn {
  background: transparent;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.link-btn:hover {
  background: #f6f7f9;
  color: var(--foreground);
}

input[type='text'],
input[type='password'],
textarea,
input[type='file'] {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--foreground);
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 1rem;
}
label input,
label textarea {
  margin-top: 0.35rem;
}

/* ---- gate (PIN / admin login) -------------------------------------------- */

body.bare {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 50% -10%, var(--primary-soft), transparent 70%),
    var(--background);
}
.gate {
  width: 100%;
  padding: 1.5rem;
}
.gate-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-lg);
  padding: 2.25rem 2rem;
  text-align: center;
}
.gate-card .brand {
  margin-bottom: 1rem;
}
.gate-card h1 {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}
.gate-card p {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}
.gate-card form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.gate-card input {
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

/* ---- container layouts --------------------------------------------------- */

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.page-head .brand {
  width: 100%;
  margin-bottom: 0.1rem;
}
.page-head h1 {
  flex: 1;
}
.logout-form {
  margin: 0;
}

/* ---- public report list -------------------------------------------------- */

.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.report-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--foreground);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.report-link:hover {
  text-decoration: none;
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.report-title {
  font-weight: 600;
  font-size: 1.05rem;
}
.report-date {
  color: var(--muted-foreground);
  font-size: 0.85rem;
  white-space: nowrap;
}
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
}

/* ---- admin cards --------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card form {
  margin: 0;
}
.card form button {
  margin-top: 0.25rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
}
.copy-row input {
  flex: 1;
  background: #f7f8fa;
  color: var(--muted-foreground);
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.inline-form:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.inline-form label {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}
.inline-form button {
  white-space: nowrap;
}

.sr-label {
  margin-bottom: 1rem;
}

/* ---- report table -------------------------------------------------------- */

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.report-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0.75rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.report-table td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.report-table tr:last-child td {
  border-bottom: none;
}
.report-table td a {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}
.row-actions {
  text-align: right;
}
.row-actions form {
  margin: 0;
}

/* ---- notices ------------------------------------------------------------- */

.notice,
.error {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.notice {
  background: var(--success-soft);
  color: var(--primary-hover);
  border: 1px solid hsl(137 40% 82%);
}
.error {
  background: var(--error-soft);
  color: var(--error);
  border: 1px solid hsl(358 80% 88%);
}
.gate-card .error {
  text-align: left;
}
