
:root {
  --bg: #111617;
  --text: #ffffff;
  --muted: #d6d9da;
  --accent: #f2382d;
  --accent-dark: #bd1f19;
  --panel: rgba(18, 23, 24, 0.86);
  --border: rgba(255,255,255,.16);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body { min-height: 100vh; }

/* ---------------- Landing page ---------------- */

.landing-page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 36px 42px;
  background: var(--bg);
}

.login-button {
  position: fixed;
  top: 28px;
  right: 32px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 44px;
  padding: 10px 24px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}

.brand-block {
  width: min(1250px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-logo {
  display: block;
  width: min(1180px, 92vw);
  max-height: 72vh;
  height: auto;
  object-fit: contain;
}

.contacts {
  width: min(820px, 88vw);
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  text-align: center;
}

.contact-person {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.45;
}

.contact-person strong { color: var(--text); }

.contact-person a {
  color: var(--muted);
  text-decoration: none;
}

/* ---------------- Login page ---------------- */

.login-page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}

.login-brand,
.dashboard-brand {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: .34;
}

.login-brand img,
.dashboard-brand img {
  display: block;
  width: min(1180px, 94vw);
  max-height: 82vh;
  height: auto;
  object-fit: contain;
}

.login-overlay {
  position: relative;
  z-index: 3;
  width: min(420px, 92vw);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0,0,0,.48);
}

.login-overlay h1 {
  margin: 0 0 6px;
  font-size: 28px;
  text-align: center;
}

.login-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.login-overlay label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 14px;
}

.login-overlay input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.32);
  color: #fff;
  font-size: 16px;
  outline: none;
}

.login-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
}

.login-error {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid rgba(242,56,45,.42);
  background: rgba(242,56,45,.09);
  color: #fff;
  text-align: center;
}

.back-button,
.logout-link {
  position: fixed;
  top: 28px;
  z-index: 10;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .07em;
}

.back-button { left: 32px; }
.logout-link { right: 32px; }

/* ---------------- Dashboard ---------------- */

.dashboard-page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 110px 30px 50px;
  background: var(--bg);
}

.dashboard-user {
  position: fixed;
  top: 29px;
  left: 32px;
  z-index: 10;
  color: rgba(255,255,255,.78);
  font-size: 13px;
}

.dashboard-grid {
  position: relative;
  z-index: 3;
  width: min(1040px, 94vw);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}

.dashboard-tile {
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  background: rgba(18,23,24,.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 55px rgba(0,0,0,.42);
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  text-align: center;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.dashboard-tile:hover {
  transform: translateY(-5px);
  border-color: rgba(242,56,45,.72);
  background: rgba(242,56,45,.09);
}

.tile-title {
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: .05em;
}

.tile-text {
  max-width: 210px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    width: min(460px, 92vw);
  }

  .dashboard-tile {
    aspect-ratio: auto;
    min-height: 170px;
  }
}

@media (max-width: 720px) {
  .landing-page {
    padding: 78px 20px 34px;
  }

  .login-button {
    top: 18px;
    right: 18px;
    min-width: 96px;
  }

  .brand-logo {
    width: 100%;
    max-height: 58vh;
  }

  .contacts {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .login-page,
  .dashboard-page {
    padding: 82px 18px 28px;
  }

  .back-button {
    top: 20px;
    left: 20px;
  }

  .logout-link {
    top: 20px;
    right: 20px;
  }

  .dashboard-user {
    top: 20px;
    left: 20px;
  }

  .login-overlay {
    padding: 26px 22px;
  }

  .login-brand img,
  .dashboard-brand img {
    width: 110vw;
    max-width: none;
  }
}



/* ==========================================================
   Nigel settings + live Keith permissions
   ========================================================== */

.dashboard-grid-four {
  width: min(1040px, 94vw);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
}

.dashboard-grid-four .dashboard-tile {
  aspect-ratio: 1 / 1;
}

.dashboard-tile-disabled {
  cursor: default;
  opacity: .34;
  filter: grayscale(1);
  background: rgba(30,33,34,.68);
  border-color: rgba(255,255,255,.07);
  box-shadow: none;
  pointer-events: none;
}

.dashboard-tile-disabled .tile-title,
.dashboard-tile-disabled .tile-text {
  color: rgba(255,255,255,.44);
}

.dashboard-tile-settings {
  border-color: rgba(255,255,255,.22);
}

.dashboard-notice {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 9px 14px;
  border: 1px solid rgba(242,56,45,.35);
  border-radius: 999px;
  background: rgba(18,23,24,.94);
  color: rgba(255,255,255,.86);
  font-size: 13px;
}

.settings-page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  background: var(--bg);
}

.settings-panel {
  position: relative;
  z-index: 3;
  width: min(620px, 94vw);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0,0,0,.48);
}

.settings-panel h1 {
  margin: 0 0 5px;
  text-align: center;
  font-size: 28px;
}

.settings-intro {
  margin: 0 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  margin: 0 0 12px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(0,0,0,.22);
}

.permission-row span:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.permission-row strong {
  color: #fff;
  font-size: 16px;
}

.permission-row small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.permission-toggle {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 52px;
  height: 29px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  position: relative;
  cursor: pointer;
  transition: background .15s ease;
}

.permission-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  transition: transform .15s ease, background .15s ease;
}

.permission-toggle:checked {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
}

.permission-toggle:checked::after {
  transform: translateX(23px);
  background: #fff;
}

.permission-fixed {
  flex: 0 0 auto;
  color: rgba(255,255,255,.52);
  font-size: 11px;
  letter-spacing: .07em;
}

.settings-save {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
}

.settings-success {
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  text-align: center;
  font-size: 14px;
}

@media (max-width: 900px) {
  .dashboard-grid-four {
    grid-template-columns: 1fr;
    width: min(460px, 92vw);
  }

  .dashboard-grid-four .dashboard-tile {
    aspect-ratio: auto;
  }
}

@media (max-width: 620px) {
  .settings-panel {
    padding: 25px 20px;
  }

  .permission-row {
    gap: 14px;
  }
}
