:root {
  --cream: #f7f2e8;
  --cream-deep: #eee5d4;
  --paper: rgba(255, 255, 255, 0.92);
  --paper-solid: #fffdf8;
  --white: #ffffff;

  --ink: #2f302b;
  --muted: #707168;

  --brand: #707957;
  --brand-dark: #525b3f;
  --brand-soft: rgba(112, 121, 87, 0.12);

  --gold: #b99a5a;

  --danger: #b95b52;
  --danger-dark: #93443e;
  --warning: #d78d3f;
  --almost: #d6b64c;
  --success: #6e9867;
  --quiet: #a6a89f;

  --line: rgba(63, 61, 52, 0.13);
  --line-strong: rgba(63, 61, 52, 0.22);

  --shadow-sm: 0 10px 28px rgba(58, 51, 37, 0.08);
  --shadow-md: 0 18px 52px rgba(58, 51, 37, 0.11);
  --shadow-lg: 0 28px 80px rgba(43, 38, 29, 0.18);

  --radius-small: 12px;
  --radius-medium: 16px;
  --radius-large: 24px;
  --radius-pill: 999px;

  --sidebar-width: 270px;
  --content-width: 1500px;
  --control-height: 50px;
}

/* =========================================================
   RESET
   ========================================================= */

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

html {
  min-height: 100%;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  color: var(--ink);
}

img {
  display: block;
  max-width: 100%;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.08rem;
  line-height: 1.25;
}

p {
  margin-bottom: 1rem;
}

small {
  color: var(--muted);
  font-size: 0.86rem;
}

a {
  color: inherit;
}

/* =========================================================
   SHARED UTILITIES
   ========================================================= */

.is-hidden {
  display: none !important;
}

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

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.empty-state {
  color: var(--muted);
}

.page-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(
      circle at top left,
      rgba(185, 154, 90, 0.13),
      transparent 35%
    ),
    linear-gradient(
      145deg,
      #fbf8f1 0%,
      #f3ecde 56%,
      #faf7ef 100%
    );
}

.page-background::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.17;
  background-image: url("../assets/branding/floating-logo.png");
  background-repeat: no-repeat;
  background-position: 94% 91%;
  background-size: min(31vw, 350px);
  pointer-events: none;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.72rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: scale(0.98);
}

.button:focus-visible,
.text-button:focus-visible,
.nav-button:focus-visible,
.menu-button:focus-visible,
.month-button:focus-visible,
.summary-card:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid rgba(112, 121, 87, 0.28);
  outline-offset: 3px;
}

.button-primary {
  color: var(--white);
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(82, 91, 63, 0.2);
}

.button-primary:hover {
  background: var(--brand-dark);
}

.button-secondary {
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--line);
}

.button-secondary:hover {
  background: var(--white);
  border-color: rgba(112, 121, 87, 0.3);
}

.button-danger {
  color: var(--white);
  background: var(--danger);
  box-shadow: 0 10px 24px rgba(185, 91, 82, 0.18);
}

.button-danger:hover {
  background: var(--danger-dark);
}

.button-full {
  width: 100%;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.4rem 0.3rem;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-weight: 800;
}

.text-button:hover {
  text-decoration: underline;
}

.menu-button {
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-dark);
  font-weight: 800;
}

/* =========================================================
   FORMS
   ========================================================= */

.form-heading {
  margin-bottom: 0.25rem;
}

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

.field {
  display: grid;
  min-width: 0;
  gap: 0.42rem;
  font-weight: 760;
}

.field > span {
  display: block;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.84);
  outline: none;
  box-shadow: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

input,
select {
  min-height: var(--control-height);
  padding: 0.72rem 0.8rem;
}

textarea {
  min-height: 112px;
  padding: 0.78rem 0.82rem;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(112, 121, 87, 0.34);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(112, 121, 87, 0.68);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(112, 121, 87, 0.1);
}

input[readonly] {
  color: var(--muted);
  background: rgba(245, 243, 237, 0.88);
}

input[type="date"],
input[type="time"] {
  height: var(--control-height);
  appearance: auto;
  -webkit-appearance: auto;
}

select {
  appearance: auto;
  -webkit-appearance: menulist;
}

