/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background-color: var(--bg);
}

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --soft: #f5f0ec;
  --line: #e8ddd5;
  --text: #5c4141;
  --muted: #8b6f5f;
  --primary: #c77457;
  --primary-hover: #d17856;
  --accent: #d4b483;
  --accent2: #c9a975;
  --shadow: 0 4px 6px rgba(92, 65, 65, 0.1);
  --radius: 12px;
  --input-bg: #ffffff;
  --input-text: #5c4141;
  --input-border: #e8ddd5;
  --input-placeholder: #8b6f5f;

  /* Legacy token compatibility */
  --surface: var(--panel);
  --surface-muted: var(--soft);
  --border: var(--line);
  --border-strong: var(--line);
  --text-primary: var(--text);
  --text-muted: var(--muted);
  --text-soft: var(--muted);
  --accent-soft: rgba(212, 180, 131, 0.25);
  --accent-strong: var(--primary);
  --danger: #b94d4d;
  --radius-lg: var(--radius);
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow-sm: var(--shadow);
  --shadow-lg: 0 24px 48px rgba(92, 65, 65, 0.18);
  --nav-width: 260px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

.auth-loading {
  opacity: 0;
  transition: opacity 0.3s;
}

/* Sidebar */
.side-menu {
  width: var(--nav-width);
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 2rem 0;
  overflow-y: auto;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  box-shadow: var(--shadow);
}

.menu-logo {
  width: 180px;
  height: auto;
  display: block;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.user-info {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

#userName {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.user-role {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  text-transform: capitalize;
}

#logoutBtn {
  display: none;
}

.side-menu ul {
  list-style: none;
}

.menu-header {
  padding: 0.75rem 1.5rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 1rem;
}

.side-menu li[data-roles] a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.9375rem;
}

.side-menu li[data-roles] a:hover {
  background: var(--soft);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: calc(1.5rem - 3px);
}

.side-menu li[data-roles] a.active {
  background: var(--soft);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: calc(1.5rem - 3px);
  font-weight: 600;
}

.menu-icon {
  font-size: 1.125rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  filter: grayscale(100%);
  opacity: 0.7;
}

.side-menu li[data-roles] a:hover .menu-icon,
.side-menu li[data-roles] a.active .menu-icon {
  opacity: 1;
}

/* GLP Tools Layout */
.glp-main {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.glp-main h1,
.glp-main h2 {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.glp-main h3 {
  margin: 24px 0 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 600;
}

.glp-main .main-header,
.glp-main .tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.glp-main .tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.glp-main .tab {
  border: none;
  background: transparent;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.glp-main .tab:hover {
  color: var(--text-primary);
}

.glp-main .tab.active,
.glp-main .tab[aria-selected="true"] {
  color: var(--text-primary);
  border-color: var(--text-primary);
  font-weight: 600;
}

.glp-main .tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.glp-main .tab-content {
  display: block;
  margin-top: 4px;
}

.glp-main .tab-content[hidden] {
  display: none;
}

.glp-main .dose-iframe {
  width: 100%;
  min-height: 800px;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--border);
}

.glp-main .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.glp-main .form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.glp-main label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
}

.glp-main input,
.glp-main select,
.glp-main textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--input-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glp-main input:focus,
.glp-main select:focus,
.glp-main textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.glp-main textarea {
  resize: vertical;
  min-height: 120px;
}

.glp-main .readonly-field {
  background: var(--surface-muted);
  color: var(--text-soft);
}

.glp-main .reset-button.lg {
  padding: 12px 20px;
  font-size: 15px;
}

.glp-main .info-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 500;
}

.glp-main .form-group.highlight {
  background: #fff8eb;
  border: 1px solid #ffe3b8;
  border-radius: var(--radius-md);
  padding: 18px;
}

.glp-main .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.glp-main .chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.glp-main .chip.active,
.glp-main .chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.glp-main .chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.glp-main .bmi-chip {
  font-weight: 600;
  font-size: 18px;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-strong);
}

.glp-main .form-group-flex-end {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.glp-main .muted {
  color: var(--text-soft);
  font-size: 13px;
}

.glp-main .instructions-output {
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  display: none;
}

.glp-main .instructions-output:not([hidden]) {
  display: block;
}

.glp-main #instructions-content {
  white-space: pre-wrap;
  line-height: 1.6;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 13px;
}

.glp-main #instructions-content a.payment-url {
  color: var(--accent);
  word-break: break-word;
}

.glp-main #instructions-content a.payment-url:hover {
  color: var(--accent-strong);
}

.glp-main .copy-button {
  background: var(--accent);
  color: #fff;
  margin-top: 16px;
}

