:root {
    --sap-green: #67bd2f;
    --sap-green-dark: #438f1d;
    --sap-green-soft: #eef8e8;
    --sap-green-pale: #f7fbf4;
    --sap-grey: #6f7277;
    --ink: #202225;
    --muted: #72777f;
    --bg: #f5f6f4;
    --panel: #ffffff;
    --border: #e2e5df;
    --danger: #bd3d3d;
    --warning: #d89614;
    --shadow: 0 12px 34px rgba(31, 37, 27, .07);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 0%, rgba(103,189,47,.08), transparent 28rem),
        var(--bg);
}

button, input, select { font: inherit; }

.topbar {
    min-height: 82px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px max(24px, calc((100vw - 1440px) / 2));
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
}

.brand img {
    display: block;
    width: 230px;
    max-height: 58px;
    object-fit: contain;
    object-position: left center;
}

.topbar nav { display: flex; align-items: center; gap: 8px; }
.topbar nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 750;
    padding: 10px 14px;
    border-radius: 10px;
}
.topbar nav a:hover { background: var(--sap-green-soft); color: var(--sap-green-dark); }

.container { max-width: 1440px; margin: 0 auto; padding: 34px 28px 54px; }
.footer { text-align: center; color: #92968e; font-size: 13px; padding: 0 20px 30px; }

h1, h2, h3 { margin: 0; letter-spacing: -.025em; }
h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.02; }
h2 { font-size: 25px; }
p { color: var(--muted); line-height: 1.55; }

