/* ============================================================
   PR346C — Lily HQ: Centralized Settings + Nudge Engine
   Styles: pr346c_lily_settings.css
   Namespace: .lily-hq-settings, #lily-hq-settings-content, #myday-lily-nudge-zone
============================================================ */

/* ─── Settings Tab Container ──────────────────────────────────────────────── */

.lily-hq-settings,
#lily-hq-settings-content {
  padding: 0 0 24px 0;
  font-family: inherit;
}

.lily-hq-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid #E0E0E0;
}

.lily-hq-settings-title {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0;
}

.lily-hq-settings-readonly-notice {
  font-size: 12px;
  color: #888;
  background: #F8F8F8;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  padding: 4px 10px;
}

.lily-hq-settings-empty,
.lily-hq-settings-error {
  padding: 24px 20px;
  color: #888;
  font-size: 14px;
}

.lily-hq-settings-advisory {
  padding: 12px 20px;
  font-size: 11px;
  color: #AAAAAA;
  font-style: italic;
  border-top: 1px solid #F0F0F0;
  margin-top: 16px;
}

/* ─── Accordion ───────────────────────────────────────────────────────────── */

#lily-hq-accordion,
.lily-hq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lily-hq-acc-section {
  border-bottom: 1px solid #E0E0E0;
  transition: border-left-color 0.15s ease;
}

.lily-hq-acc-section--active {
  border-left: 3px solid #FF6B00;
}

.lily-hq-acc-section:not(.lily-hq-acc-section--active) {
  border-left: 3px solid transparent;
}

/* ─── Accordion Header ────────────────────────────────────────────────────── */

.lily-hq-acc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F5F5F5;
  border-bottom: 1px solid #E0E0E0;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.lily-hq-acc-header:hover {
  background: #EDEDED;
}

.lily-hq-acc-header:focus {
  outline: 2px solid #FF6B00;
  outline-offset: -2px;
}

.lily-hq-acc-name {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  flex: 1;
  min-width: 0;
}

.lily-hq-acc-meta {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

.lily-hq-acc-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #555;
  white-space: nowrap;
}

.lily-hq-acc-toggle-wrap input[type="checkbox"] {
  accent-color: #FF6B00;
  width: 14px;
  height: 14px;
}

.lily-hq-acc-toggle-label {
  font-size: 11px;
  color: #777;
}

.lily-hq-acc-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 4px;
}

.lily-hq-acc-section--open > .lily-hq-acc-header > .lily-hq-acc-chevron {
  transform: rotate(-135deg);
}

/* ─── Accordion Body ──────────────────────────────────────────────────────── */

.lily-hq-acc-body {
  display: none;
  padding: 16px 20px;
  background: #FAFAFA;
}

.lily-hq-acc-section--open > .lily-hq-acc-body {
  display: block;
}

.lily-hq-acc-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* ─── Config Fields ───────────────────────────────────────────────────────── */

.lily-settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lily-settings-field--check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.lily-settings-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lily-settings-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 0;
}

.lily-settings-checkboxes .lily-settings-field--check {
  min-width: 100px;
}

.lily-settings-label {
  font-size: 12px;
  font-weight: 500;
  color: #555;
}

.lily-settings-label--check {
  font-weight: 400;
  color: #333;
  cursor: pointer;
}

.lily-settings-input,
.lily-settings-select {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid #D0D0D0;
  border-radius: 4px;
  background: #FFFFFF;
  color: #1A1A1A;
  max-width: 220px;
  transition: border-color 0.15s ease;
}

.lily-settings-input:focus,
.lily-settings-select:focus {
  outline: none;
  border-color: #FF6B00;
  box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.12);
}

.lily-settings-input--time {
  max-width: 130px;
}

.lily-settings-checkbox {
  width: 14px;
  height: 14px;
  accent-color: #FF6B00;
  cursor: pointer;
}

.lily-settings-no-config {
  font-size: 12px;
  color: #AAA;
  font-style: italic;
  margin: 0;
}

/* ─── Disabled / Admin view ───────────────────────────────────────────────── */

.lily-settings-input:disabled,
.lily-settings-select:disabled,
.lily-settings-checkbox:disabled,
.lily-hq-acc-active-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lily-hq-acc-toggle-wrap:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ─── Accordion Action Buttons ────────────────────────────────────────────── */

.lily-hq-acc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

/* Button base */
.lily-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.lily-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Orange primary */
.lily-btn--orange {
  background: #FF6B00;
  color: #FFFFFF;
  border-color: #FF6B00;
}

.lily-btn--orange:hover:not(:disabled) {
  background: #E05A00;
  border-color: #E05A00;
}

/* Ghost */
.lily-btn--ghost {
  background: transparent;
  color: #FF6B00;
  border-color: #FF6B00;
}

.lily-btn--ghost:hover:not(:disabled) {
  background: rgba(255, 107, 0, 0.06);
}

/* Armed confirm state */
.lily-btn--confirm-armed {
  background: #C0392B;
  border-color: #C0392B;
  color: #FFFFFF;
}

.lily-btn--confirm-armed.lily-btn--ghost {
  background: rgba(192, 57, 43, 0.08);
  color: #C0392B;
  border-color: #C0392B;
}

/* ─── My Day Nudge Zone ───────────────────────────────────────────────────── */

#myday-lily-nudge-zone,
.myday-lily-nudge-zone {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 4px 0;
}

/* ─── Nudge Cards ─────────────────────────────────────────────────────────── */

.lily-nudge-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #FFFFFF;
  border-left: 4px solid #FF6B00;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 8px;
  position: relative;
}

.lily-nudge-message {
  font-size: 13px;
  color: #222;
  line-height: 1.5;
  flex: 1;
}

.lily-nudge-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #999;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color 0.1s ease, background 0.1s ease;
  white-space: nowrap;
}

.lily-nudge-dismiss:hover {
  color: #555;
  background: #F0F0F0;
}

.lily-nudge-dismiss:focus {
  outline: 2px solid #FF6B00;
  outline-offset: 1px;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .lily-hq-acc-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .lily-hq-acc-meta {
    width: 100%;
    order: 3;
  }

  .lily-settings-input,
  .lily-settings-select {
    max-width: 100%;
  }

  .lily-hq-acc-actions {
    flex-wrap: wrap;
  }
}

/* ── Setup wizard blocks (PR347) ────────────────────────────────────── */
.lily-setup-block {
  background: #f9f9fb;
  border: 1px solid #e8e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.lily-setup-block.lily-setup-required {
  border-left: 3px solid #FF6B00;
}
.lily-setup-block-title {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A2E;
  margin-bottom: 6px;
}
.lily-setup-desc {
  font-size: 12px;
  color: #555;
  margin-bottom: 12px;
  line-height: 1.5;
}
.lily-cfg-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #444;
  margin: 8px 0 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lily-cfg-input,
.lily-cfg-select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #d0d0dd;
  border-radius: 5px;
  font-size: 13px;
  color: #1A1A2E;
  background: #fff;
  margin-bottom: 4px;
}
.lily-cfg-input:disabled,
.lily-cfg-select:disabled {
  background: #f4f4f8;
  color: #888;
  cursor: not-allowed;
}
.lily-cfg-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  margin: 8px 0;
  cursor: pointer;
}
.lily-cfg-checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.lily-setup-note {
  font-size: 11px;
  color: #888;
  margin-top: 10px;
  padding: 8px 10px;
  background: #f0f0f8;
  border-radius: 4px;
  line-height: 1.5;
}
