/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f2f5fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #d9e8e2;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #059669;
  --primary-strong: #047857;
  --success-bg: #dcfce7;
  --success-fg: #14532d;
  --danger-bg: #fee2e2;
  --danger-fg: #7f1d1d;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: radial-gradient(circle at top left, #e8f8f0, #f2f5fb 32%, #f2f5fb);
  color: var(--text);
  line-height: 1.45;
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.topbar {
  background: linear-gradient(135deg, #052e2b, #064e3b 62%, #047857);
  color: #dcfce7;
  padding: 1.1rem 0 0.8rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.18);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand h1 {
  margin: 0;
  color: #fff;
  font-size: 1.18rem;
}

.brand p {
  margin: 0.08rem 0 0;
  font-size: 0.82rem;
  color: #a7f3d0;
}

.brand-mark {
  height: 2.2rem;
  width: 2.2rem;
  border-radius: 0.6rem;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(160deg, #34d399, #059669);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.role-chip {
  background: rgba(5, 150, 105, 0.28);
  color: #d1fae5;
  padding: 0.26rem 0.56rem;
  border-radius: 999px;
  font-weight: 600;
}

.user-email {
  color: #bbf7d0;
}

.nav-wrap {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.top-nav a {
  color: #d1fae5;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.44rem 0.74rem;
  border-radius: 0.56rem;
  transition: background 0.18s ease, color 0.18s ease;
}

.top-nav a:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #fff;
}

.top-nav a.active {
  background: rgba(16, 185, 129, 0.35);
  color: #ecfdf5;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-bottom: 0.95rem;
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.app-shell {
  padding: 1.6rem 1.25rem 3rem;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

h3 {
  margin: 0 0 0.8rem;
  font-size: 1.02rem;
}

p {
  margin: 0.3rem 0 0.7rem;
}

a {
  color: var(--primary-strong);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 1.05rem 1.1rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow);
}

.card p:last-child {
  margin-bottom: 0;
}

.actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

th,
td {
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  padding: 0.68rem 0.78rem;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-muted);
}

tr:last-child td {
  border-bottom: 0;
}

label {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.54rem 0.62rem;
  border: 1px solid #c9d5e6;
  border-radius: 0.55rem;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

input[type="checkbox"] {
  width: auto;
  margin-right: 0.4rem;
  transform: translateY(1px);
}

button,
input[type="submit"] {
  background: linear-gradient(180deg, #10b981, #059669);
  color: #fff;
  border: 0;
  border-radius: 0.6rem;
  padding: 0.58rem 0.88rem;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.75rem;
}

.metric {
  background: linear-gradient(180deg, #f0fdf4, #ecfdf5);
  border: 1px solid #a7f3d0;
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.metric .label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.metric .value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #065f46;
}

.flash {
  padding: 0.78rem 0.9rem;
  border-radius: 0.7rem;
  margin-bottom: 0.9rem;
  border: 1px solid transparent;
}

.flash.notice {
  background: var(--success-bg);
  color: var(--success-fg);
  border-color: #86efac;
}

.flash.alert {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border-color: #fca5a5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 0.6rem;
  text-decoration: none;
  font-weight: 600;
  padding: 0.58rem 0.88rem;
}

a.btn {
  color: #fff;
  background: linear-gradient(180deg, #10b981, #059669);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28);
}

.ghost-btn {
  background: transparent;
  color: #d1fae5;
  border: 1px solid rgba(110, 231, 183, 0.4);
  box-shadow: none;
}

.signout-btn {
  margin: 0;
}

.button_to {
  margin: 0;
}

.auth-shell {
  max-width: 420px;
  margin: 3rem auto;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.3rem;
  box-shadow: var(--shadow);
}

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

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.76rem;
  font-weight: 600;
}

@media (max-width: 860px) {
  .topbar-inner,
  .nav-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-meta {
    font-size: 0.8rem;
  }

  .app-shell {
    padding-top: 1.2rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
