/**
 * TDG Group Dashboard Styles
 */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.tdg-dashboard {
    font-family: inherit;
    margin: 0 0 3rem 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.tdg-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: .75rem;
}

.tdg-group-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .6rem;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.tdg-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: .25em .65em;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tdg-badge-org    { background: #dbeafe; color: #1d4ed8; }
.tdg-badge-clinic { background: #dcfce7; color: #15803d; }

/* ── Export Button ───────────────────────────────────────────────────────── */
.tdg-export-btn {
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .5rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.tdg-export-btn:hover { background: #1e40af; }

/* ── Stats Row ───────────────────────────────────────────────────────────── */
.tdg-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
.tdg-stat-card {
    flex: 1;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.1rem .75rem;
    background: #fff;
    text-align: center;
}
.tdg-stat-pending { background: #fffbeb; }
.tdg-stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}
.tdg-stat-number.tdg-stat-small {
    font-size: 1rem;
    font-weight: 700;
}
.tdg-stat-label {
    font-size: .72rem;
    color: #6b7280;
    margin-top: .35rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tdg-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
    padding: 0 1.5rem;
    gap: .25rem;
}
.tdg-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: .75rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.tdg-tab:hover    { color: #374151; }
.tdg-tab-active   { color: #1d4ed8; border-bottom-color: #1d4ed8; }
.tdg-tab-badge {
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .15em .5em;
    border-radius: 99px;
}

/* ── Tab Panels ──────────────────────────────────────────────────────────── */
.tdg-tab-panel          { padding: 1.25rem 1.5rem; }
.tdg-tab-panel-hidden   { display: none; }

/* ── Search ──────────────────────────────────────────────────────────────── */
.tdg-search-wrap { margin-bottom: 1rem; }
.tdg-search {
    width: 100%;
    max-width: 380px;
    padding: .5rem .75rem .5rem 2.25rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .9rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat .75rem center;
}
.tdg-search:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}

/* ── Roster Table ────────────────────────────────────────────────────────── */
.tdg-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.tdg-roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.tdg-roster-table thead  { background: #f3f4f6; }
.tdg-roster-table th {
    padding: .65rem 1rem;
    text-align: left;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #374151;
    white-space: nowrap;
    border-bottom: 1px solid #e5e7eb;
}
.tdg-roster-table td {
    padding: .7rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}
.tdg-roster-table tbody tr:last-child td { border-bottom: none; }
.tdg-roster-table tbody tr:hover td      { background: #f9fafb; }
.tdg-row-pending td { background: #fffbeb; }

/* ── Avatar + Name Cell ──────────────────────────────────────────────────── */
.tdg-col-name {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.tdg-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50%;
    flex-shrink: 0;
}
.tdg-col-name a { font-weight: 600; color: #1d4ed8; text-decoration: none; }
.tdg-col-name a:hover { text-decoration: underline; }

/* ── Role & Status Pills ─────────────────────────────────────────────────── */
.tdg-role, .tdg-status {
    display: inline-block;
    padding: .2em .7em;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tdg-role-admin  { background: #ede9fe; color: #6d28d9; }
.tdg-role-mod    { background: #dbeafe; color: #1d4ed8; }
.tdg-role-member { background: #f3f4f6; color: #6b7280; }

.tdg-status-confirmed { background: #dcfce7; color: #15803d; }
.tdg-status-pending   { background: #fef3c7; color: #92400e; }

/* ── Clinic Section (Breakdown Tab) ──────────────────────────────────────── */
.tdg-clinic-section  { margin-bottom: 2rem; }
.tdg-clinic-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}
.tdg-clinic-title { margin: 0; font-size: 1rem; font-weight: 700; }
.tdg-clinic-meta  { font-size: .8rem; color: #6b7280; }

/* ── Notices ─────────────────────────────────────────────────────────────── */
.tdg-notice { padding: 1rem 1.5rem; color: #374151; }
.tdg-error  { color: #b91c1c; background: #fef2f2; border-radius: 6px; }
.tdg-empty  { color: #9ca3af; font-style: italic; padding: 1rem 0; margin: 0; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media ( max-width: 640px ) {
    .tdg-stats-row      { flex-direction: column; gap: 0; }
    .tdg-stat-card      { flex-direction: row; justify-content: space-between; padding: .75rem 1rem; }
    .tdg-stat-number    { font-size: 1.25rem; }
    .tdg-dashboard-header { flex-direction: column; align-items: flex-start; }
    .tdg-tabs           { overflow-x: auto; padding: 0 .75rem; }
    .tdg-tab-panel      { padding: 1rem .75rem; }
}
