/* DentalROI Team panel. Plain CSS, no build step. */
:root {
    --tm-bg: #f4f6f9;
    --tm-surface: #ffffff;
    --tm-sidebar: #0f2a44;
    --tm-sidebar-text: #c9d6e3;
    --tm-text: #1d2733;
    --tm-muted: #627083;
    --tm-border: #dde3ea;
    --tm-primary: #1a73c9;
    --tm-primary-dark: #145da3;
    --tm-danger: #c4302b;
    --tm-success-bg: #e6f4ea;
    --tm-success: #1e6b34;
    --tm-error-bg: #fdecea;
    --tm-radius: 6px;
    font-size: 15px;
}

* { box-sizing: border-box; }
body.tm { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tm-text); background: var(--tm-bg); display: flex; min-height: 100vh; }
a { color: var(--tm-primary); }

.tm-sidebar { width: 240px; flex: 0 0 240px; background: var(--tm-sidebar); color: var(--tm-sidebar-text); display: flex; flex-direction: column; padding: 18px 0; }
.tm-brand { color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; padding: 0 20px 18px; }
.tm-brand span { font-weight: 400; color: var(--tm-sidebar-text); }
.tm-nav { display: flex; flex-direction: column; }
.tm-nav a { color: var(--tm-sidebar-text); text-decoration: none; padding: 8px 20px; border-left: 3px solid transparent; }
.tm-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.tm-nav a.active { border-left-color: #5fb0ff; background: rgba(255, 255, 255, .08); color: #fff; }
.tm-nav-clinic { margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; }
.tm-nav-label { margin: 0 20px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #8fa6bd; }
.tm-account { margin-top: auto; padding: 12px 20px 0; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.tm-account a { color: var(--tm-sidebar-text); }

.tm-main { flex: 1; padding: 24px 32px; min-width: 0; }
.tm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.tm-head h1 { margin: 0; font-size: 24px; }
.tm-crumbs { font-size: 13px; color: var(--tm-muted); margin-bottom: 4px; }
.tm-actions { display: flex; gap: 8px; }

.tm-btn { display: inline-block; padding: 8px 14px; border-radius: var(--tm-radius); border: 1px solid var(--tm-border); background: var(--tm-surface); color: var(--tm-text); text-decoration: none; font: inherit; cursor: pointer; }
.tm-btn:hover { border-color: #b9c4d0; }
.tm-btn-primary { background: var(--tm-primary); border-color: var(--tm-primary); color: #fff; }
.tm-btn-primary:hover { background: var(--tm-primary-dark); }
.tm-btn-danger { color: var(--tm-danger); border-color: #efc2c0; }

.tm-flash { padding: 10px 14px; border-radius: var(--tm-radius); margin-bottom: 16px; background: #eef3f8; }
.tm-flash-success { background: var(--tm-success-bg); color: var(--tm-success); }
.tm-flash-error { background: var(--tm-error-bg); color: var(--tm-danger); }

.tm-table { width: 100%; border-collapse: collapse; background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: var(--tm-radius); overflow: hidden; }
.tm-table th, .tm-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--tm-border); vertical-align: top; }
.tm-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--tm-muted); background: #f9fafc; }
.tm-table tr:last-child td { border-bottom: 0; }
.tm-pager { color: var(--tm-muted); font-size: 13px; display: flex; gap: 12px; }
.tm-empty { color: var(--tm-muted); }
.tm-search { display: flex; gap: 8px; margin-bottom: 14px; }
.tm-search input { flex: 0 1 320px; }

.tm-card { background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: var(--tm-radius); padding: 18px; margin-bottom: 18px; }
.tm-card h2 { margin: 0 0 12px; font-size: 16px; }
.tm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tm-stat { background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: var(--tm-radius); padding: 14px; text-decoration: none; color: inherit; }
.tm-stat strong { display: block; font-size: 22px; }
.tm-stat span { color: var(--tm-muted); font-size: 13px; }
.tm-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.tm-dl dt { color: var(--tm-muted); }
.tm-dl dd { margin: 0; }
.tm-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #eef1f5; }
.tm-badge-active { background: var(--tm-success-bg); color: var(--tm-success); }

.tm-form { background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: var(--tm-radius); padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.tm-field { display: flex; flex-direction: column; gap: 4px; }
.tm-field-wide { grid-column: 1 / -1; }
.tm-field label { font-weight: 600; font-size: 13px; }
.tm-field input[type=text], .tm-field input[type=email], .tm-field input[type=password], .tm-field input[type=date], .tm-field input[type=url], .tm-field select, .tm-field textarea, .tm-search input, .tm-login input[type=text], .tm-login input[type=email], .tm-login input[type=password] { font: inherit; padding: 8px 10px; border: 1px solid var(--tm-border); border-radius: var(--tm-radius); background: #fff; width: 100%; }
.tm-field textarea { min-height: 160px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.tm-field-error input, .tm-field-error select, .tm-field-error textarea { border-color: var(--tm-danger); }
.tm-field ul { margin: 0; padding: 0; list-style: none; color: var(--tm-danger); font-size: 13px; }
.tm-help { margin: 0; color: var(--tm-muted); font-size: 12px; }
.tm-form-actions { grid-column: 1 / -1; }
.tm-delete { margin-top: 18px; }

body.tm-plain { justify-content: center; align-items: center; }
.tm-login { width: 380px; background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: var(--tm-radius); padding: 28px; }
.tm-login h1 { margin: 0 0 6px; font-size: 22px; }
.tm-login p { color: var(--tm-muted); margin: 0 0 18px; }
.tm-login label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
.tm-login .tm-btn { width: 100%; margin-top: 18px; }
.tm-login .tm-error { background: var(--tm-error-bg); color: var(--tm-danger); padding: 10px; border-radius: var(--tm-radius); margin-bottom: 8px; }
.tm-qr { display: block; margin: 0 auto 10px; }
.tm-secret { font-family: ui-monospace, monospace; word-break: break-all; background: #f4f6f9; padding: 8px; border-radius: var(--tm-radius); font-size: 13px; }

@media (max-width: 760px) {
    body.tm { flex-direction: column; }
    .tm-sidebar { width: auto; flex: none; }
    .tm-main { padding: 16px; }
    .tm-form { grid-template-columns: 1fr; }
}

/* A call's page */
.tm-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 12px; }
.tm-dl dt { color: var(--tm-muted); }
.tm-dl dd { margin: 0; }
.call-summary { font-size: 15px; line-height: 1.5; }
.call-transcript { max-height: 420px; overflow-y: auto; border-top: 1px solid var(--tm-border); padding-top: 8px; }
.call-transcript p { margin: 6px 0; line-height: 1.45; }
audio { width: 100%; max-width: 480px; }

/* Text conversations */
.sms-thread { display: flex; flex-direction: column; gap: 10px; }
.sms { max-width: 70%; padding: 8px 12px; border-radius: 12px; background: #eef1f6; }
.sms p { margin: 0 0 4px; white-space: pre-wrap; }
.sms time, .sms-media { font-size: 12px; color: var(--tm-muted); }
.sms-outbound { align-self: flex-end; background: #dbe8ff; }
tr.is-unread td { font-weight: 600; }
.tm-inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0; }
.tm-inline-form label { display: inline-flex; gap: 4px; align-items: center; font-weight: normal; }
.sms-reply textarea { width: 100%; max-width: 640px; display: block; margin: 6px 0 10px; }
.sms-opted-out { color: var(--tm-muted); }
.report-period label { display: inline-flex; gap: 6px; align-items: center; }
.call-report tfoot th { border-top: 2px solid var(--tm-border); }
.call-summary-cell { max-width: 420px; }
.sms-media img { display: block; max-width: 240px; max-height: 240px; border-radius: 8px; margin: 4px 0; }

/* Secure form builder: each row of fields is one band, stand-alone blocks plain. */
.fb-table tbody.fb-row { border-left: 3px solid #b9c9de; }
.fb-table tbody.fb-row + tbody.fb-row { border-top: 2px solid var(--tm-border); }
.fb-table tbody.fb-block td { background: #fafbfc; }
.fb-table td .tm-inline-form { margin: 0 2px; }
.fb-add { margin-top: 14px; }
.fb-add summary { cursor: pointer; color: var(--tm-primary); }
.tm-check { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.tm-inline-form input[type=text] { font: inherit; padding: 8px 10px; border: 1px solid var(--tm-border); border-radius: var(--tm-radius); background: #fff; min-width: 260px; }