.form-grid {
  display: grid;
  min-width: 0;
  gap: 0.9rem;
}

.form-grid > * {
  min-width: 0;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-panel {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 820px;
  gap: 1rem;
}

.nested-form {
  display: grid;
  min-width: 0;
  gap: 1rem;
}

.form-feedback {
  min-height: 1.3rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-feedback.is-error {
  color: var(--danger);
}

.form-feedback.is-success {
  color: var(--success);
}

.check-option,
.radio-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  cursor: pointer;
  font-weight: 700;
}

.check-option input,
.radio-option input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.choice-group {
  display: grid;
  gap: 0.7rem;
}

.choice-group legend {
  margin-bottom: 0.45rem;
  font-weight: 800;
}

/* =========================================================
   AUTHENTICATION
   ========================================================= */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
  align-items: center;
  width: min(1180px, calc(100% - 3rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 0;
  gap: clamp(2rem, 6vw, 6rem);
}

.auth-brand {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.25rem;
}

.auth-logo {
  width: min(320px, 72%);
  object-fit: contain;
}

.auth-scripture {
  width: min(520px, 94%);
  object-fit: contain;
}

.auth-brand-copy {
  max-width: 560px;
}

.auth-brand-copy h1 {
  margin-bottom: 0.55rem;
}

.auth-brand-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.auth-card {
  width: 100%;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--paper);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(112, 121, 87, 0.08);
}

.auth-tab {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.is-active {
  color: var(--brand-dark);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 1rem;
}

/* =========================================================
   APPLICATION SHELL
   ========================================================= */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 1.2rem;
  border-right: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 8px 0 30px rgba(44, 40, 31, 0.04);
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

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

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  margin-bottom: 0.1rem;
}

.sidebar-brand > div > span:not(.role-badge) {
  color: var(--muted);
  font-size: 0.88rem;
}

.role-badge {
  display: inline-flex !important;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.18rem 0.52rem;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: capitalize;
}

.primary-nav {
  display: grid;
  gap: 0.3rem;
  margin-top: 1rem;
}

.nav-button {
  min-height: 46px;
  padding: 0.74rem 0.9rem;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 760;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.nav-button:hover {
  transform: translateX(2px);
  background: rgba(112, 121, 87, 0.08);
}

.nav-button.is-active {
  color: var(--brand-dark);
  background: rgba(112, 121, 87, 0.14);
}

.sidebar-signout {
  margin-top: auto;
}

.mobile-header {
  display: none;
}

.menu-backdrop {
  display: none;
}

.app-content {
  width: min(
    calc(100% - var(--sidebar-width)),
    var(--content-width)
  );
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: clamp(1.2rem, 3vw, 2.5rem);
}

.view {
  display: none;
  animation: view-enter 0.2s ease;
}

.view.is-active {
  display: block;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.4rem;
}

.view-heading > div {
  min-width: 0;
}

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

.section-heading {
  margin: 1.6rem 0 0.85rem;
}

.section-heading p {
  margin-bottom: 0;
}

.app-feedback {
  position: sticky;
  top: 0.75rem;
  z-index: 25;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-small);
  background: var(--brand-dark);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   PANELS AND CARDS
   ========================================================= */

.panel,
.summary-card,
.shift-card,
.message-card,
.hour-card,
.request-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.panel {
  padding: 1.2rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-heading > div {
  min-width: 0;
}

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

.stack-list,
.card-list,
.message-list {
  display: grid;
  min-width: 0;
  gap: 0.9rem;
}

.card-list {
  grid-template-columns:
    repeat(auto-fill, minmax(290px, 1fr));
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-card {
  width: 100%;
  padding: 1.1rem;
  color: inherit;
  text-align: left;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.summary-card:hover {
  transform: translateY(-4px);
  border-color: rgba(112, 121, 87, 0.28);
  box-shadow: 0 22px 52px rgba(58, 51, 37, 0.14);
}

.summary-label,
.summary-card small,
.summary-link {
  display: block;
}

.summary-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.summary-card strong {
  display: block;
  margin: 0.42rem 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.summary-link {
  margin-top: 0.7rem;
  color: var(--brand-dark);
  font-size: 0.84rem;
  font-weight: 850;
}

.dashboard-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(300px, 0.65fr);
  gap: 1rem;
}

.week-needs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
}

.need-day {
  min-width: 0;
  min-height: 110px;
  padding: 0.72rem;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.need-day:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.need-day strong,
.need-day span {
  display: block;
}

.need-day .need-count {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.77rem;
}

/* =========================================================
   STATUS COLORS
   ========================================================= */

.status-critical {
  border-left-color: var(--danger) !important;
}

.status-needs {
  border-left-color: var(--warning) !important;
}

.status-almost {
  border-left-color: var(--almost) !important;
}

.status-full {
  border-left-color: var(--success) !important;
}

.status-closed {
  border-left-color: var(--quiet) !important;
}

.status-pending {
  border-left-color: var(--almost) !important;
}

.status-approved {
  border-left-color: var(--success) !important;
}

.status-declined {
  border-left-color: var(--danger) !important;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.24rem 0.62rem;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.77rem;
  font-weight: 820;
}

.chip.pending {
  background: rgba(214, 182, 76, 0.16);
  color: #80680c;
}

.chip.approved {
  background: rgba(110, 152, 103, 0.15);
  color: #41663d;
}

.chip.declined {
  background: rgba(185, 91, 82, 0.15);
  color: #873e38;
}

/* =========================================================
   SHIFT, MESSAGE, HOUR, REQUEST CARDS
   ========================================================= */

.shift-card,
.message-card,
.hour-card,
.request-card {
  padding: 1.05rem;
  border-left-width: 5px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.shift-card:hover,
.message-card:hover,
.hour-card:hover,
.request-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(58, 51, 37, 0.14);
}

.shift-card h3,
.message-card h3,
.hour-card h3,
.request-card h3 {
  margin-top: 0.7rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.duties-list {
  margin: 0.8rem 0 0;
  padding: 0.8rem 1rem 0.8rem 1.7rem;
  border-radius: var(--radius-small);
  background: rgba(185, 154, 90, 0.1);
}

.duties-list li + li {
  margin-top: 0.35rem;
}

.request-note,
.admin-note,
.shift-description {
  margin-top: 0.7rem;
  padding: 0.75rem;
  border-radius: var(--radius-small);
  background: rgba(112, 121, 87, 0.07);
}

.message-card.pinned {
  border-color: rgba(185, 154, 90, 0.32);
  background:
    linear-gradient(
      180deg,
      rgba(255, 252, 242, 0.98),
      rgba(255, 255, 255, 0.9)
    );
}

/* =========================================================
   SCHEDULE
   ========================================================= */

.schedule-controls {
  display: grid;
  grid-template-columns:
    minmax(280px, 390px)
    auto;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.month-navigation {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: stretch;
  gap: 0.65rem;
  min-width: 0;
}

.month-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-width: 48px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.8);
  color: var(--brand-dark);
  font-size: 2rem;
  line-height: 1;
}

.month-button:hover {
  background: var(--white);
}

.month-display {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 50px;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.74);
  text-align: center;
}

.month-display span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.month-display strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-button {
  align-self: center;
  justify-self: start;
}

.schedule-filters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns:
    repeat(2, minmax(220px, 300px));
  gap: 0.9rem;
}

.staffing-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.staffing-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.legend-dot.critical {
  background: var(--danger);
}

.legend-dot.needs {
  background: var(--warning);
}

.legend-dot.almost {
  background: var(--almost);
}

.legend-dot.full {
  background: var(--success);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.calendar-weekday {
  padding: 0.45rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.77rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.calendar-cell {
  min-width: 0;
  min-height: 122px;
  padding: 0.58rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.68);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.calendar-cell:not(.is-empty) {
  cursor: pointer;
}

.calendar-cell:not(.is-empty):hover,
.calendar-cell.is-selected {
  transform: translateY(-2px);
  border-color: rgba(112, 121, 87, 0.42);
  box-shadow: var(--shadow-sm);
}

.calendar-cell.is-empty {
  opacity: 0.32;
}

.calendar-cell.is-today .calendar-date {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
}

.calendar-date {
  font-weight: 900;
}

.calendar-shift {
  display: block;
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.42rem;
  border: 0;
  border-left: 4px solid var(--brand);
  border-radius: 9px;
  background: rgba(112, 121, 87, 0.11);
  color: var(--ink);
  text-align: left;
  font-size: 0.74rem;
}

.calendar-shift strong,
.calendar-shift span {
  display: block;
}

.calendar-shift strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-day-panel {
  margin-bottom: 1rem;
}

/* =========================================================
   AVAILABILITY
   ========================================================= */

.availability-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1.1fr)
    minmax(340px, 0.9fr);
  align-items: start;
  gap: 1rem;
}

.weekly-availability {
  display: grid;
  gap: 0.75rem;
}

.weekday-row {
  display: grid;
  grid-template-columns:
    minmax(110px, 0.7fr)
    minmax(200px, 1fr);
  align-items: end;
  gap: 0.85rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.55);
}

.weekday-name {
  align-self: center;
  font-weight: 850;
}

.weekday-custom-times {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  min-width: 0;
  padding-top: 0.2rem;
}

.subsection {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.subsection h3 {
  margin-bottom: 0;
}

.specific-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.6);
}

.specific-date-row strong,
.specific-date-row small {
  display: block;
}

/* =========================================================
   PROFILE, REPORTS, MANAGEMENT
   ========================================================= */

.profile-form,
.reports-form {
  max-width: 760px;
}

.management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.management-grid > * {
  min-width: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.reports-form .button-row {
  margin-top: 0.15rem;
}

/* =========================================================
   OPTIONAL DETAILS
   ========================================================= */

.optional-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.52);
  overflow: hidden;
}