.glp-main .copy-button:hover {
  background: var(--accent-strong);
}

.glp-main .calendar-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* Navigation icons */
.side-menu a[href="index.html"]::before,
.side-menu a[href="index.html#"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75V19.5A1.5 1.5 0 006 21h12a1.5 1.5 0 001.5-1.5V9.75'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 21V12h6v9'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75V19.5A1.5 1.5 0 006 21h12a1.5 1.5 0 001.5-1.5V9.75'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 21V12h6v9'/%3E%3C/svg%3E");
}

.side-menu a[href="providers.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 19.128a9 9 0 106 0M15 19.128a9 9 0 01-12 0M15 19.128a3 3 0 11-6 0M21 8.25a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zM7.5 8.25a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 19.128a9 9 0 106 0M15 19.128a9 9 0 01-12 0M15 19.128a3 3 0 11-6 0M21 8.25a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zM7.5 8.25a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z'/%3E%3C/svg%3E");
}


.side-menu a[href="ordering-guide.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 5.25h15M6 3.75v16.5m12-16.5v16.5M8.25 8.25h7.5M8.25 12h7.5M8.25 15.75h4.5'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 5.25h15M6 3.75v16.5m12-16.5v16.5M8.25 8.25h7.5M8.25 12h7.5M8.25 15.75h4.5'/%3E%3C/svg%3E");
}

.side-menu a[href="client-tags.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.59 14.37L20.25 9.75a2.25 2.25 0 000-3.182L17.432 3.75a2.25 2.25 0 00-3.182 0L9.568 8.432M15.59 14.37a2.25 2.25 0 01-3.182 0l-6.5-6.5a2.121 2.121 0 010-3l2.182-2.182a2.121 2.121 0 013 0l6.5 6.5a2.25 2.25 0 010 3.182zM4.5 19.5h15'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.59 14.37L20.25 9.75a2.25 2.25 0 000-3.182L17.432 3.75a2.25 2.25 0 00-3.182 0L9.568 8.432M15.59 14.37a2.25 2.25 0 01-3.182 0l-6.5-6.5a2.121 2.121 0 010-3l2.182-2.182a2.121 2.121 0 013 0l6.5 6.5a2.25 2.25 0 010 3.182zM4.5 19.5h15'/%3E%3C/svg%3E");
}

.side-menu a[href="tracking.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m21 21-5.197-5.197m0 0A7.5 7.5 0 1010.5 18a7.5 7.5 0 005.303-2.197z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m21 21-5.197-5.197m0 0A7.5 7.5 0 1010.5 18a7.5 7.5 0 005.303-2.197z'/%3E%3C/svg%3E");
}

.side-menu a[href="copy-of-prescription.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 17.25l-1.5 1.5a2.121 2.121 0 01-3 0l-1.5-1.5a2.121 2.121 0 010-3L7.5 9.75m3 7.5l7.5-7.5M6 21h12a1.5 1.5 0 001.5-1.5V7.5L15 3H6A1.5 1.5 0 004.5 4.5v12A1.5 1.5 0 006 18h9'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 17.25l-1.5 1.5a2.121 2.121 0 01-3 0l-1.5-1.5a2.121 2.121 0 010-3L7.5 9.75m3 7.5l7.5-7.5M6 21h12a1.5 1.5 0 001.5-1.5V7.5L15 3H6A1.5 1.5 0 004.5 4.5v12A1.5 1.5 0 006 18h9'/%3E%3C/svg%3E");
}

.side-menu a[href="email.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 8.25l-9 5.25-9-5.25m18 0L12 3 3 8.25m18 0V18a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 18V8.25'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 8.25l-9 5.25-9-5.25m18 0L12 3 3 8.25m18 0V18a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 18V8.25'/%3E%3C/svg%3E");
}


.side-menu a[href="reviews.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7.5 8.25h9m-9 3h9m-9 3h5.25M21 5.25v11.518c0 .436-.178.855-.494 1.16l-2.088 1.98a1.625 1.625 0 01-1.12.442H6.702c-.414 0-.81-.162-1.103-.45l-2.1-2.05A1.62 1.62 0 013 16.78V5.25A2.25 2.25 0 015.25 3h13.5A2.25 2.25 0 0121 5.25z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7.5 8.25h9m-9 3h9m-9 3h5.25M21 5.25v11.518c0 .436-.178.855-.494 1.16l-2.088 1.98a1.625 1.625 0 01-1.12.442H6.702c-.414 0-.81-.162-1.103-.45l-2.1-2.05A1.62 1.62 0 013 16.78V5.25A2.25 2.25 0 015.25 3h13.5A2.25 2.25 0 0121 5.25z'/%3E%3C/svg%3E");
}

