/* Graphic Design Eye — shared UI components
   Buttons, dialogs, toast, menus, form fields, confirmations, switches, breadcrumbs, cards and the
   admin/client visibility rules. Every page loads this right after styles.css. Kept separate from styles.css
   so both files stay small and download side by side. */

/* =====================================================================
   Shared components: buttons, dialogs, toast, menus, form fields, confirmations, switches, breadcrumbs,
   cards and the admin/client visibility rules. They live here so list pages need only this stylesheet
   (moved from task.css and forms.css; their order is unchanged)
   ===================================================================== */

/* ---------- from task.css ---------- */

/* text areas (base look; .gde-field__control and page rules refine it) */
textarea {
  width: 100%; resize: vertical; padding: 12px 14px; border-radius: 12px; border: 1px solid #dfe2dc; background: #fff;
  font: inherit; color: var(--text); line-height: 1.5;
}
textarea::placeholder { color: #8a918c; }
textarea:focus { outline: none; border-color: var(--brand-strong); box-shadow: var(--focus); }
.gde-card { background: var(--surface); border: 1px solid var(--line-panel); border-radius: var(--radius-card); padding: 20px; }
.gde-card h2 { font-size: 16px; font-weight: 600; color: var(--ink); }
.gde-icon-btn--sm { width: 30px; height: 30px; border-radius: 8px; }
.gde-icon-btn--sm .gde-icon { width: 16px; height: 16px; }
.gde-icon-btn--danger:hover { color: var(--st-revision-fg); background: var(--st-revision-bg); }
.gde-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 14px; white-space: nowrap;
  border: 1px solid transparent; transition: filter .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease);
}
.gde-btn .gde-icon { width: 18px; height: 18px; stroke-width: 2.2; }
.gde-btn--primary { background: var(--brand); color: var(--ink); }
.gde-btn--primary:hover { filter: brightness(.95); }
.gde-btn--primary:disabled { background: #e3eedd; color: #8a9b8f; cursor: not-allowed; filter: none; }
.gde-btn--dark { background: var(--ink); color: #fff; }
.gde-btn--dark:hover { background: #1e2a22; }
.gde-btn--ghost { background: #fff; border-color: #dfe2dc; color: var(--ink); }
.gde-btn--ghost:hover { background: var(--surface-2); border-color: #cfd4cb; }
.gde-btn--sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.gde-btn--sm .gde-icon { width: 15px; height: 15px; }
.gde-btn--block { width: 100%; }
.gde-crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.gde-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.gde-crumbs [aria-current] { color: var(--text-2); }
.gde-switch { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; font-size: 13px; color: #3f4a44; cursor: pointer; user-select: none; }
.gde-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gde-switch__track { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #d5dad2; transition: background-color .2s var(--ease); flex: none; }
.gde-switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.gde-switch input:checked + .gde-switch__track { background: var(--brand-strong); }
.gde-switch input:checked + .gde-switch__track::after { transform: translateX(16px); }
.gde-switch input:focus-visible + .gde-switch__track { box-shadow: var(--focus); }
@media (max-width: 767.98px) {
  .gde-card { padding: 16px; border-radius: 14px; }
  .gde-switch { margin-left: 0; }
}
.gde-btn--on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.gde-btn--on-dark:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .6); }
.gde-crumbs--back { align-items: center; gap: 4px; }
.gde-crumbs__back { transform: rotate(180deg); color: var(--muted-2); }
.gde-crumbs--back a { color: var(--muted); }
.gde-btn--on-light { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.gde-btn--on-light:hover { background: var(--surface-2); }

/* ---------- from forms.css ---------- */
.gde-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.gde-field__label { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.gde-req { color: #d4441c; margin-left: 2px; }
.gde-field__hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.gde-field__error { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: #c8401a; }
.gde-field__error[hidden] { display: none; }
.gde-field__control {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid #dfe2dc; border-radius: 12px; background: #fff;
  font: inherit; font-size: 14px; color: var(--ink); transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.gde-field__control::placeholder { color: #949b96; }
.gde-field__control:hover:not(:disabled) { border-color: #c9cec6; }
.gde-field__control:focus, .gde-field__control:focus-visible { outline: none; border-color: var(--brand-strong); box-shadow: var(--focus); border-radius: 12px; }
.gde-field__control:disabled { background: var(--surface-2); color: var(--muted-2); cursor: not-allowed; border-color: var(--line-2); }
.gde-field__control[aria-invalid="true"] { border-color: #e2734f; }
.gde-field__control[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(255, 107, 61, .22); }
input[type="date"].gde-field__control { padding-right: 10px; }
input[type="date"].gde-field__control::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.gde-field__select { position: relative; display: flex; align-items: center; }
.gde-field__select select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; text-overflow: ellipsis; }
.gde-field__chev { position: absolute; right: 14px; color: var(--muted); pointer-events: none; stroke-width: 2.2; }
.gde-switch--sm .gde-switch__track { width: 30px; height: 17px; }
.gde-switch--sm .gde-switch__track::after { width: 13px; height: 13px; }
.gde-switch--sm input:checked + .gde-switch__track::after { transform: translateX(13px); }
.gde-avatar--initials {
  display: inline-grid; place-items: center; width: var(--size, 32px); height: var(--size, 32px);
  background: hsl(var(--hue, 150) 55% 92%); color: hsl(var(--hue, 150) 45% 30%);
  font-size: calc(var(--size, 32px) * .36); font-weight: 700; letter-spacing: .02em;
}
.gde-modal {
  width: min(560px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 40px)); padding: 0; margin: auto;
  border: 0; border-radius: 22px; background: #fff; color: var(--text); box-shadow: 0 40px 80px -30px rgba(15, 21, 17, .45);
  overflow: hidden;
}
.gde-modal--lg { width: min(720px, calc(100vw - 32px)); }
.gde-modal[open] { display: flex; animation: modal-in .22s var(--ease); }
.gde-modal::backdrop { background: rgba(14, 26, 19, .55); animation: fade-in .15s ease; }
.gde-modal__form { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.gde-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line-2); }
.gde-modal__head h2 { font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.gde-modal__head p { margin-top: 3px; font-size: 13px; color: var(--muted); }
.gde-modal__head .gde-icon-btn { margin: -6px -8px 0 0; flex: none; }
.gde-modal__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px 8px; }
.gde-modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--line-2); background: #fff; }
.gde-modal__foot .gde-btn { min-width: 120px; }
.gde-modal__note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.gde-modal__note .gde-icon { margin-top: 2px; color: var(--muted); flex: none; }
.gde-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; translate: -50% 0;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5);
  animation: toast-in .25s var(--ease);
}
.gde-toast[hidden] { display: none; }
.gde-toast .gde-icon { color: var(--brand); }
@media (max-width: 767.98px) {
  .gde-modal, .gde-modal--lg { width: 100%; max-width: 100%; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .gde-modal[open] { animation: sheet-in .26s var(--ease); }
  .gde-modal__head { padding: 18px 18px 14px; }
  .gde-modal__body { padding: 16px 18px 6px; }
  .gde-modal__foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .gde-modal__foot .gde-btn { flex: 1; min-width: 0; }
}
.gde-field__select--sm .gde-field__control { height: 36px; font-size: 13px; padding-left: 12px; padding-right: 34px; border-radius: 10px; }
.gde-field__select--sm .gde-field__chev { right: 11px; }
@media (max-width: 767.98px) {
  .gde-req { flex-wrap: wrap; row-gap: 4px; }
  .gde-req .gde-member__text { flex: 1 1 calc(100% - 100px); }
  .gde-req .gde-icon-btn { order: 2; }
  .gde-req .gde-badge { display: inline-flex; order: 3; margin-left: 48px; }
}
[data-role="client"] .gde-admin-only, [data-role="admin"] .gde-client-only { display: none !important; }
.gde-role-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; margin-right: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.gde-role-switch__label { padding: 0 8px 0 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.gde-role-switch button { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.gde-role-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 21, 17, .12); }
@media (max-width: 767.98px) {
  .gde-role-switch__label { display: none; }
  .gde-role-switch button { padding: 0 9px; font-size: 12px; }
}
.gde-field__select.gde-is-enhanced select { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.gde-field__select.gde-is-enhanced::before, .gde-field__select.gde-is-enhanced .gde-field__lead { display: none; }
textarea.gde-field__control { height: auto; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.gde-menu__list { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 220px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(15, 21, 17, .28), 0 2px 6px rgba(15, 21, 17, .06); animation: pop-in .14s var(--ease); }
.gde-menu__list[hidden] { display: none; }
.gde-menu__list [role=menuitem] { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink); text-align: left; }
.gde-menu__list [role=menuitem] .gde-icon { color: var(--muted); }
.gde-menu__list [role=menuitem]:hover, .gde-menu__list [role=menuitem]:focus-visible { background: var(--surface-2); box-shadow: none; }
.gde-menu__list [role=separator] { height: 1px; margin: 6px 4px; background: var(--line-2); }
.gde-menu__list .gde-menu__danger, .gde-menu__list .gde-menu__danger .gde-icon { color: #c8401a; }
.gde-menu__list .gde-menu__danger:hover, .gde-menu__list .gde-menu__danger:focus-visible { background: #fff1ec; }
.gde-btn--danger { background: #d7461f; color: #fff; }
.gde-btn--danger:hover:not(:disabled) { background: #b93a17; }
.gde-btn--danger:disabled { background: #f3d5cb; color: #fff; cursor: not-allowed; }
.gde-modal__danger-head { display: flex; gap: 14px; align-items: flex-start; }
.gde-modal__danger-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: #ffede6; color: #c8401a; }
.gde-modal__text { margin-bottom: 16px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.gde-modal__text strong { color: var(--ink); }
/* Small phones: tidy breadcrumb */
.gde-crumbs { min-width: 0; }
.gde-crumbs > * { flex: none; }
.gde-crumbs [aria-current] { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gde-modal--sm { width: min(480px, calc(100vw - 32px)); }
@media (max-width: 767.98px) {
  .gde-modal--sm { width: 100%; max-width: 100%; }
}
.gde-confirm { text-align: center; padding-top: 28px; }
.gde-confirm__icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--st-in-progress-bg); color: var(--st-in-progress-fg); }
.gde-confirm__icon .gde-icon { width: 26px; height: 26px; }
.gde-confirm h2 { font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.gde-confirm > p { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.gde-confirm > p strong { color: var(--ink); font-weight: 600; }
.gde-confirm__list { display: grid; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); text-align: left; }
.gde-confirm__list li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text); line-height: 1.45; }
.gde-confirm__list .gde-icon { flex: none; margin-top: 1px; color: var(--brand-strong); }
.gde-confirm--danger .gde-confirm__icon { background: #ffede6; color: #c8401a; }
.gde-confirm__flow { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px !important; }
.gde-confirm__flow .gde-icon { color: var(--muted); }
.gde-confirm__what { margin-top: 12px !important; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px !important; line-height: 1.5; color: var(--text-2); }
.gde-confirm__what:empty { display: none; }
.gde-confirm__icon[data-status="for-review"] { background: var(--st-for-review-bg); color: var(--st-for-review-fg); }
.gde-confirm__icon[data-status="revision"], .gde-confirm--revision .gde-confirm__icon { background: var(--st-revision-bg); color: var(--st-revision-fg); }
.gde-confirm__icon[data-status="approved"] { background: var(--st-approved-bg); color: var(--st-approved-fg); }
.gde-confirm__icon[data-status="on-hold"] { background: var(--st-on-hold-bg); color: var(--st-on-hold-fg); }
.gde-confirm__field { margin-top: 16px; text-align: left; }
.gde-confirm__files { display: grid; gap: 6px; margin-top: 16px; padding: 10px; border-radius: 14px; background: var(--surface-2); text-align: left; max-height: 188px; overflow: auto; }
.gde-confirm__files li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2); font-size: 13.5px; color: var(--ink); }
.gde-confirm__files li > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.gde-confirm__files li > small { flex: none; font-size: 12px; color: var(--muted); }
.gde-confirm__files .gde-icon { flex: none; color: var(--st-for-review-fg); }
.gde-confirm__files li.gde-confirm__more { justify-content: center; background: none; box-shadow: none; color: var(--muted); font-size: 12.5px; }
.gde-confirm__check { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); text-align: left; cursor: pointer; }
.gde-confirm__check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--brand-strong); flex: none; }
.gde-confirm__check strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.gde-confirm__check small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.gde-confirm__check[hidden] { display: none; }

/* the shared parts of two mixed rules that stay in forms.css, so pages without forms.css behave the same */
@media (prefers-reduced-motion: reduce) { .gde-modal[open], .gde-modal::backdrop, .gde-toast { animation: none; } }
.gde-field[hidden] { display: none !important; }

/* Free trial, quote, task, package and lead pages: the whole page sits on one white sheet, like View Free Trial */
.gde-sheet { background: #fff; border: 1px solid var(--line-panel); border-radius: 26px; padding: 20px; }
.gde-sheet > :first-child { margin-top: 0; }
.gde-sheet > :last-child { margin-bottom: 0; }
@media (max-width: 767.98px) { .gde-sheet { padding: 14px; border-radius: 20px; } }
.gde-sheet .gde-lead__meta dt { overflow-wrap: anywhere; }