.optional-section summary {
  padding: 0.9rem 1rem;
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 820;
}

.optional-section[open] summary {
  border-bottom: 1px solid var(--line);
}

.optional-section-content {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

/* =========================================================
   DIALOGS
   ========================================================= */

.dialog {
  width: min(640px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-large);
  background: transparent;
  box-shadow: var(--shadow-lg);
  overflow: visible;
}

.dialog::backdrop {
  background: rgba(39, 37, 31, 0.52);
  backdrop-filter: blur(4px);
}

.dialog-card {
  display: grid;
  width: 100%;
  max-height: calc(100vh - 2rem);
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-large);
  background: var(--paper-solid);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-header {
  position: sticky;
  top: -1.25rem;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: -1.25rem -1.25rem 0;
  padding: 1.25rem 1.25rem 0.9rem;
  border-bottom: 1px solid rgba(63, 61, 52, 0.08);
  background: var(--paper-solid);
}

.dialog-header > div {
  min-width: 0;
}

.dialog-header h2 {
  margin-bottom: 0;
}

.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 1.65rem;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--ink);
  background: var(--white);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding-top: 0.2rem;
}

.dialog-actions-three {
  justify-content: space-between;
}

/* =========================================================
   PRINT
   ========================================================= */

@media print {
  .sidebar,
  .mobile-header,
  .menu-backdrop,
  .view-heading .button,
  .button-row,
  .text-button,
  .app-feedback {
    display: none !important;
  }

  body,
  .page-background {
    background: var(--white) !important;
  }

  .app-content {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .panel,
  .summary-card,
  .shift-card,
  .message-card,
  .hour-card,
  .request-card {
    box-shadow: none;
  }
}

/* =========================================================
   COMPACT MANAGEMENT LISTS
   ========================================================= */

.management-list {
  display: grid;
  width: 100%;
  min-width: 0;
  max-height: 430px;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.52);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.management-list.empty-state {
  display: block;
  min-height: 84px;
  padding: 1rem;
  color: var(--muted);
}

.management-list:not(.empty-state) {
  align-content: start;
}

.management-row {
  display: grid;
  grid-template-columns:
    minmax(170px, 1.15fr)
    minmax(130px, 0.85fr)
    auto;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.44);
}