.side-menu a[href="payment-link.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.25 8.25A2.25 2.25 0 014.5 6h15a2.25 2.25 0 012.25 2.25v7.5A2.25 2.25 0 0119.5 18h-15a2.25 2.25 0 01-2.25-2.25v-7.5zM2.25 9h19.5M6 15h.008v.008H6V15z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.25 8.25A2.25 2.25 0 014.5 6h15a2.25 2.25 0 012.25 2.25v7.5A2.25 2.25 0 0119.5 18h-15a2.25 2.25 0 01-2.25-2.25v-7.5zM2.25 9h19.5M6 15h.008v.008H6V15z'/%3E%3C/svg%3E");
}

.side-menu a[href="create-product.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 12l-9-9-9 9 9 9 9-9zM12 21V12'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 12l-9-9-9 9 9 9 9-9zM12 21V12'/%3E%3C/svg%3E");
}

.side-menu a[href="admin-settings.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9.669 3.75l.29 1.161a2.25 2.25 0 001.557 1.61l.486.146a2.25 2.25 0 011.437 1.437l.146.486a2.25 2.25 0 001.61 1.557l1.161.29v2.885l-1.161.29a2.25 2.25 0 00-1.61 1.557l-.146.486a2.25 2.25 0 01-1.437 1.437l-.486.146a2.25 2.25 0 00-1.557 1.61l-.29 1.161H6.532l-.29-1.161a2.25 2.25 0 00-1.557-1.61l-.486-.146a2.25 2.25 0 01-1.437-1.437l-.146-.486a2.25 2.25 0 00-1.61-1.557l-1.161-.29v-2.885l1.161-.29a2.25 2.25 0 001.61-1.557l.146-.486a2.25 2.25 0 011.437-1.437l.486-.146a2.25 2.25 0 001.557-1.61l.29-1.161h3.137zM18.75 15.75h3.375m-3.375-3.375h3.375M18.75 21h3.375'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9.669 3.75l.29 1.161a2.25 2.25 0 001.557 1.61l.486.146a2.25 2.25 0 011.437 1.437l.146.486a2.25 2.25 0 001.61 1.557l1.161.29v2.885l-1.161.29a2.25 2.25 0 00-1.61 1.557l-.146.486a2.25 2.25 0 01-1.437 1.437l-.486.146a2.25 2.25 0 00-1.557 1.61l-.29 1.161H6.532l-.29-1.161a2.25 2.25 0 00-1.557-1.61l-.486-.146a2.25 2.25 0 01-1.437-1.437l-.146-.486a2.25 2.25 0 00-1.61-1.557l-1.161-.29v-2.885l1.161-.29a2.25 2.25 0 001.61-1.557l.146-.486a2.25 2.25 0 011.437-1.437l.486-.146a2.25 2.25 0 001.557-1.61l.29-1.161h3.137zM18.75 15.75h3.375m-3.375-3.375h3.375M18.75 21h3.375'/%3E%3C/svg%3E");
}

.side-menu a[href="updates.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.25 9V5.25A2.25 2.25 0 0110.5 3h3a2.25 2.25 0 012.25 2.25V9m-9 0h9m-9 0v6.75m9-6.75v6.75M5.25 9h13.5a1.5 1.5 0 011.5 1.5v4.5a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5v-4.5A1.5 1.5 0 015.25 9z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.25 9V5.25A2.25 2.25 0 0110.5 3h3a2.25 2.25 0 012.25 2.25V9m-9 0h9m-9 0v6.75m9-6.75v6.75M5.25 9h13.5a1.5 1.5 0 011.5 1.5v4.5a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5v-4.5A1.5 1.5 0 015.25 9z'/%3E%3C/svg%3E");
}

.side-menu a[href="json.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7.5 3.75h9A2.25 2.25 0 0118.75 6v12A2.25 2.25 0 0116.5 20.25h-9A2.25 2.25 0 015.25 18V6A2.25 2.25 0 017.5 3.75zM12 8.25v7.5M9 10.5v2.25M15 10.5v2.25'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7.5 3.75h9A2.25 2.25 0 0118.75 6v12A2.25 2.25 0 0116.5 20.25h-9A2.25 2.25 0 015.25 18V6A2.25 2.25 0 017.5 3.75zM12 8.25v7.5M9 10.5v2.25M15 10.5v2.25'/%3E%3C/svg%3E");
}

