:root {
  --fp-navy: #082b63;
  --fp-blue: #0f8fd6;
  --fp-blue-dark: #075a9c;
  --fp-blue-soft: #e8f4ff;
  --fp-red: #d92d20;
  --fp-amber: #f79009;
  --ink: #142238;
  --muted: #667085;
  --line: #d8e2ec;
  --surface: #ffffff;
  --page: #eef3f8;
  --success-bg: #e8f7ed;
  --success-text: #126b3a;
  --error-bg: #fdecec;
  --error-text: #8a1c1c;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); }

header {
  background: linear-gradient(135deg, var(--fp-navy), #0a3f89);
  color: white;
  padding: 16px 24px;
  box-shadow: 0 3px 14px rgba(8, 43, 99, .22);
}

header > div {
  max-width: 1100px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: 238px;
  height: 58px;
  background: white;
  border-radius: 8px;
  padding: 7px 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

nav a,
.nav-menu summary {
  color: #eef7ff;
  text-decoration: none;
  padding: 7px 9px;
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

nav a:hover,
.nav-menu summary:hover { background: rgba(255, 255, 255, .12); }

.nav-menu {
  position: relative;
}

.nav-menu summary {
  list-style: none;
  cursor: pointer;
}

.nav-menu summary::-webkit-details-marker { display: none; }

.nav-menu summary::after {
  content: "";
  display: inline-block;
  margin-left: 7px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: middle;
}

.nav-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  min-width: 190px;
  padding: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(20, 34, 56, .2);
}

.nav-panel a {
  display: block;
  color: var(--ink);
  padding: 10px 11px;
}

.nav-panel a:hover {
  background: var(--fp-blue-soft);
  color: var(--fp-blue-dark);
}

main {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 18px;
}

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.page-title h1 { margin: 0; color: var(--fp-navy); }
.page-title span { color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 22px rgba(20, 34, 56, .06);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 5px solid var(--fp-blue);
}

.eyebrow {
  text-transform: uppercase;
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--fp-blue-dark);
  font-weight: 800;
}

.current-name {
  font-size: 2.3rem;
  font-weight: 760;
  margin-top: 4px;
  color: var(--fp-navy);
}

.extension {
  font-size: 1.15rem;
  color: #344760;
}

.badge {
  display: inline-block;
  background: #fff4df;
  color: #9a5b00;
  border: 1px solid #fedf89;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.button,
button {
  display: inline-block;
  background: var(--fp-blue-dark);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 10px 15px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 2px 7px rgba(7, 90, 156, .2);
}

.button:hover,
button:hover { background: var(--fp-blue); }
.danger { background: var(--fp-red); }
.danger:hover { background: #b42318; }
.secondary { background: #526173; }
.secondary:hover { background: #344760; }

.link-button,
.link-danger {
  background: none;
  box-shadow: none;
  padding: 0;
}

.link-button { color: var(--fp-blue-dark); }
.link-danger { color: var(--fp-red); }

.form-grid { display: grid; gap: 16px; }
.form-grid h2 { margin-bottom: 0; color: var(--fp-navy); }

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #26374d;
}

input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #c7d3df;
  border-radius: 8px;
  background: white;
  font: inherit;
}

input:focus,
select:focus {
  border-color: var(--fp-blue);
  outline: 3px solid rgba(15, 143, 214, .18);
}

small { color: var(--muted); font-weight: 500; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }

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

th,
td {
  text-align: left;
  padding: 11px;
  border-bottom: 1px solid #e3eaf1;
  vertical-align: top;
}

th {
  color: #526173;
  font-size: .86rem;
  text-transform: uppercase;
}

.current-row { background: var(--fp-blue-soft); }

.flash {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.flash.success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #b7e4c7;
}

.flash.error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #f3b8b8;
}

.api-key {
  font-family: ui-monospace, monospace;
  word-break: break-all;
  background: #f7f9fc;
  border-left: 4px solid var(--fp-blue);
  padding: 14px;
  border-radius: 8px;
}

.login-wrap,
.installer {
  max-width: 620px;
  margin: 60px auto;
  padding: 0 18px;
}

.login-card { display: grid; gap: 16px; }
footer { text-align: center; color: var(--muted); padding: 24px; }
.warning { color: var(--error-text); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stat {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.stat span,
.stat small { color: var(--muted); }

.stat strong {
  font-size: 1.5rem;
  color: var(--fp-navy);
}

.countdown {
  font-weight: 800;
  margin: 10px 0;
  color: var(--fp-blue-dark);
}

.section-head,
.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.inline { display: inline; margin-left: 10px; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.weekdays > div {
  text-align: center;
  font-weight: 800;
  padding: 8px;
  color: var(--fp-navy);
}

.calendar-day {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: white;
}

.calendar-day span { font-weight: 800; color: var(--fp-navy); }
.calendar-day small { color: var(--muted); }
.calendar-day.muted { opacity: .48; background: #f7f9fc; }
.compact { max-width: 620px; }

@media (max-width: 720px) {
  header > div,
  .hero,
  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .brand {
    width: 220px;
    height: 54px;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .nav-panel {
    left: 0;
    right: auto;
  }
}

@media (max-width: 800px) {
  .stat-grid { grid-template-columns: 1fr; }
  .calendar { grid-template-columns: repeat(2, 1fr); }
  .weekdays { display: none; }
}