.management-row:last-child {
  border-bottom: 0;
}

.management-row:hover {
  background: rgba(255, 255, 255, 0.78);
}

.management-row-main,
.management-row-detail {
  min-width: 0;
}

.management-row-main strong,
.management-row-main small,
.management-row-detail strong,
.management-row-detail small {
  display: block;
}

.management-row-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-row-main small,
.management-row-detail small {
  margin-top: 0.18rem;
  line-height: 1.35;
}

.management-row-detail {
  color: var(--muted);
  font-size: 0.88rem;
}

.management-row-note {
  grid-column: 1 / -1;
  margin: -0.2rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(112, 121, 87, 0.07);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.management-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.button-small {
  min-height: 38px;
  padding: 0.55rem 0.85rem;
  font-size: 0.84rem;
}

.management-status {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 800;
}

.management-status.pending {
  color: #7d650c;
  background: rgba(214, 182, 76, 0.17);
}

.management-status.approved {
  color: #41663d;
  background: rgba(110, 152, 103, 0.16);
}

.management-row.status-pending {
  box-shadow: inset 4px 0 0 var(--almost);
}

.management-row.status-critical {
  box-shadow: inset 4px 0 0 var(--danger);
}

.management-row.status-needs {
  box-shadow: inset 4px 0 0 var(--warning);
}

.management-row.status-almost {
  box-shadow: inset 4px 0 0 var(--almost);
}

.management-row.status-full {
  box-shadow: inset 4px 0 0 var(--success);
}

.management-filter {
  margin-bottom: 0.9rem;
}

.management-filter select {
  width: 100%;
}

.pending-hours-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(112, 121, 87, 0.07);
}