.side-menu a[href="error.html"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 9v3.75m0 3.75h.008v.008H12V16.5zm-9.303 2.651a1.125 1.125 0 010-1.652L10.35 2.977c.21-.227.502-.352.808-.352s.598.125.808.352l7.653 8.522a1.125 1.125 0 010 1.652l-7.653 8.523a1.125 1.125 0 01-1.616 0L2.697 19.15z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 9v3.75m0 3.75h.008v.008H12V16.5zm-9.303 2.651a1.125 1.125 0 010-1.652L10.35 2.977c.21-.227.502-.352.808-.352s.598.125.808.352l7.653 8.522a1.125 1.125 0 010 1.652l-7.653 8.523a1.125 1.125 0 01-1.616 0L2.697 19.15z'/%3E%3C/svg%3E");
}

/* Layout */
.container,
.main-content {
  width: calc(100% - var(--nav-width));
  margin-left: var(--nav-width);
  padding: 3rem;
  max-width: 1400px;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.header,
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  animation: fadeIn 0.3s ease;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(92, 65, 65, 0.18);
}

.tagline {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.page-title,
.header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle,
.sub,
.header .sub {
  color: var(--muted);
  font-size: 0.9375rem;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.main-header h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
}

.tab {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--primary);
  background: var(--soft);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Tab Content */
.tab-content {
  animation: fadeIn 0.3s;
}

.tab-content[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.tab-header h2 {
  font-size: 1.5rem;
  color: var(--text);
}

/* Cards */
.card,
.panel {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 1.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.section-icon {
  font-size: 2rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group.highlight {
  background: var(--soft);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--line);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group-flex-end {
  display: flex;
  align-items: flex-end;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9375rem;
}

.form-label {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
}

.form-description {
  font-size: 0.875rem;
  color: var(--muted);
}

.input-field,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 1rem;
  transition: all 0.2s;
}

.input-field:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(199, 116, 87, 0.1);
}

input::placeholder,
textarea::placeholder,
select::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}

.input-group {
  display: flex;
  gap: 0.75rem;
}

.input-group .input-field,
.input-group input,
.input-group select {
  flex: 1;
}


button,
.btn,
.submit-btn,
input[type="submit"],
input[type="button"],
.side-menu button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

button:hover,
.btn:hover,
.submit-btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(92, 65, 65, 0.15);
}

button:active,
.btn:active,
.submit-btn:active,
input[type="submit"]:active,
input[type="button"]:active {
  transform: translateY(0);
}

button:disabled,
.btn:disabled,
.submit-btn:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.reset-button,
.btn.secondary {
  background: var(--soft);
  color: var(--text);
  box-shadow: none;
  border: 2px solid var(--line);
}

.reset-button:hover,
.btn.secondary:hover {
  background: var(--line);
  border-color: var(--muted);
}

.reset-button.lg {
  padding: 1rem 2rem;
}

.search-btn {
  background: var(--accent2);
  padding: 0.625rem 1.25rem;
}

.search-btn:hover {
  background: var(--accent);
}


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

.success-message {
  display: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.08));
  border: 1px solid rgba(34, 197, 94, 0.32);
  padding: 16px;
  color: #166534;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 1024px) {
  .side-menu {
    width: 220px;
  }

  .container,
  .main-content {
    margin-left: 220px;
    width: calc(100% - 220px);
  }
}

