/* =====================================================================
   ARCO+ Data Rights — styles
   Public portal (base_legal.html) + Doctor views (base_app.html)
   Palette: indigo #6366f1 / near-black #111827 / slate grays
   ===================================================================== */

/* =====================================================================
   Shared tokens & badges
   ===================================================================== */

.dr-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.dr-badge--pending    { background: #fef9c3; color: #854d0e; }
.dr-badge--verified   { background: #e0e7ff; color: #3730a3; }
.dr-badge--in_progress{ background: #ede9fe; color: #5b21b6; }
.dr-badge--completed  { background: #dcfce7; color: #14532d; }
.dr-badge--rejected   { background: #fee2e2; color: #991b1b; }

/* =====================================================================
   Public portal — base_legal.html pages
   ===================================================================== */

/* ---- Request form ---- */
.dr-form-wrap { max-width: 540px; }

.dr-form { display: flex; flex-direction: column; gap: 20px; }

.dr-field { display: flex; flex-direction: column; gap: 6px; }

.dr-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.dr-input,
.dr-select,
.dr-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s;
    box-sizing: border-box;
    font-family: inherit;
}
.dr-input:focus,
.dr-select:focus,
.dr-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.dr-textarea { resize: vertical; min-height: 80px; }

.dr-error  { font-size: 13px; color: #dc2626; }
.dr-hint   { font-size: 13px; color: #6b7280; }

.dr-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    width: 100%;
    font-family: inherit;
}
.dr-submit-btn:hover { background: #1f2937; }

/* ---- Portal action buttons ---- */
.dr-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.dr-action-btn--primary { background: #6366f1; color: #fff; }
.dr-action-btn--primary:hover { background: #4f46e5; color: #fff; }
.dr-action-btn--outline { background: #fff; color: #374151; border: 1.5px solid #e5e7eb; }
.dr-action-btn--outline:hover { border-color: #d1d5db; background: #f9fafb; }

/* ---- Confirm icon ---- */
.dr-confirm-icon {
    width: 56px; height: 56px;
    background: #dcfce7; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px; color: #16a34a;
}

/* ---- Status steps ---- */
.dr-steps { display: flex; flex-direction: column; margin: 24px 0; }

.dr-step {
    display: flex; align-items: flex-start; gap: 16px;
    position: relative; padding-bottom: 20px;
}
.dr-step:last-child { padding-bottom: 0; }
.dr-step:not(:last-child)::before {
    content: ''; position: absolute;
    left: 15px; top: 32px; bottom: 0;
    width: 2px; background: #e5e7eb;
}
.dr-step__dot {
    width: 32px; height: 32px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 13px; font-weight: 700; z-index: 1;
}
.dr-step__dot--done    { background: #dcfce7; color: #16a34a; }
.dr-step__dot--active  { background: #e0e7ff; color: #4338ca; }
.dr-step__dot--pending { background: #f3f4f6; color: #9ca3af; }
.dr-step__body  { padding-top: 6px; }
.dr-step__title { font-size: 14px; font-weight: 600; color: #111827; }
.dr-step__desc  { font-size: 13px; color: #6b7280; margin-top: 2px; }

/* ---- Portal card ---- */
.dr-card {
    background: #f9fafb; border: 1px solid #e5e7eb;
    border-radius: 14px; padding: 20px 24px;
    display: flex; flex-direction: column; gap: 14px;
}
.dr-card-row { display: flex; flex-direction: column; gap: 2px; }
.dr-card-row span  { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.dr-card-row strong{ font-size: 15px; color: #111827; }

/* =====================================================================
   Doctor views — base_app.html
   ===================================================================== */

/* ---- Page shell ---- */
.dr-page {
    max-width: 800px;
}

/* ---- Kicker ---- */
.dr-kicker {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6366f1;
    margin: 0 0 6px;
}

/* ---- Page title ---- */
.dr-page-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
}

/* =====================================================================
   List view
   ===================================================================== */

.dr-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.dr-pending-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef9c3;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 999px;
    white-space: nowrap;
    margin-top: 6px;
}

/* ---- List table ---- */
.dr-list {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.dr-list-header {
    display: grid;
    grid-template-columns: 1fr 180px 160px 90px 28px;
    gap: 0;
    padding: 10px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.dr-list-item {
    display: grid;
    grid-template-columns: 1fr 180px 160px 90px 28px;
    gap: 0;
    align-items: center;
    padding: 13px 20px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    transition: background .12s;
    cursor: pointer;
}
.dr-list-item:last-child { border-bottom: none; }
.dr-list-item:hover { background: #fafafa; }

.dr-list-item__patient {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.dr-avatar {
    width: 34px; height: 34px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 13px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.dr-list-item__names {
    display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.dr-list-item__name {
    font-size: 14px; font-weight: 600; color: #111827;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dr-list-item__email {
    font-size: 12px; color: #9ca3af;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.dr-list-item__type {
    font-size: 13px; color: #6b7280;
}

.dr-list-item__status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.dr-status-sub {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    line-height: 1;
}

.dr-list-item__date {
    font-size: 13px; color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

.dr-list-item__arrow {
    color: #d1d5db; font-size: 16px;
    display: flex; justify-content: flex-end;
    transition: color .12s;
}
.dr-list-item:hover .dr-list-item__arrow { color: #6b7280; }

/* ---- Empty state ---- */
.dr-empty {
    display: flex; flex-direction: column; align-items: center;
    padding: 64px 24px; text-align: center;
}
.dr-empty__icon {
    font-size: 28px; color: #d1d5db; margin-bottom: 16px;
}
.dr-empty__title { font-size: 15px; font-weight: 600; color: #374151; margin: 0 0 6px; }
.dr-empty__desc  { font-size: 13px; color: #9ca3af; margin: 0; }

/* =====================================================================
   Detail view
   ===================================================================== */

.dr-detail-page { }

/* ---- Back link ---- */
.dr-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color .15s;
}
.dr-back:hover { color: #111827; }

/* ---- Hero ---- */
.dr-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.dr-detail-hero__left { min-width: 0; }

.dr-detail-hero__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.dr-meta-sep  { color: #d1d5db; font-size: 13px; }
.dr-meta-text { font-size: 13px; color: #9ca3af; }

/* ---- Deadline chip ---- */
.dr-deadline-chip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    flex-shrink: 0;
    font-size: 13px;
    min-width: 148px;
}
.dr-deadline-chip i { margin-top: 1px; font-size: 14px; }
.dr-deadline-chip--ok   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.dr-deadline-chip--warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.dr-deadline-chip--urgent{ background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.dr-deadline-chip--done { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

.dr-deadline-chip__label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; opacity: .7; margin-bottom: 2px;
}
.dr-deadline-chip__val { font-size: 13px; font-weight: 700; }

/* ---- Divider ---- */
.dr-divider {
    height: 1px; background: #f3f4f6; margin-bottom: 28px;
}

/* ---- Body grid ---- */
.dr-detail-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
    margin-bottom: 32px;
}
@media (max-width: 760px) {
    .dr-detail-body   { grid-template-columns: 1fr; gap: 24px; }
    .dr-detail-hero   { flex-direction: column; }
}

/* ---- Section label ---- */
.dr-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
    margin: 0 0 14px;
}

/* ---- Definition list ---- */
.dr-dl { display: flex; flex-direction: column; gap: 0; }

.dr-dl__row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f9fafb;
}
.dr-dl__row:last-child { border-bottom: none; }

.dr-dl__row dt {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    padding-top: 1px;
}
.dr-dl__row dd {
    font-size: 13px;
    color: #111827;
    font-weight: 500;
    margin: 0;
}

.dr-link { color: #6366f1; text-decoration: none; }
.dr-link:hover { text-decoration: underline; }

/* ---- Blockquote ---- */
.dr-blockquote {
    margin: 0;
    padding: 12px 16px;
    background: #fafafa;
    border-left: 3px solid #e0e7ff;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.7;
    font-style: italic;
}

/* ---- Form ---- */
.dr-form-simple { display: flex; flex-direction: column; gap: 18px; }

.dr-form-field { display: flex; flex-direction: column; gap: 5px; }

.dr-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.dr-label-hint {
    font-weight: 400;
    color: #9ca3af;
    font-size: 12px;
}

.dr-select-wrap { position: relative; }

.dr-select {
    width: 100%;
    padding: 9px 36px 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    background: #fff;
    appearance: none;
    font-family: inherit;
    transition: border-color .15s;
    cursor: pointer;
}
.dr-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.dr-select-wrap::after {
    content: '';
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #9ca3af;
    pointer-events: none;
}

.dr-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    font-size: 13px;
    color: #111827;
    background: #fff;
    resize: vertical;
    min-height: 96px;
    font-family: inherit;
    transition: border-color .15s;
    box-sizing: border-box;
}
.dr-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.dr-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
    width: fit-content;
}
.dr-save-btn:hover { background: #1f2937; }

/* ---- Guidance ---- */
.dr-guidance {
    padding: 16px 20px;
    background: #fafafa;
    border: 1px solid #f3f4f6;
    border-left: 3px solid #6366f1;
    border-radius: 0 10px 10px 0;
}
.dr-guidance__q {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6366f1;
    margin: 0 0 6px;
}
.dr-guidance__a {
    font-size: 13px;
    color: #374151;
    line-height: 1.7;
    margin: 0;
}