.pending-hours-summary strong,
.pending-hours-summary small {
  display: block;
}

.pending-hours-summary small {
  margin-top: 0.1rem;
}

.pending-hours-total {
  flex: 0 0 auto;
  color: var(--brand-dark);
  font-weight: 850;
  white-space: nowrap;
}

/* =========================================================
   COMPACT SCHEDULE RESULTS
   ========================================================= */

.schedule-results-section {
  margin: 1.15rem 0;
}

.compact-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.compact-section-heading h2 {
  margin-bottom: 0.2rem;
}

.result-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.62);
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.schedule-accordion-list {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 0.65rem;
}

.schedule-accordion-list.empty-state {
  display: block;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
}

.schedule-shift-item {
  position: relative;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 5px solid var(--quiet);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 28px rgba(58, 51, 37, 0.07);
  overflow: hidden;
}

.schedule-shift-item.status-critical {
  border-left-color: var(--danger);
}

.schedule-shift-item.status-needs {
  border-left-color: var(--warning);
}

.schedule-shift-item.status-almost {
  border-left-color: var(--almost);
}

.schedule-shift-item.status-full {
  border-left-color: var(--success);
}

.schedule-shift-item[open] {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(58, 51, 37, 0.1);
}

.schedule-shift-summary {
  display: grid;
  grid-template-columns:
    minmax(145px, 0.8fr)
    minmax(190px, 1.3fr)
    minmax(145px, 0.85fr)
    auto;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.schedule-shift-summary::-webkit-details-marker {
  display: none;
}

.schedule-shift-summary::marker {
  display: none;
  content: "";
}

.schedule-shift-summary::after {
  content: "⌄";
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: var(--brand-dark);
  font-size: 1.1rem;
  font-weight: 900;
  transition: transform 0.18s ease;
}

.schedule-shift-item[open]
  > .schedule-shift-summary::after {
  transform: rotate(180deg);
}

.schedule-shift-summary:hover {
  background: rgba(109, 117, 84, 0.055);
}

.schedule-summary-date,
.schedule-summary-title,
.schedule-summary-time,
.schedule-summary-staffing {
  min-width: 0;
}

.schedule-summary-date strong,
.schedule-summary-date small,
.schedule-summary-title strong,
.schedule-summary-title small,
.schedule-summary-time strong,
.schedule-summary-time small {
  display: block;
}

.schedule-summary-date strong {
  font-size: 0.9rem;
}

.schedule-summary-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
}

.schedule-summary-title small,
.schedule-summary-date small,
.schedule-summary-time small {
  margin-top: 0.12rem;
}

.schedule-summary-time {
  color: var(--ink);
  font-size: 0.88rem;
}

.schedule-summary-staffing {
  display: grid;
  justify-items: start;
  gap: 0.3rem;
}

.schedule-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.schedule-mini-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(109, 117, 84, 0.1);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.schedule-mini-chip.pending {
  color: #806711;
  background: rgba(214, 182, 76, 0.17);
}

