/**
 * DirectoryOS member portal + auth forms.
 */
.dos-portal, .dos-portal-auth {
	--dp-primary: #1e7d34;
	--dp-primary-dark: #155f27;
	--dp-accent: #f7941d;
	--dp-ink: #1f2937;
	--dp-muted: #6b7280;
	--dp-line: #e5e7eb;
	--dp-surface: #f5f7fa;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--dp-ink);
}

/* ---- Auth ---- */
.dos-portal-auth { max-width: 980px; margin: 0 auto; padding: 24px 0; }
.dos-auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .dos-auth-grid { grid-template-columns: 1fr; } }
.dos-auth-title { font-size: 22px; font-weight: 700; margin: 0 0 16px; color: var(--dp-primary-dark); }
.dos-auth-lead { font-size: 15px; color: var(--dp-muted); margin-bottom: 18px; }
.dos-auth-switch { margin-top: 16px; color: var(--dp-muted); }
.dos-auth-col { background: #fff; border: 1px solid var(--dp-line); border-radius: 14px; padding: 26px; }

.dos-form { display: flex; flex-direction: column; gap: 13px; }
.dos-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #374151; }
.dos-form input, .dos-form select {
	border: 1px solid var(--dp-line); border-radius: 9px; padding: 10px 12px; font-size: 14px; background: #fff;
}
.dos-form input:focus, .dos-form select:focus { outline: none; border-color: var(--dp-primary); box-shadow: 0 0 0 3px rgba(30, 125, 52, .12); }

.dos-btn-primary { background: var(--dp-primary); color: #fff; border: 0; border-radius: 9px; padding: 11px 18px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.dos-btn-primary:hover { background: var(--dp-primary-dark); color: #fff; }
.dos-btn-ghost { background: #fff; color: var(--dp-ink); border: 1px solid var(--dp-line); border-radius: 9px; padding: 10px 16px; font-weight: 600; cursor: pointer; }

.dos-flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.dos-flash--success { background: #e7f6ec; color: #155f27; }
.dos-flash--error { background: #fdecea; color: #b3261e; }

/* ---- Portal shell ---- */
.dos-portal-boot { padding: 48px; color: var(--dp-muted); }
.dp-shell { display: flex; gap: 0; background: var(--dp-surface); border: 1px solid var(--dp-line); border-radius: 16px; overflow: hidden; min-height: 560px; }

.dp-side { flex: 0 0 220px; background: linear-gradient(180deg, #123a20, #0c2415); color: #d7e6db; padding: 22px 14px; display: flex; flex-direction: column; }
.dp-brand { font-weight: 800; color: #fff; padding: 4px 8px 18px; font-size: 16px; }
.dp-brand span { font-weight: 500; color: #9fb8a7; }
.dp-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.dp-nav-item { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: #c4d6ca; padding: 11px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; text-align: left; }
.dp-nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.dp-nav-item.is-active { background: var(--dp-primary); color: #fff; }
.dp-nav-icon { width: 18px; text-align: center; }
.dp-side-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.dp-link { color: #9fb8a7; font-size: 13px; text-decoration: none; }
.dp-link:hover { color: #fff; }

.dp-main { flex: 1; min-width: 0; }
.dp-content { padding: 28px; }

@media (max-width: 760px) {
	.dp-shell { flex-direction: column; }
	.dp-side { flex-basis: auto; }
	.dp-nav { flex-direction: row; flex-wrap: wrap; }
}

.dp-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.dp-panel-head h2 { margin: 0; font-size: 20px; font-weight: 700; }

/* ---- Buttons (portal) ---- */
.dp-btn { border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; padding: 9px 15px; }
.dp-btn-primary { background: var(--dp-primary); color: #fff; }
.dp-btn-primary:hover { background: var(--dp-primary-dark); }
.dp-btn-primary:disabled { opacity: .6; }
.dp-btn-ghost { background: #fff; border-color: var(--dp-line); color: var(--dp-ink); }
.dp-btn-text { background: transparent; color: var(--dp-primary); padding: 6px 8px; }
.dp-btn-text.dp-danger { color: #c0392b; }

/* ---- Status ---- */
.dp-status { background: #fff; border: 1px solid var(--dp-line); border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: 14px; }
.dp-status--pending { border-color: #f3d9a8; background: #fff9ef; }
.dp-status-note { color: var(--dp-muted); }
.dp-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; background: #eef2f5; color: #475569; }
.dp-badge--active, .dp-badge--replied { background: #e7f6ec; color: #1e7d34; }
.dp-badge--pending, .dp-badge--new { background: #fef4e3; color: #b9740a; }
.dp-badge--suspended, .dp-badge--closed { background: #fdecea; color: #c0392b; }

/* ---- Form grid ---- */
.dp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dp-field { display: flex; flex-direction: column; gap: 6px; }
.dp-field-wide { grid-column: 1 / -1; }
.dp-field > label { font-size: 12.5px; font-weight: 600; color: #374151; }
.dp-field input, .dp-field textarea, .dp-field select {
	border: 1px solid var(--dp-line); border-radius: 9px; padding: 9px 12px; font-size: 14px; background: #fff; width: 100%; box-sizing: border-box;
}
.dp-field textarea { resize: vertical; }
.dp-field input:focus, .dp-field textarea:focus, .dp-field select:focus { outline: none; border-color: var(--dp-primary); box-shadow: 0 0 0 3px rgba(30, 125, 52, .12); }
.dp-toggle { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
@media (max-width: 620px) { .dp-form-grid { grid-template-columns: 1fr; } }

.dp-media { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dp-media-id { font-size: 12.5px; color: var(--dp-primary); font-weight: 600; }
.dp-media-empty { font-size: 12.5px; color: var(--dp-muted); }

.dp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dp-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef6f0; color: var(--dp-primary-dark); padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.dp-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; padding: 0; }
.dp-tags-add { display: flex; gap: 8px; }
.dp-tags-add input { flex: 1; }

.dp-days { display: flex; flex-direction: column; gap: 10px; }
.dp-day { border: 1px solid var(--dp-line); border-radius: 10px; padding: 12px; background: #fafbfc; display: flex; flex-direction: column; gap: 8px; }
.dp-day-head { display: flex; justify-content: space-between; align-items: center; }
.dp-day input, .dp-day textarea { width: 100%; border: 1px solid var(--dp-line); border-radius: 8px; padding: 8px 10px; font-size: 13px; box-sizing: border-box; }

/* ---- Cards ---- */
.dp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.dp-cards--stat { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.dp-stat { background: #fff; border: 1px solid var(--dp-line); border-radius: 12px; padding: 18px 20px; }
.dp-stat--link { cursor: pointer; transition: border-color .15s, transform .1s; }
.dp-stat--link:hover { border-color: var(--dp-primary); transform: translateY(-1px); }
.dp-stat-value { font-size: 28px; font-weight: 800; color: var(--dp-primary); }
.dp-stat-label { font-size: 13px; color: var(--dp-muted); margin-top: 4px; }

.dp-item-card { background: #fff; border: 1px solid var(--dp-line); border-radius: 12px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dp-item-meta { font-size: 12.5px; color: var(--dp-muted); margin-top: 4px; }
.dp-item-actions { white-space: nowrap; }
.dp-empty { background: #fff; border: 1px dashed var(--dp-line); border-radius: 12px; padding: 36px; text-align: center; color: var(--dp-muted); }

/* ---- Leads ---- */
.dp-leads { display: flex; flex-direction: column; gap: 12px; }
.dp-lead { background: #fff; border: 1px solid var(--dp-line); border-radius: 12px; padding: 16px 18px; }
.dp-lead-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dp-lead-subject { font-weight: 600; margin-top: 6px; }
.dp-lead-msg { color: #374151; font-size: 14px; margin: 8px 0; }
.dp-lead-contact { font-size: 13px; color: var(--dp-muted); }
.dp-lead-actions { margin-top: 8px; display: flex; gap: 6px; }

/* ---- Modal ---- */
.dp-modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 99999; padding: 40px 16px; overflow-y: auto; }
.dp-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 600px; box-shadow: 0 12px 32px rgba(16, 24, 40, .22); display: flex; flex-direction: column; max-height: calc(100vh - 80px); }
.dp-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--dp-line); }
.dp-modal-head h3 { margin: 0; font-size: 16px; }
.dp-modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dp-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--dp-line); }

.dp-spinner { width: 28px; height: 28px; margin: 50px auto; border: 3px solid #e5e7eb; border-top-color: var(--dp-primary); border-radius: 50%; animation: dp-spin .7s linear infinite; }
@keyframes dp-spin { to { transform: rotate(360deg); } }