@media (max-width: 768px) {
  .side-menu {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .side-menu.open {
    transform: translateX(0);
  }

  .container,
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem;
  }

  .form-row,
  .two-column {
    grid-template-columns: 1fr;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* Chips */
.chips,
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.chip,
.tag-chip {
  background: var(--soft);
  border: 2px solid var(--line);
  padding: 0.625rem 1rem;
  border-radius: 2rem;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.chip:hover,
.tag-chip:hover {
  border-color: var(--primary);
  background: var(--panel);
}

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip-alert {
  background: #b94d4d;
  color: #fff;
  border-color: #b94d4d;
  box-shadow: 0 0 12px rgba(185, 77, 77, 0.4);
}

.bmi-chip {
  background: var(--accent2);
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: default;
  padding: 0.75rem 1.5rem;
}

.info-chip {
  background: linear-gradient(135deg, rgba(199, 116, 87, 0.1), rgba(212, 180, 131, 0.1));
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-weight: 500;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.remove-tag {
  cursor: pointer;
  font-weight: 600;
}

.submit-btn {
  width: 100%;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Success Message */
.success-message {
  display: none;
  background: var(--soft);
  color: var(--primary);
  padding: 1.25rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  margin-top: 1.5rem;
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.error-message {
  background: rgba(185, 77, 77, 0.15);
  color: #b94d4d;
  padding: 1rem;
  border-radius: var(--radius);
  border: 2px solid rgba(185, 77, 77, 0.3);
  margin-bottom: 1.5rem;
}

.warning-message {
  background: rgba(212, 180, 131, 0.2);
  color: var(--text);
  padding: 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  margin-bottom: 1.5rem;
}

nav a.active {
  color: var(--primary);
  font-weight: 600;
}
h1 {
  color: var(--text);
  font-size: 2rem;
  font-weight: 700;
}

section,
form {
  background: var(--panel);
  padding: 2rem;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  max-width: 900px;
  margin: 0 auto;
}

section input,
form input,
form select,
form textarea {
  width: 100%;
  margin-top: 0.75rem;
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

.warnings-block {
  background: rgba(212, 180, 131, 0.15);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
  color: var(--text);
}

.hidden {
  display: none;
}

/* Updates page */
.updates-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.update-section {
  margin: 0;
  width: 100%;
  text-align: left;
}

.update-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.update-section ul {
  list-style: disc;
  margin-left: 1.5rem;
  color: var(--text);
}

.update-footer {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}


/* Admin Settings */
.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.user-table th,
.user-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9375rem;
  color: var(--text);
}

.user-table th {
  background: var(--soft);
  font-weight: 600;
  color: var(--muted);
}

.role-select {
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.role-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(199, 116, 87, 0.1);
}

/* Auth Styles */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 2rem;
}

.auth-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 16px 32px rgba(92, 65, 65, 0.2);
  width: 100%;
  max-width: 400px;
  border: 2px solid var(--line);
}

.auth-logo {
  display: block;
  margin: 0 auto 2rem;
  max-width: 150px;
  height: auto;
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text);
  font-size: 1.75rem;
}

.auth-links {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.875rem;
  display: block;
  margin: 0.25rem 0;
}

.auth-links a:hover {
  text-decoration: underline;
}

.error-message {
  background: rgba(185, 77, 77, 0.15);
  color: #b94d4d;
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  display: none;
  text-align: center;
}

/* Role-based visibility classes */
.admin-only,
.provider-only,
.staff-only {
    transition: all 0.3s ease;
}

[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Menu item hiding */
.side-menu li[style*="display: none"] {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
}


.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.users-table th,
.users-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--text);
}

.users-table th {
  background: var(--soft);
  font-weight: 600;
  color: var(--muted);
}

.role-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.role-admin {
  background: var(--primary);
  color: #fff;
}

.role-staff {
  background: var(--accent2);
  color: #fff;
}

.role-provider {
  background: var(--accent);
  color: #5c4141;
}

.status-active {
  background: rgba(199, 116, 87, 0.2);
  color: var(--primary);
}

.status-inactive {
  background: var(--soft);
  color: var(--muted);
}

.status-pending {
  background: rgba(212, 180, 131, 0.25);
  color: var(--text);
}

.action-btn {
  padding: 0.5rem 1rem;
  margin: 0.125rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.2s;
}

.edit-btn {
  background: var(--primary);
  color: #fff;
}

.delete-btn {
  background: #b94d4d;
  color: #fff;
}

.resend-btn {
  background: var(--accent2);
  color: #fff;
}

.cancel-btn {
  background: var(--soft);
  color: var(--text);
  border: 2px solid var(--line);
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(92, 65, 65, 0.15);
}

.pending-invitation {
  background-color: rgba(212, 180, 131, 0.15);
}

.user-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--panel);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(92, 65, 65, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--panel);
  padding: 0;
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  max-height: 90%;
  overflow-y: auto;
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  color: var(--text);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--text);
}

.modal form {
  padding: 1.5rem 2rem 2rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* Role-based navigation styles */
.nav-item {
    display: none;
    transition: all 0.3s ease;
}

.nav-item.role-admin,
.nav-item.role-staff,
.nav-item.role-provider {
    display: none;
}

/* User role indicator */
.user-role {
    display: block;
    font-size: 0.875rem;
    color: var(--muted);
    text-transform: capitalize;
}

/* Submenu styles */
.submenu {
    display: none;
    list-style: none;
    padding-left: 1.25rem;
    margin-top: 0.5rem;
}

.submenu li {
    margin: 0.25rem 0;
}

.submenu li a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.submenu li a:hover {
    color: var(--primary);
}

.dropdown-toggle.active + .submenu {
    display: block;
}

/*
  The interface previously adapted to the operating system theme using the
  `prefers-color-scheme: dark` media query. This caused the application to
  automatically swap to a dark palette when the OS was in dark mode, even if
  the in-app preferences expected to remain on the default light theme. To keep
  the experience consistent regardless of the system setting, the media query
  has been removed.
*/