.schedule-mini-chip.approved {
  color: #41663d;
  background: rgba(110, 152, 103, 0.16);
}

.schedule-mini-chip.full {
  color: #41663d;
  background: rgba(110, 152, 103, 0.16);
}

.schedule-shift-expanded {
  display: grid;
  gap: 0.85rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
}

.schedule-expanded-top {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(210px, 0.7fr);
  gap: 1rem;
  padding-top: 1rem;
}

.schedule-expanded-description,
.schedule-expanded-duties {
  min-width: 0;
  padding: 0.85rem;
  border-radius: 13px;
  background: rgba(109, 117, 84, 0.055);
}

.schedule-expanded-description p:last-child,
.schedule-expanded-duties ul:last-child {
  margin-bottom: 0;
}

.schedule-expanded-description strong,
.schedule-expanded-duties strong {
  display: block;
  margin-bottom: 0.35rem;
}

.schedule-expanded-duties ul {
  margin: 0;
  padding-left: 1.15rem;
}

.schedule-expanded-duties li + li {
  margin-top: 0.25rem;
}

.schedule-expanded-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.schedule-expanded-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.schedule-expanded-actions .button {
  min-height: 40px;
  padding: 0.58rem 0.95rem;
  font-size: 0.84rem;
}

.selected-day-panel {
  margin-top: 1.3rem;
}

.selected-day-panel .schedule-shift-summary {
  grid-template-columns:
    minmax(170px, 1.2fr)
    minmax(135px, 0.8fr)
    auto;
}

/*
 * The selected day already appears in the panel heading,
 * so its individual shift rows do not need another date column.
 */
.selected-day-panel .schedule-summary-date {
  display: none;
}

/* =========================================================
   MANAGE SHIFT SEARCH AND ORGANIZATION
   ========================================================= */

.manage-shift-tools {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.manage-shift-search {
  width: 100%;
}

.manage-shift-filters {
  width: 100%;
}

.management-shift-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.management-shift-item + .management-shift-item {
  margin-top: 0.65rem;
}

.management-shift-item.status-critical {
  border-left-color: var(--danger);
}

.management-shift-item.status-needs {
  border-left-color: var(--warning);
}

.management-shift-item.status-almost {
  border-left-color: var(--almost);
}

.management-shift-item.status-full {
  border-left-color: var(--success);
}

.management-shift-summary {
  display: grid;
  grid-template-columns:
    minmax(0, 1.3fr)
    minmax(180px, 0.7fr);
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  cursor: pointer;
  list-style: none;
}

.management-shift-summary::-webkit-details-marker {
  display: none;
}

.management-shift-summary::after {
  content: "›";
  justify-self: end;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--brand-dark);
  transform: rotate(90deg);
  transition: transform 0.16s ease;
}

.management-shift-item[open]
  .management-shift-summary::after {
  transform: rotate(-90deg);
}

.management-shift-expanded {
  display: grid;
  gap: 0.8rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
}

.management-shift-meta {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.9rem;
}

.management-shift-meta span {
  color: var(--muted);
}

.management-shift-meta strong {
  color: var(--ink);
}

/* =========================================================
   MANAGEMENT NOTIFICATION BADGES
   ========================================================= */

.management-panel-heading {
  align-items: flex-start;
}

.management-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.management-title-row h2 {
  margin-bottom: 0;
}

.management-notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 42px;
  min-height: 32px;
  padding: 0.34rem 0.72rem;
  border: 1px solid rgba(185, 154, 90, 0.35);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(
      135deg,
      rgba(255, 253, 240, 0.98),
      rgba(232, 213, 143, 0.72)
    );
  color: #6f5b13;
  box-shadow:
    0 0 0 4px rgba(214, 182, 76, 0.08),
    0 8px 20px rgba(185, 154, 90, 0.16);
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.management-notification-badge.has-alert {
  animation: management-badge-glow 2.4s ease-in-out infinite;
}

@keyframes management-badge-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 4px rgba(214, 182, 76, 0.08),
      0 8px 20px rgba(185, 154, 90, 0.16);
  }

  50% {
    box-shadow:
      0 0 0 7px rgba(214, 182, 76, 0.17),
      0 10px 27px rgba(185, 154, 90, 0.3);
  }
}
