/* Common layout & tokens */
:root
{
  --bg: #f6f7fb;
  --card: #fff;
  --text: #222;
  --muted: #667085;
  --brand: #0a6a5f;
  --accent: #0a7ea4;
}

*
{
  box-sizing: border-box;
}

body
{
  margin: 0;
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container
{
  max-width: 1100px;
  margin: 24px auto;
  padding: 16px;
}

/* ===== Dynamic brand-coloured navbar ===== */
.site-header
{
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand) 40%, #1a1a1a),
    color-mix(in srgb, var(--accent) 40%, #1a1a1a)
  );
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 50%, #000);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

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

.brand img
{
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand h1
{
  margin: 0;
  font-size: 20px;
  color: #fff;
}

.brand .sub
{
  color: rgba(255, 255, 255, .85);
  font-size: 12px;
}

/* Desktop nav (works with old .nav and new .nav--desktop) */
.nav,
.nav--desktop
{
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav a,
.nav--desktop a
{
  color: #fff;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}

.nav a:hover,
.nav a.active,
.nav--desktop a:hover,
.nav--desktop a.active
{
  background: rgba(255, 255, 255, .15);
}

.nav .btn,
.nav--desktop .btn
{
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  color: #052018;
  font-weight: 700;
}

.nav .user,
.nav--desktop .user
{
  color: rgba(255, 255, 255, .85);
  font-size: 12px;
}

/* Hamburger (hidden on desktop) */
.nav-toggle
{
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.nav-toggle__icon
{
  width: 18px;
  height: 2px;
  display: block;
  background: #fff;
  border-radius: 2px;
  position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after
{
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.nav-toggle__icon::before
{
  top: -6px;
}

.nav-toggle__icon::after
{
  top: 6px;
}

/* Mobile drawer */
.nav-drawer
{
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 3000;
  display: flex;
  justify-content: flex-end;
}

.nav-drawer[hidden]
{
  display: none !important;
}

.nav-drawer__panel
{
  width: min(360px, 92vw);
  height: 100%;
  background: color-mix(in srgb, var(--card) 85%, #111);
  border-left: 1px solid rgba(255, 255, 255, .12);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-drawer__head
{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-drawer__title
{
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.nav-drawer__close
{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .20);
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.nav--mobile
{
  display: grid;
  gap: 10px;
}

.nav--mobile a
{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  text-align: center;
}

.nav--mobile a.active
{
  background: rgba(255, 255, 255, .16);
}

.nav--mobile .user--mobile
{
  color: rgba(255, 255, 255, .85);
  font-size: 12px;
  text-align: center;
  padding-top: 4px;
}

.nav--mobile .btn--full
{
  width: 100%;
  text-align: center;
}

/* Mobile behaviour */
@media (max-width: 768px)
{
  .site-header
  {
    gap: 10px;
    padding: 10px 12px;
  }

  .brand h1,
  .brand .sub
  {
    display: block;
  }

  .brand img
  {
    width: 52px;
    height: 52px;
  }

  .brand h1
  {
    font-size: 18px;
    line-height: 1.15;
  }

  .brand .sub
  {
    font-size: 12px;
    line-height: 1.1;
    color: rgba(255, 255, 255, .85);
  }

  .nav--desktop
  {
    display: none;
  }

  .nav-toggle
  {
    display: inline-flex;
  }
}

/* Ultra-small phones */
@media (max-width: 420px)
{
  .nav-drawer__panel
  {
    width: 92vw;
  }
}

/* prevent background scroll when drawer open */
html.nav-open,
html.nav-open body
{
  overflow: hidden;
}
/* ======================================== */

.card
{
  background: var(--card);
  border: 1px solid #eef1f4;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(20, 20, 20, .04);
}

.card.subtle
{
  background: #fcfdfd;
  border-style: dashed;
}

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

label
{
  font-weight: 600;
  display: block;
  margin: 6px 0;
}

.input,
select,
textarea
{
  width: 100%;
  padding: 10px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  background: #fff;
}

.btn-primary
{
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

.btn
{
  background: #fff;
  color: #0b3d59;
  padding: 10px 14px;
  border: 1px solid #d6dee6;
  border-radius: 10px;
  cursor: pointer;
}

.btn:hover,
.btn-primary:hover
{
  filter: brightness(0.98);
}

.table
{
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td
{
  padding: 10px;
  border-bottom: 1px solid #eceff2;
  text-align: left;
  vertical-align: top;
}

.badge
{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef;
}

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

.actions
{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notice
{
  padding: 12px;
  border: 1px solid #cbe7d0;
  background: #e9f7ec;
  border-radius: 10px;
  margin-bottom: 12px;
}

.error
{
  padding: 12px;
  border: 1px solid #f5c2c7;
  background: #fde2e4;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* Banner */
.banner
{
  background: linear-gradient(90deg, var(--accent), var(--brand));
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  margin: 12px 0;
}

/* Prose */
.prose p
{
  margin: 0 0 10px 0;
  line-height: 1.6;
}

.prose b,
.prose strong
{
  font-weight: 700;
}
