.settings-card{
  background-color: var(--card-bg);
  padding: 12px;
  border-radius: 16px;
  display: flex;
  font-weight: 340;
  font-size: 15px;
  color: var(--text-2);
  text-decoration: none;
  justify-content: space-between;
  transition: all 0.1s;
}
.settings-card:hover{
  color: var(--link-blue);
}
.settings-inner{
  align-items: center;
  display: flex;
  gap: 6px;
  letter-spacing: 0.1px;
  text-decoration: none;
  
}

.action-btn{
border: none;
padding: 8px 14px;
border-radius: 8px;
font-size: 15px;
color: var(--text-2);
background-color: var(--contrast-bg);
}

/* --- SETTINGS PAGE STYLES --- */
#view-settings {
  padding-bottom: 120px;
}



.settings-group-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 4px;
  margin-bottom: 6px;
  margin-top: 18px;
}

.settings-group {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
}

.settings-row, .settings-row-btn, .settings-check-row, .settings-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  width: 100%;
  background: var(--card-bg);
  color: var(--text-2);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  box-sizing: border-box;
  border-bottom: 1px solid var(--bg-color);
}

.settings-group > *:last-child {
  border-bottom: none;
}

.settings-row-btn {
  border: none;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--bg-color);
}
.settings-row-btn:hover{
    background-color: #8080800d;
}

.row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-icon{
    background-color: var(--contrast-bg);
    border-radius: 11px;
    height: 30px;
    width: 30px;
}
.settings-icon-cycle{
    background-color: #f7b5db;
    color: #913e86;
    border-radius: 11px;
    height: 30px;
    width: 30px;
}.settings-icon-rest{
    background-color: #dccde9;
    color: #7c43ae;
    border-radius: 11px;
    height: 30px;
    width: 30px;
}.settings-icon-cals{
    background-color: #b5d9f7;
    color: #3c669f;
    border-radius: 11px;
    height: 30px;
    width: 30px;
}.settings-icon-meds{
    background-color: #f7ceb5;
    color: #a16134;
    border-radius: 11px;
    height: 30px;
    width: 30px;
}.settings-icon-mind{
    background-color: #cde9d7;
    color: #198159;
    border-radius: 11px;
    height: 30px;
    width: 30px;
}

.chevron {
  font-size: 1.2rem;
  color: var(--text-3);
}
.ext-link{
  height: 30px;
  width: 30px;
  color: var(--text-3);
}

/* iOS Toggle Switches */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 24px;
  transition: 0.2s;
  cursor: pointer;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

input:checked + .slider { background-color: #34d399; }
input:checked + .slider:before { transform: translateX(20px); }

/* Slide-In Sub-Drawers (/// Views) */
.settings-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 100;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.settings-drawer.open {
  right: 0;
}

.drawer-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px;
  color: var(--text-2);
  margin-right: 6px;

  border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
}.drawer-nav h3{
  font-weight: 460;
  font-size: 15px;
}


.drawer-back-btn {
  background: transparent;
  border: none;
  font-size: 15px;
  font-weight: 400;
  color: var(--link-blue);
  cursor: pointer;
}

.drawer-save-btn{
    border: none;
    color: var(--text-main);
    background-color: #dfe3e9;
    padding: 12px;
    font-size: 15px;
    border-radius: 12px;
    margin: 0 auto;
    width: 93vw;
    font-weight: 360;
    transition: 0.1s;
}
.drawer-save-btn:hover{
    background-color: #cdd1d7;
}

.drawer-content {
  padding: 16px;
  overflow-y: auto;
}

.drawer-hint {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 320;
  margin-bottom: 12px;
}

.settings-input-row input, .settings-input-row select {
  border: none;
  background: transparent;
  text-align: right;
  color: var(--text-2);
  font-size: 15px;
}





.settings-trigger-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -4px;
  margin-top: -20px;
  transition: background-color 0.2s ease, transform 0.15s ease;
}.settings-trigger-btn svg{
  height: 42px;
  width: auto;
}

.settings-trigger-btn:active {
  transform: scale(0.92);
}

/* Slide-In Settings Drawer */
#view-settings.settings-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 90;
  transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

#view-settings.settings-drawer.open {
  right: 0;
}

/* Sub-drawers stack on top of main settings */
.settings-drawer .settings-drawer {
  z-index: 100;
}

/* --- ARCHIVED MEDICATIONS DRAWER --- */

/* The detail drawer opens on top of the archived-meds list drawer, which
   is itself already a sibling ".settings-drawer" (same tier as export /
   demographics, z-index: 100 from the rule above). It needs a higher
   z-index of its own so it visually stacks above that list instead of
   tying for the same layer. */
#drawer-archived-med-detail {
  z-index: 110;
}

.drawer-delete-btn {
  background-color: #fdecea;
  color: #c62828;
}

.drawer-delete-btn:hover {
  background-color: #f8d7da;
}

/* --- ARCHIVED MEDICATIONS: EXPORT AS PDF ---
   #pdf-print-area is hidden on-screen and only shown while printing, via
   a print-only stylesheet (see master.css / global print rules). It is
   populated on demand by printArchivedMedsRecord() in settings.js right
   before window.print() is called. */
#pdf-print-area {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  #pdf-print-area,
  #pdf-print-area * {
    visibility: visible;
  }

  #pdf-print-area {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    color: #000;
    background: #fff;
  }

  #pdf-print-area h1 {
    font-size: 20px;
    margin-bottom: 2px;
  }

  #pdf-print-area p {
    font-size: 12px;
    color: #444;
    margin-bottom: 16px;
  }

  #pdf-print-area table {
    width: 100%;
    border-collapse: collapse;
  }

  #pdf-print-area th,
  #pdf-print-area td {
    border: 1px solid #999;
    padding: 6px 8px;
    font-size: 12px;
    text-align: left;
  }
}