.kicker {
    display: inline-block;
    color: var(--sap-green-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .14em;
    margin-bottom: 8px;
}

.hero {
    min-height: 230px;
    border-radius: 28px;
    padding: 42px;
    margin-bottom: 26px;
    background: linear-gradient(120deg, #202225 0%, #33363a 72%);
    color: white;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}
.hero .kicker { color: #a9e582; }
.hero p { color: #d7d9d6; max-width: 680px; font-size: 18px; margin-bottom: 0; }
.hero-mark {
    width: 170px; height: 170px; border-radius: 46% 54% 62% 38%;
    display: grid; place-items: center; font-size: 100px; font-weight: 950;
    color: #fff; background: var(--sap-green); transform: rotate(-7deg);
    box-shadow: 0 0 0 22px rgba(103,189,47,.12);
}

.page-heading, .room-header {
    display: flex; justify-content: space-between; align-items: center; gap: 24px;
    margin-bottom: 26px;
}
.page-heading p, .room-header p { margin: 8px 0 0; }

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 27px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.section-head, .panel-title-row {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    margin-bottom: 18px;
}

button, .button {
    border: 0;
    border-radius: 11px;
    background: var(--sap-green);
    color: #fff;
    padding: 11px 17px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(69,140,28,.18); }
button.secondary, .button.ghost { background: #f0f2ef; color: var(--ink); box-shadow: none; }
button.success { background: var(--sap-green-dark); }
button.danger { background: #fbeaea; color: var(--danger); }
button:disabled { cursor: default; transform: none; box-shadow: none; opacity: .85; }

.two-col { display: grid; grid-template-columns: 1.08fr .92fr; gap: 24px; }
.reception-layout > .panel { min-height: 470px; }

.search-wrap { position: relative; }
.search-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-52%); color: var(--sap-green-dark); font-size: 28px; font-weight: 800; }
.search {
    width: 100%; padding: 17px 18px 17px 52px; font-size: 18px;
    border-radius: 14px; border: 2px solid var(--border); background: #fbfcfb; outline: none;
}
.search:focus { border-color: var(--sap-green); box-shadow: 0 0 0 4px rgba(103,189,47,.10); }
.results { margin-top: 15px; }
.search-hint { padding: 28px 12px; text-align: center; color: var(--muted); }

.student-result, .call-row, .room-call {
    display: flex; align-items: center; gap: 14px; padding: 15px;
    border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; background: #fff;
}
.student-result:hover { border-color: #c7dbba; background: var(--sap-green-pale); }
.student-result-main, .call-main { flex: 1; min-width: 0; }
.student-avatar, .call-avatar {
    width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center;
    border-radius: 13px; background: var(--sap-green-soft); color: var(--sap-green-dark); font-weight: 900;
}

.muted { color: var(--muted); margin-top: 4px; font-size: 14px; }
.status { border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 900; }
.status.waiting { background: #fff4d7; color: #8a6208; }
.status.seen { background: var(--sap-green-soft); color: var(--sap-green-dark); }
.status.awaiting_delivery { background: #eaf2ff; color: #315f9f; }

.empty-state {
    min-height: 170px; display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 6px; text-align: center; color: var(--muted); padding: 28px;
}
.empty-state > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--sap-green-soft); color: var(--sap-green-dark); font-weight: 900; font-size: 22px; margin-bottom: 6px; }
.empty-state strong { color: var(--ink); }
.empty-state small { max-width: 360px; }
.empty-state.compact { min-height: 110px; }

.toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 500;
    background: #242825; color: #fff; padding: 15px 19px; border-radius: 12px;
    opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s;
    box-shadow: 0 16px 40px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

.station-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.station-card {
    display: flex; align-items: center; gap: 14px; min-height: 95px; padding: 17px;
    border: 1px solid var(--border); border-radius: 16px; color: var(--ink); text-decoration: none; background: #fff;
    transition: .15s ease;
}
.station-card:hover { border-color: #bfd8ad; background: var(--sap-green-pale); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(31,37,27,.07); }
.station-card strong, .station-card small { display: block; }
.station-card small { color: var(--muted); margin-top: 3px; }
.station-number { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; display: grid; place-items: center; background: var(--sap-green-soft); color: var(--sap-green-dark); font-size: 20px; font-weight: 950; }
.reception-card { background: #26292b; color: white; border-color: #26292b; }
.reception-card small { color: #cfd2ce; }
.reception-card .station-number { background: var(--sap-green); color: white; }
.reception-card:hover { background: #303436; border-color: #303436; }

.connection { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-weight: 850; }
.connection-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.connection.online { background: var(--sap-green-soft); color: var(--sap-green-dark); }
.connection.offline { background: #fdeaea; color: #a52d2d; }
.room-panel { min-height: 350px; }
.room-call { justify-content: space-between; min-height: 112px; padding: 21px; border-width: 2px; }
.room-call.waiting { border-color: #d9a82d; background: #fffdf8; }
.room-call.seen { border-color: #a9d28f; background: var(--sap-green-pale); }
.room-call-main { flex: 1; }
.room-student { font-size: clamp(26px, 3vw, 36px); font-weight: 950; letter-spacing: -.03em; }
.room-state { margin-top: 6px; color: var(--muted); font-weight: 750; }
.room-state.waiting { color: #9a6f0b; }
.room-state.seen { color: var(--sap-green-dark); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sound-active { background: var(--sap-green-soft) !important; color: var(--sap-green-dark) !important; }

#flashOverlay { position: fixed; inset: 0; background: rgba(103,189,47,.34); opacity: 0; pointer-events: none; z-index: 998; }
#flashOverlay.flash { animation: screenFlash 1.5s ease-out; }
@keyframes screenFlash { 0%{opacity:0} 10%{opacity:1} 35%{opacity:.12} 50%{opacity:.72} 100%{opacity:0} }
.room-alert-toast {
    position: fixed; left: 50%; bottom: 42px; transform: translateX(-50%) translateY(30px);
    display: flex; align-items: center; gap: 15px; min-width: 300px; padding: 17px 22px;
    border-radius: 16px; background: rgba(34,39,35,.96); color: white; opacity: 0; pointer-events: none;
    transition: .22s; z-index: 999; box-shadow: 0 16px 42px rgba(0,0,0,.25);
}
.room-alert-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.room-alert-toast strong { display: block; font-size: 20px; margin-bottom: 3px; }
.room-alert-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sap-green); font-size: 22px; font-weight: 950; }

.import-panel { display: grid; grid-template-columns: .9fr 1.1fr; gap: 34px; align-items: center; }
.excel-columns { display: grid; grid-template-columns: 2fr 1fr 1fr; border: 1px solid #cfe2c2; border-radius: 12px; overflow: hidden; margin: 15px 0; }
.excel-columns span { padding: 12px; background: var(--sap-green-pale); font-weight: 850; border-right: 1px solid #cfe2c2; }
.excel-columns span:last-child { border-right: 0; }
.import-form { display: grid; gap: 13px; }
.file-drop { min-height: 128px; border: 2px dashed #b8d6a5; border-radius: 16px; background: var(--sap-green-pale); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; cursor: pointer; text-align: center; padding: 18px; }
.file-drop:hover { border-color: var(--sap-green); }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--sap-green); color: white; font-weight: 950; margin-bottom: 3px; }
.file-drop small { color: var(--muted); }
.import-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card { display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--border); border-radius: 13px; padding: 13px; cursor: pointer; }
.radio-card.selected { border-color: #9dcc7e; background: var(--sap-green-pale); }
.radio-card input { margin-top: 4px; accent-color: var(--sap-green); }
.radio-card strong, .radio-card small { display: block; }
.radio-card small { color: var(--muted); margin-top: 3px; line-height: 1.35; }
.import-button { min-height: 46px; }
.notice { border-radius: 13px; padding: 14px 17px; margin-bottom: 18px; font-weight: 750; }
.success-notice { background: var(--sap-green-soft); color: var(--sap-green-dark); border: 1px solid #c5e2b3; }
.error-notice { background: #fdeaea; color: #9d3030; border: 1px solid #f0c8c8; }

.student-form, .student-line { display: grid; grid-template-columns: minmax(220px,2fr) minmax(110px,1fr) 130px auto; gap: 10px; align-items: center; }
.student-form input, .student-line input, .student-form select, .student-line select { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: white; outline: none; }
.student-form input:focus, .student-line input:focus, .student-form select:focus, .student-line select:focus { border-color: var(--sap-green); box-shadow: 0 0 0 3px rgba(103,189,47,.09); }
.student-table-head { display: grid; grid-template-columns: minmax(220px,2fr) minmax(110px,1fr) 130px auto; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; padding: 0 4px 9px; }
.student-line { padding: 10px 0; border-top: 1px solid #edf0eb; }
.row-actions { display: flex; gap: 7px; }
.small-button { padding: 9px 12px; }
.count-badge { border-radius: 999px; background: var(--sap-green-soft); color: var(--sap-green-dark); padding: 7px 11px; font-weight: 850; font-size: 13px; }

@media (max-width: 980px) {
    .two-col, .import-panel { grid-template-columns: 1fr; }
    .station-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-mark { display: none; }
    .student-table-head { display: none; }
    .student-line, .student-form { grid-template-columns: 1fr 1fr; padding: 14px 0; }
    .row-actions { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .topbar { padding: 10px 15px; min-height: 70px; }
    .brand img { width: 160px; }
    .topbar nav a { padding: 8px; font-size: 14px; }
    .container { padding: 22px 15px 40px; }
    .panel { padding: 19px; border-radius: 18px; }
    .hero { padding: 28px 22px; border-radius: 20px; min-height: 190px; }
    .page-heading, .room-header, .panel-title-row { align-items: flex-start; flex-direction: column; }
    .station-grid { grid-template-columns: 1fr; }
    .import-mode { grid-template-columns: 1fr; }
    .student-line, .student-form { grid-template-columns: 1fr; }
    .room-call { align-items: flex-start; flex-direction: column; }
    .actions { width: 100%; }
    .actions button { flex: 1; }
}


/* Entrada obrigatória das salas: desbloqueia o áudio do browser antes de usar a sala */
body.sound-gate-open { overflow: hidden; }
.sound-gate {
    position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 24px;
    background: rgba(31, 37, 27, .86); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
}
.sound-gate.hidden { display: none; }
.sound-gate-card {
    width: min(520px, 100%); padding: 38px 34px; text-align: center; background: #fff;
    border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 28px 80px rgba(0,0,0,.30);
}
.sound-gate-icon {
    width: 72px; height: 72px; margin: 0 auto 18px; display: grid; place-items: center;
    border-radius: 22px; background: var(--sap-green-soft); font-size: 34px;
}
.sound-gate-card h1 { margin: 7px 0 10px; font-size: clamp(28px, 5vw, 38px); letter-spacing: -.03em; }
.sound-gate-card p { margin: 0 auto 22px; max-width: 390px; color: var(--muted); line-height: 1.5; }
.sound-gate-button { width: 100%; min-height: 56px; font-size: 17px; }
.sound-gate-error { display: block; min-height: 20px; margin-top: 12px; color: var(--danger); font-weight: 750; }
.sound-ready {
    display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 999px;
    background: var(--sap-green-soft); color: var(--sap-green-dark); font-weight: 850;
}

.cancel-call { width:34px; height:34px; min-width:34px; padding:0; border:none; border-radius:10px; display:flex; align-items:center; justify-content:center; background:transparent; color:#9ca3a0; font-size:25px; font-weight:500; line-height:1; cursor:pointer; transition:background .15s ease,color .15s ease,transform .15s ease; }
.cancel-call:hover { background:#ffe7e7; color:#d93636; transform:scale(1.06); }
.cancel-call:active { transform:scale(.95); }

/* Comunicação bidirecional das chamadas - v2 */
body.modal-open { overflow: hidden; }

.note-modal {
    position: fixed; inset: 0; z-index: 6000; display: grid; place-items: center; padding: 22px;
    background: rgba(24,28,26,.72); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
}
.note-modal.hidden { display: none; }
.note-modal-card {
    width: min(610px,100%); padding: 30px; border-radius: 26px; background: #fff;
    border: 1px solid rgba(255,255,255,.7); box-shadow: 0 30px 90px rgba(0,0,0,.30);
}
.modal-icon {
    width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 18px;
    border-radius: 14px; background: var(--sap-green-soft); color: var(--sap-green-dark);
    font-size: 25px; font-weight: 950;
}
.note-modal-card h2 { margin: 2px 0 8px; font-size: clamp(28px,4vw,38px); }
.call-modal-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.room-pill { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border-radius: 999px; background: var(--sap-green-soft); color: var(--sap-green-dark); font-weight: 900; }
.initial-note-card { margin-top: 22px; padding: 18px; border-radius: 17px; background: #f8faf7; border: 1px solid #e2eadc; }
.initial-note-card p { margin: 4px 0 12px; font-size: 13px; }
.note-label { display: block; color: var(--ink); font-size: 14px; font-weight: 900; }
.note-label span { margin-left: 5px; color: var(--muted); font-weight: 650; }
.note-textarea {
    width: 100%; min-height: 74px; resize: vertical; box-sizing: border-box; padding: 13px 14px;
    border: 1.5px solid #d9ded5; border-radius: 13px; background: #fff; color: var(--ink);
    font: inherit; font-size: 15px; line-height: 1.45; outline: none; transition: border-color .15s, box-shadow .15s;
}
.note-textarea.large { min-height: 120px; }
.note-textarea::placeholder { color: #9ba19a; }
.note-textarea:focus { border-color: var(--sap-green); box-shadow: 0 0 0 4px rgba(103,189,47,.10); }
.note-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.note-modal-actions button { min-width: 125px; min-height: 46px; }

.active-call-card {
    border: 1px solid var(--border); border-radius: 18px; background: #fff; overflow: hidden;
    box-shadow: 0 5px 18px rgba(31,37,27,.035);
}
.active-call-card + .active-call-card { margin-top: 13px; }
.active-call-head { display: flex; align-items: center; gap: 13px; padding: 15px 16px; }
.active-call-head .call-main { flex: 1; min-width: 0; }
.active-call-communication { padding: 15px 16px 16px; border-top: 1px solid #edf0eb; background: #fbfcfa; }

.communication-card {
    margin-top: 18px; padding: 16px; border-radius: 17px; border: 1px solid #dfe7da;
    background: rgba(255,255,255,.78);
}
.communication-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.communication-head > div { display: flex; align-items: center; gap: 8px; }
.communication-head strong { font-size: 14px; }
.communication-head small { color: var(--muted); font-size: 12px; }
.communication-icon { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--sap-green-soft); color: var(--sap-green-dark); font-weight: 950; }
.reception-communication-head { margin-bottom: 10px; }

.message-thread { display: grid; gap: 8px; margin: 5px 0 12px; }
.message-row { display: flex; }
.message-row.reception { justify-content: flex-start; }
.message-row.room { justify-content: flex-end; }
.message-bubble { width: fit-content; max-width: min(88%, 680px); padding: 10px 12px; border-radius: 14px; border: 1px solid #e0e4dd; background: #fff; box-shadow: 0 2px 7px rgba(31,37,27,.03); }
.message-row.reception .message-bubble { border-top-left-radius: 5px; background: var(--sap-green-pale); border-color: #d4e7c8; }
.message-row.room .message-bubble { border-top-right-radius: 5px; background: #f1f3f5; border-color: #e1e4e7; }
.message-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 4px; }
.message-meta strong { color: var(--sap-green-dark); font-size: 11px; text-transform: uppercase; letter-spacing: .055em; }
.message-row.room .message-meta strong { color: #626a71; }
.message-meta span { color: #9aa09a; font-size: 11px; }
.message-text { color: var(--ink); font-size: 14px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }

.communication-empty { display: flex; align-items: center; gap: 10px; margin: 5px 0 12px; padding: 11px 12px; border-radius: 12px; background: #f5f7f4; color: var(--muted); }
.communication-empty > span { font-size: 19px; }
.communication-empty strong, .communication-empty small { display: block; }
.communication-empty strong { color: #626862; font-size: 13px; }
.communication-empty small { margin-top: 1px; font-size: 12px; line-height: 1.35; }
.communication-empty.compact { padding: 9px 10px; }

.composer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: end; }
.composer .note-textarea { min-height: 56px; max-height: 150px; }
.send-note-button { min-height: 44px; white-space: nowrap; }

.room-call { display: block; min-height: 0; padding: 21px; }
.room-call-main { width: 100%; }
.room-call-topline { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.room-student-wrap { min-width: 0; }
.room-thread { max-width: 940px; }
.room-note-form { max-width: 940px; }

@media (max-width: 700px) {
    .note-modal { padding: 12px; }
    .note-modal-card { padding: 22px 17px; border-radius: 20px; }
    .note-modal-actions { flex-direction: column-reverse; }
    .note-modal-actions button { width: 100%; }
    .initial-note-card { padding: 14px; }
    .call-modal-meta { align-items: flex-start; }
    .active-call-head { align-items: flex-start; }
    .active-call-head .status { margin-left: auto; }
    .active-call-communication { padding: 13px; }
    .room-call-topline { align-items: flex-start; flex-direction: column; }
    .room-call-topline .actions { width: 100%; }
    .communication-head { align-items: flex-start; flex-direction: column; }
    .communication-head small { margin-left: 36px; }
    .message-bubble { max-width: 94%; }
    .composer { grid-template-columns: 1fr; }
    .send-note-button { width: 100%; }
    .note-textarea { font-size: 16px; } /* evita zoom automático no iPhone */
}


/* Etapa 1 — aviso de nova mensagem + PING */
.message-notification-badge {
    display: inline-flex; align-items: center; justify-content: center; min-height: 27px;
    padding: 5px 10px; border-radius: 999px; background: var(--sap-green); color: #fff;
    font-size: 11px; font-weight: 900; letter-spacing: .01em; white-space: nowrap;
    box-shadow: 0 4px 12px rgba(80,150,36,.18);
    animation: messageBadgePulse 1.8s ease-in-out infinite;
}
.active-call-card.has-unread { border-color: #b7dca1; box-shadow: 0 0 0 3px rgba(103,189,47,.08), 0 7px 22px rgba(31,37,27,.05); }
.room-call.has-unread { box-shadow: 0 0 0 3px rgba(103,189,47,.10), 0 7px 22px rgba(31,37,27,.05); }
.communication-head-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@keyframes messageBadgePulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.035)} }
@media (max-width: 700px) {
    .communication-head-right { width: 100%; justify-content: flex-start; padding-left: 36px; }
    .communication-head-right small { margin-left: 0; }
}


/* Etapa 2 — cronómetro da chamada */
.elapsed-timer {
    display: inline-flex; align-items: center; gap: 6px; min-height: 31px;
    padding: 5px 10px; border: 1px solid #dde3d9; border-radius: 999px;
    background: #f8faf7; color: #4f5850; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.elapsed-timer-icon { color: var(--sap-green-dark); font-size: 15px; line-height: 1; }
.elapsed-timer-value { min-width: 42px; text-align: center; font-size: 13px; font-weight: 900; letter-spacing: .04em; }
.room-student-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 7px; }
.room-student-meta .room-state { margin-top: 0; }
.room-elapsed-timer { min-height: 30px; background: rgba(255,255,255,.72); }
@media (max-width: 700px) {
    .active-call-head { flex-wrap: wrap; }
    .active-call-head .call-main { min-width: calc(100% - 62px); }
    .active-call-head .elapsed-timer { order: 3; margin-left: 61px; }
    .active-call-head .status { order: 4; margin-left: 0; }
    .active-call-head .cancel-call { order: 5; }
}

/* Etapa 3 — aluno enviado, a aguardar entrega e confirmação na receção */
.active-call-card.awaiting_delivery { border-color: #bfd2ec; }
.delivery-button { min-height: 36px; padding: 8px 14px; white-space: nowrap; }
.delivery-wait-note {
    padding: 11px 12px; border-radius: 12px; background: #f1f6fc; color: #49637f;
    font-size: 13px; font-weight: 700; line-height: 1.4;
}
@media (max-width: 700px) {
    .active-call-head .delivery-button { order: 5; }
    .active-call-head .cancel-call { order: 6; }
}


/* Etapa 4 — relatório diário de saídas */
.report-panel {
    display: flex; align-items: center; justify-content: space-between; gap: 28px;
}
.report-panel-copy { min-width: 0; }
.report-panel-copy p { margin: 7px 0 0; }
.report-form {
    display: grid; grid-template-columns: auto minmax(165px, 210px) auto; align-items: end; gap: 10px;
    min-width: min(100%, 470px);
}
.report-form label {
    grid-column: 1 / -1; color: var(--ink); font-size: 13px; font-weight: 900;
}
.report-form input[type="date"] {
    grid-column: 1 / 3; width: 100%; min-height: 43px; padding: 9px 12px;
    border: 1.5px solid #d9ded5; border-radius: 11px; background: #fff; color: var(--ink); outline: none;
}
.report-form input[type="date"]:focus { border-color: var(--sap-green); box-shadow: 0 0 0 4px rgba(103,189,47,.10); }
.report-form button { min-height: 43px; white-space: nowrap; }
@media (max-width: 820px) {
    .report-panel { align-items: stretch; flex-direction: column; }
    .report-form { min-width: 0; width: 100%; }
}
@media (max-width: 560px) {
    .report-form { grid-template-columns: 1fr; }
    .report-form label, .report-form input[type="date"], .report-form button { grid-column: 1; width: 100%; }
}
.active-room-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px;margin-top:14px}
.active-room-link{display:flex;flex-direction:column;gap:5px;padding:14px 16px;border:1px solid var(--border);border-radius:14px;background:#fff;color:inherit;text-decoration:none}
.active-room-link:hover{border-color:#65bd2f;box-shadow:0 4px 14px rgba(33,77,20,.08)}
.active-room-link small{color:#6b716d}

.login-form label { display:block; font-weight:750; margin-top:16px; }
.login-form input:not([type="hidden"]) { min-height:48px; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:#fff; font-size:16px; }
.login-form input:focus { outline:2px solid var(--sap-green); outline-offset:2px; }

@media (max-width:620px) {
  .topbar { flex-wrap:wrap; gap:8px; }
  .topbar nav { width:100%; flex-wrap:wrap; gap:4px; }
  .topbar nav form { margin-left:auto; }
  .topbar nav button { font-size:13px; padding:8px 10px; min-height:36px; }
}
