:root {
    --navy: #102d40;
    --navy-deep: #0a1c2b;
    --petroleum-blue: #13475a;
    --petroleum-green: #08796b;
    --green: #159570;
    --green-light: #e8f7f0;
    --blue: #347db6;
    --blue-light: #eaf3fb;
    --amber: #b97816;
    --amber-light: #fff4df;
    --red: #bc4a47;
    --red-light: #fff0ef;
    --ink: #203745;
    --muted: #738894;
    --border: #e5ecef;
    --surface: #ffffff;
    --canvas: #f3f7f8;
    --shadow: 0 14px 40px rgba(16, 45, 64, .055);
    --radius: 16px;
    --sidebar: 276px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif; background: var(--canvas); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.icon { display: inline-block; width: 19px; height: 19px; flex: 0 0 19px; vertical-align: middle; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; }
code { padding: 2px 5px; color: var(--petroleum-blue); background: #eef3f5; border-radius: 5px; font-size: 12px; }

/* Login */
.login-body { background: #fff; }
.login-shell { display: grid; grid-template-columns: 1.03fr .97fr; min-height: 100vh; }
.login-story { display: flex; flex-direction: column; justify-content: center; padding: 84px max(62px, 10vw); color: #fff; background: radial-gradient(circle at 78% 22%, rgba(51, 172, 154, .2), transparent 34%), linear-gradient(145deg, #0b2334, #123b4d 56%, #086b60); }
.login-eyebrow { margin-bottom: 20px; color: #a5e5d7; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
.login-story h1 { max-width: 520px; margin: 0 0 16px; font-size: clamp(35px, 4vw, 59px); line-height: 1.1; letter-spacing: -2px; }
.login-story > p { max-width: 460px; color: rgba(255, 255, 255, .73); font-size: 16px; line-height: 1.8; }
.login-highlights { display: grid; gap: 16px; margin-top: 40px; }
.login-highlights span { display: flex; align-items: center; gap: 11px; color: rgba(255, 255, 255, .85); }
.login-highlights .icon { color: #86ddc7; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 45px; }
.login-card { width: min(420px, 100%); }
.login-card > .brand-mark { margin-bottom: 20px; }
.login-card h2 { margin: 0 0 6px; font-size: 29px; letter-spacing: -.7px; }
.login-card > p { margin-top: 4px; margin-bottom: 28px; }
.login-card .button { margin-top: 7px; }
.login-footer { margin-top: 34px !important; text-align: center; font-size: 12px; color: var(--muted); }

/* Sidebar and main layout */
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar); padding: 25px 17px 18px; color: rgba(255, 255, 255, .78); background: linear-gradient(165deg, #0c2435 0%, #103345 66%, #10443f 100%); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin: 0 4px 38px; }
.brand-mark { display: inline-grid; width: 44px; height: 44px; place-items: center; color: #fff; background: linear-gradient(145deg, #128e80, #076b62); border-radius: 13px; box-shadow: 0 7px 17px rgba(8, 121, 107, .25); }
.brand-mark .icon { width: 24px; height: 24px; }
.sidebar-brand strong { display: block; max-width: 177px; overflow: hidden; color: #fff; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand small, .user-chip small { display: block; color: rgba(255, 255, 255, .52); font-size: 11px; }
.sidebar-section-label { padding: 0 12px 11px; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: rgba(255, 255, 255, .4); }
.sidebar-nav { display: grid; gap: 4px; overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 0 11px; border-radius: 9px; transition: background .18s, color .18s; }
.nav-link .icon { width: 18px; height: 18px; color: rgba(255, 255, 255, .59); }
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .075); }
.nav-link.active { color: #fff; background: rgba(36, 160, 142, .19); }
.nav-link.active .icon { color: #80dccb; }
.nav-counter { margin-left: auto; padding: 2px 7px; color: #fff; background: #11816f; border-radius: 20px; font-size: 11px; }
.sidebar-footer { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); }
.user-chip { display: flex; min-width: 0; align-items: center; gap: 10px; flex: 1; }
.user-chip-details { min-width: 0; }
.user-chip strong { display: block; overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 50%; color: #fff; background: #157d72; font-size: 12px; font-weight: 700; }
.avatar-soft { color: var(--petroleum-green); background: #e7f4f0; }
.logout-button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; color: rgba(255, 255, 255, .68); background: transparent; border-radius: 8px; }
.logout-button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.sidebar-backdrop { display: none; }
.main-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 8; top: 0; display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 37px; background: rgba(255, 255, 255, .95); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.topbar-title h1 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.topbar-title span { color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.topbar-link { display: flex; align-items: center; gap: 8px; color: var(--petroleum-green); font-size: 12px; font-weight: 600; }
.avatar-topbar { width: 36px; height: 36px; flex-basis: 36px; }
.mobile-menu-button { display: none; border: 0; background: transparent; color: var(--ink); }
.content-area { max-width: 1700px; padding: 31px 37px 48px; }

/* Form controls, alerts, and actions */
.button { display: inline-flex; min-height: 41px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 650; transition: background .18s, border-color .18s, transform .18s; }
.button:hover { transform: translateY(-1px); }
.button .icon { width: 16px; height: 16px; flex-basis: 16px; }
.button-primary { color: #fff; background: var(--petroleum-blue); }
.button-primary:hover { background: #103b4c; }
.button-success { color: #fff; background: var(--petroleum-green); }
.button-success:hover { background: #06675a; }
.button-outline { color: var(--ink); background: #fff; border-color: #dbe5e9; }
.button-outline:hover { border-color: #bbd0d4; background: #f8fbfb; }
.button-white { color: var(--petroleum-blue); background: #fff; }
.button-ghost { color: var(--petroleum-green); background: #eef7f4; }
.button-danger-ghost { color: var(--red); background: var(--red-light); }
.button-small { min-height: 35px; padding: 0 11px; font-size: 12px; }
.button-block { width: 100%; }
.action-cluster { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.action-cluster form, .table-actions form, .entity-actions form { margin: 0; }
.stack-form { display: grid; gap: 16px; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-field > label { color: #355060; font-size: 12px; font-weight: 700; }
.form-field > small, .form-field small { color: var(--muted); font-size: 11px; }
.form-field input:not([type="checkbox"]), .form-field select, .form-field textarea, .search-input input, .filter-bar > select, .copy-field > input { width: 100%; min-height: 42px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #dbe5e9; border-radius: 9px; outline: 0; }
.form-field textarea { min-height: 92px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .search-input:focus-within { border-color: #75b5aa; box-shadow: 0 0 0 3px rgba(8, 121, 107, .08); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.form-panel { max-width: 980px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--border); }
.checkbox-label { display: flex !important; align-items: center; gap: 9px; font-weight: 500 !important; }
.checkbox-label input, .toggle-row input { width: 17px; height: 17px; accent-color: var(--petroleum-green); }
.checkbox-spaced { min-height: 43px; align-items: flex-end !important; }
.alert { margin: 0 0 22px; padding: 13px 15px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; }
.alert-success { color: #16754d; background: #ebf8f0; border-color: #d0ecda; }
.alert-error { color: #a83a38; background: #fff0ef; border-color: #f7d6d3; }
.alert-warning { color: #92610f; background: #fff7e7; border-color: #f3e4bd; }

/* Cards, tables, and headings */
.welcome-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 27px 31px; color: #fff; background: linear-gradient(113deg, #103047, #145568 54%, #09796a); border-radius: 15px; }
.welcome-banner > div > span { color: rgba(255, 255, 255, .72); font-size: 12px; }
.welcome-banner h2 { margin: 5px 0 2px; font-size: 25px; }
.welcome-banner p { margin: 0; color: rgba(255, 255, 255, .76); font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 23px; }
.metric-card { display: flex; min-height: 118px; align-items: center; gap: 13px; padding: 19px 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-icon { display: grid; width: 45px; height: 45px; flex: 0 0 45px; place-items: center; border-radius: 12px; }
.metric-blue { color: var(--blue); background: var(--blue-light); }.metric-teal { color: #147c77; background: #e5f4f2; }.metric-green { color: #187850; background: #e9f6ed; }.metric-amber { color: var(--amber); background: var(--amber-light); }
.metric-card > div { min-width: 0; }.metric-card > div > span { display: block; color: var(--muted); font-size: 11px; }.metric-card strong { display: block; margin: 1px 0; color: var(--navy); font-size: 26px; line-height: 1.2; }.metric-card small { color: #8ba0aa; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(310px, .95fr); gap: 20px; align-items: start; }
.panel { padding: 22px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.spaced-panel { margin-top: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 19px; }.panel-heading h3 { margin: 0; color: var(--navy); font-size: 15px; }.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }.panel-heading-spaced { margin-top: 26px; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--petroleum-green); font-size: 11px; font-weight: 650; white-space: nowrap; }.text-link .icon { width: 14px; height: 14px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }.page-heading h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 3px; color: var(--navy); font-size: 22px; letter-spacing: -.4px; }.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }.back-link { display: inline-block; margin-bottom: 8px; color: var(--petroleum-green); font-size: 11px; }
.table-wrap { overflow: auto; }.data-table { width: 100%; border-collapse: collapse; }.data-table th { padding: 11px 9px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .2px; text-align: left; white-space: nowrap; }.data-table td { padding: 12px 9px; border-bottom: 1px solid #edf1f2; color: #425867; font-size: 12px; vertical-align: middle; }.data-table tbody tr:last-child td { border-bottom: 0; }.data-table td strong { display: block; color: var(--ink); font-size: 12px; }.data-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }.table-actions { display: flex; align-items: center; gap: 5px; }.icon-link { display: inline-grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 8px; color: var(--petroleum-blue); background: #f0f5f6; }.icon-link .icon { width: 16px; height: 16px; }.icon-link:hover { background: #e5eef0; }.icon-danger { color: var(--red); background: var(--red-light); }
.empty-state { display: grid; min-height: 240px; justify-items: center; align-content: center; gap: 8px; padding: 24px; text-align: center; }.empty-state > .icon { width: 40px; height: 40px; color: #7daca5; }.empty-state h4 { margin: 0; color: var(--navy); font-size: 15px; }.empty-state p { max-width: 410px; margin: 0; color: var(--muted); font-size: 12px; }.empty-state .button { margin-top: 8px; }
.status-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 650; white-space: nowrap; }.status-novo { color: #3274a9; background: #eaf2fa; }.status-em_atendimento { color: #9c6819; background: #fff4e2; }.status-encaminhado { color: #6b53a0; background: #f0ebfb; }.status-finalizado, .status-concluido, .status-confirmado { color: #187753; background: #e8f6ed; }.status-pendente { color: #9c6819; background: #fff4e2; }.status-cancelado { color: #a94040; background: #fff0ef; }
.role-badge { display: inline-block; padding: 4px 8px; color: #536b78; background: #f0f4f6; border-radius: 7px; font-size: 10px; }.role-admin { color: var(--petroleum-green); background: #e8f6f1; }
.person-cell { display: flex; align-items: center; gap: 9px; }.person-cell .avatar { width: 35px; height: 35px; flex-basis: 35px; }

/* Dashboard status */
.status-summary { display: grid; gap: 11px; }.status-summary-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #edf1f2; }.status-summary-item strong { color: var(--navy); font-size: 16px; }
.progress-row { margin: 12px 0; }.progress-row > div { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 11px; }.progress-row strong { color: var(--petroleum-green); }.progress-track { display: block; overflow: hidden; height: 7px; background: #edf3f2; border-radius: 20px; }.progress-track > span { display: block; height: 100%; background: linear-gradient(90deg, #168d7d, #55b9aa); border-radius: 20px; }

/* Filters and pagination */
.filter-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; }.filter-tab { min-width: max-content; padding: 8px 12px; color: #617783; border-radius: 8px; font-size: 12px; }.filter-tab:hover { background: #eaf0f1; }.filter-tab.active { color: var(--petroleum-green); background: #e5f2ef; font-weight: 650; }
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }.search-input { display: flex; min-width: 150px; flex: 1; align-items: center; gap: 8px; padding-left: 11px; border: 1px solid #dbe5e9; border-radius: 9px; }.search-input > .icon { width: 16px; height: 16px; color: var(--muted); }.search-input input { min-height: 40px; padding-left: 0; border: 0; box-shadow: none !important; }.filter-bar > select { width: auto; min-width: 160px; }
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; }.pagination-link, .pagination-ellipsis { display: grid; min-width: 34px; height: 34px; place-items: center; color: #55707d; border-radius: 7px; }.pagination-link:hover { background: #edf3f3; }.pagination-link.active { color: #fff; background: var(--petroleum-green); }

/* Details, messages, and referrals */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.56fr) minmax(320px, .9fr); gap: 20px; align-items: start; }.detail-main, .detail-side { display: grid; gap: 19px; }.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 21px; margin: 0; }.info-grid dt { margin-bottom: 3px; color: var(--muted); font-size: 11px; }.info-grid dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 550; }.referral-panel { border-color: #cfe8df; }.note-box { margin: 15px 0 0; padding: 12px; color: #456276; background: #f5f8f9; border-radius: 8px; font-size: 12px; }
.suggestion-box { display: grid; gap: 3px; margin-bottom: 17px; padding: 12px; color: #32675c; background: #edf7f3; border-left: 3px solid #14856f; border-radius: 7px; font-size: 11px; }.suggestion-box strong { font-size: 12px; }
.message-thread { display: grid; min-height: 135px; max-height: 420px; gap: 12px; overflow-y: auto; margin: 0 0 16px; padding: 15px; background: #f5f8f7; border-radius: 10px; }.message-bubble { max-width: 84%; padding: 10px 12px; border-radius: 11px; }.message-bubble p { margin: 0; color: #334955; font-size: 12px; white-space: normal; }.message-bubble small { display: block; margin-top: 5px; color: #79909a; font-size: 9px; }.message-in { justify-self: start; background: #fff; }.message-out { justify-self: end; background: #daf2e8; }.empty-thread { align-self: center; text-align: center; color: var(--muted); font-size: 12px; }.message-composer { display: flex; align-items: flex-end; gap: 9px; }.message-composer textarea { flex: 1; min-height: 58px; padding: 10px; border: 1px solid #dbe5e9; border-radius: 9px; resize: vertical; }

/* Cards for clinics */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }.entity-card { padding: 20px; background: #fff; border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); }.entity-header { display: flex; align-items: center; justify-content: space-between; }.entity-icon { display: grid; width: 43px; height: 43px; place-items: center; color: var(--petroleum-green); background: #eaf5f2; border-radius: 11px; }.entity-card > h3 { margin: 14px 0 3px; color: var(--navy); font-size: 16px; }.entity-card > p { margin: 0 0 13px; color: var(--muted); font-size: 11px; }.entity-details { display: grid; gap: 8px; color: #526978; font-size: 11px; }.entity-details > span { display: flex; align-items: center; gap: 6px; }.entity-details .icon { width: 14px; height: 14px; flex-basis: 14px; color: var(--muted); }.entity-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* WhatsApp and integrations */
.integration-grid { display: grid; grid-template-columns: minmax(0, 1.37fr) minmax(330px, .9fr); gap: 20px; align-items: start; }.integration-side { display: grid; gap: 18px; }.settings-options { display: grid; margin: 3px 0 12px; }.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }.toggle-row strong, .toggle-row small { display: block; }.toggle-row strong { color: var(--ink); font-size: 12px; }.toggle-row small { color: var(--muted); font-size: 11px; }.toggle-row input { flex: 0 0 17px; }
.password-wrap { position: relative; }.password-wrap input { padding-right: 76px !important; }.reveal-password { position: absolute; top: 0; right: 9px; height: 42px; border: 0; color: var(--petroleum-green); background: transparent; font-size: 11px; }
.connection-status { display: flex; align-items: center; gap: 8px; margin: 0 0 15px; padding: 11px; color: #956110; background: #fff5e4; border-radius: 8px; font-size: 12px; }.connection-status > span { width: 9px; height: 9px; background: #d9972f; border-radius: 50%; }.connection-status.connected { color: #176e4b; background: #e9f7ee; }.connection-status.connected > span { background: #20a968; }.pair-code { display: grid; gap: 4px; margin-bottom: 15px; padding: 12px; background: #edf5f4; border-radius: 8px; }.pair-code span { color: var(--muted); font-size: 11px; }.pair-code strong { color: var(--petroleum-green); font-size: 23px; letter-spacing: 2px; }.qr-card { display: grid; justify-items: center; gap: 8px; margin-bottom: 17px; }.qr-card img { width: min(215px, 100%); height: auto; }.qr-card small { color: var(--muted); font-size: 10px; }.separated-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.copy-field { display: flex; gap: 7px; margin: 0 0 10px; }.copy-field > input { min-width: 0; flex: 1; min-height: 36px; font-size: 10px; }.parser-example pre, .payload-details pre { overflow: auto; padding: 13px; color: #335565; background: #f1f5f6; border-radius: 8px; font-size: 11px; }.payload-details { min-width: 90px; }.payload-details summary { color: var(--petroleum-green); cursor: pointer; font-size: 11px; }.payload-details pre { width: min(480px, 65vw); max-height: 330px; }

/* Responsive adjustments */
@media (max-width: 1320px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: minmax(0, 1.38fr) minmax(285px, .85fr); }
}

@media (max-width: 1080px) {
    .detail-grid, .integration-grid { grid-template-columns: 1fr; }
    .detail-side, .integration-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .integration-side > .parser-example { align-self: stretch; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
    .sidebar { transform: translateX(-103%); transition: transform .24s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.visible { position: fixed; z-index: 15; inset: 0; display: block; background: rgba(8, 23, 34, .48); }
    .main-shell { margin-left: 0; }
    .topbar { height: 66px; padding: 0 17px; }
    .mobile-menu-button { display: inline-grid; width: 36px; height: 36px; place-items: center; }
    .topbar-title { margin-right: auto; margin-left: 7px; }
    .topbar-actions { gap: 9px; }
    .topbar-link span { display: none; }
    .content-area { padding: 23px 16px 35px; }
    .welcome-banner { padding: 23px 19px; }
    .welcome-banner h2 { font-size: 21px; }
    .metric-grid { gap: 11px; }
    .metric-card { min-height: 106px; gap: 9px; padding: 12px; }
    .metric-icon { width: 37px; height: 37px; flex-basis: 37px; }
    .metric-card strong { font-size: 22px; }
    .panel { padding: 17px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .action-cluster { width: 100%; }
    .filter-bar { flex-wrap: wrap; }
    .search-input { flex-basis: 100%; }
    .detail-side, .integration-side { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-story { min-height: 275px; padding: 39px 24px; }
    .login-story h1 { font-size: 35px; }
    .login-story > p { font-size: 13px; }
    .login-highlights { display: none; }
    .login-panel { min-height: calc(100vh - 275px); padding: 33px 23px; }
}

@media (max-width: 520px) {
    .welcome-banner { align-items: flex-start; flex-direction: column; }
    .metric-card > div > span { font-size: 10px; }
    .metric-card small { display: none; }
    .form-grid, .info-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .button, .action-cluster .button { flex: 1; }
    .message-composer { align-items: stretch; flex-direction: column; }
    .panel-heading { flex-wrap: wrap; }
    .topbar-title h1 { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
