/* LEGACY SAFE
   CSS original preservado para não quebrar telas antigas.
   As correções limpas ficam nos arquivos por módulo abaixo.
*/

*{margin:0;padding:0;box-sizing:border-box;}
body{font-family:'Segoe UI',Arial,sans-serif;background:#f4f6fa;min-height:100vh;}
#login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#1a56db 0%,#0e9f6e 100%);}
.login-box{background:#fff;border-radius:16px;padding:48px 40px;width:100%;max-width:400px;box-shadow:0 20px 60px rgba(0,0,0,.18);}
.login-logo{text-align:center;margin-bottom:30px;}
.login-logo .icon{font-size:46px;}
.login-logo h1{font-size:24px;font-weight:800;color:#1a56db;margin-top:8px;}
.login-logo p{font-size:13px;color:#888;margin-top:4px;}
.inp-group{margin-bottom:16px;}
.inp-group label{font-size:13px;font-weight:600;color:#444;display:block;margin-bottom:6px;}
.inp-group input{width:100%;padding:11px 14px;border:1.5px solid #ddd;border-radius:8px;font-size:14px;outline:none;transition:border-color .2s;}
.inp-group input:focus{border-color:#1a56db;box-shadow:0 0 0 3px rgba(26,86,219,.1);}
.btn-enter{width:100%;padding:13px;background:linear-gradient(90deg,#1a56db,#0e9f6e);color:#fff;border:none;border-radius:8px;font-size:15px;font-weight:700;cursor:pointer;margin-top:6px;}
.btn-enter:hover{opacity:.92;}
.demo-hint{background:#f4f6fa;border-radius:8px;padding:12px 14px;margin-top:16px;font-size:12px;color:#666;line-height:1.8;}
.demo-hint strong{color:#1a56db;}
#app{display:none;min-height:100vh;flex-direction:column;}
.header{background:#fff;border-bottom:1px solid #e8eaf0;padding:0 24px;height:60px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:200;box-shadow:0 1px 4px rgba(0,0,0,.06);}
.header-brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:18px;color:#1a56db;}
.hbrand-dot{width:10px;height:10px;border-radius:50%;background:linear-gradient(135deg,#1a56db,#0e9f6e);}
.header-right{display:flex;align-items:center;gap:14px;}
.profile-chip{display:flex;align-items:center;gap:8px;background:#f4f6fa;border-radius:20px;padding:5px 14px 5px 6px;}
.pav{width:30px;height:30px;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;}
.pav.medico{background:linear-gradient(135deg,#1a56db,#3b82f6);}
.pav.recepcionista{background:linear-gradient(135deg,#0e9f6e,#34d399);}
.pav.financeiro{background:linear-gradient(135deg,#f59e0b,#fbbf24);}
.pav.admin{background:linear-gradient(135deg,#ef4444,#f87171);}
.pchip-info{font-size:12.5px;}
.pchip-name{font-weight:700;color:#1e2a3a;}
.pchip-role{font-size:11px;color:#888;}
.btn-logout{display:flex;align-items:center;gap:7px;background:#fff1f1;border:1.5px solid #fecaca;color:#ef4444;cursor:pointer;font-size:13px;font-weight:700;padding:7px 14px;border-radius:8px;transition:all .18s;}
.btn-logout:hover{background:#ef4444;color:#fff;border-color:#ef4444;transform:scale(1.02);}
.notif-bell{position:relative;cursor:pointer;background:none;border:none;font-size:20px;padding:6px;border-radius:8px;transition:background .15s;}
.notif-bell:hover{background:#f4f6fa;}
.notif-badge{position:absolute;top:2px;right:2px;background:#ef4444;color:#fff;font-size:10px;font-weight:800;min-width:16px;height:16px;border-radius:8px;display:flex;align-items:center;justify-content:center;padding:0 3px;animation:pulse 1.5s infinite;}
@keyframes pulse{0%,100%{transform:scale(1);}50%{transform:scale(1.2);}}
.notif-dropdown{position:absolute;top:56px;right:80px;width:380px;background:#fff;border-radius:14px;box-shadow:0 8px 40px rgba(0,0,0,.15);z-index:400;display:none;overflow:hidden;}
.notif-dropdown.open{display:block;animation:fadeDown .2s ease;}
@keyframes fadeDown{from{opacity:0;transform:translateY(-8px);}to{opacity:1;transform:translateY(0);}}
.notif-header{padding:16px 18px 12px;border-bottom:1px solid #f0f0f0;display:flex;align-items:center;justify-content:space-between;}
.notif-header h3{font-size:14px;font-weight:800;color:#1e2a3a;}
.notif-mark{font-size:12px;color:#1a56db;cursor:pointer;font-weight:600;}
.notif-list{max-height:340px;overflow-y:auto;}
.notif-item{padding:12px 16px;border-bottom:1px solid #f8f9fb;display:flex;gap:12px;align-items:flex-start;cursor:pointer;transition:background .1s;}
.notif-item:hover{background:#f8f9fb;}
.notif-item.unread{background:#eef2ff;}
.notif-item.unread:hover{background:#e4eaff;}
.ni-icon{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;}
.ni-blue{background:#dbeafe;}.ni-green{background:#d1fae5;}.ni-orange{background:#fef3c7;}.ni-red{background:#fee2e2;}
.ni-body{flex:1;}
.ni-title{font-size:13px;font-weight:700;color:#1e2a3a;}
.ni-sub{font-size:12px;color:#888;margin-top:2px;}
.ni-time{font-size:11px;color:#bbb;margin-top:3px;}
.notif-footer{padding:12px 16px;text-align:center;border-top:1px solid #f0f0f0;}
.notif-footer a{font-size:12.5px;color:#1a56db;font-weight:600;cursor:pointer;}
.app-body{display:flex;flex:1;}
.sidebar{width:220px;background:#fff;border-right:1px solid #e8eaf0;padding:14px 0;display:flex;flex-direction:column;min-height:calc(100vh - 60px);position:sticky;top:60px;height:calc(100vh - 60px);overflow-y:auto;}
.nav-section{font-size:10px;font-weight:700;color:#ccc;letter-spacing:1.2px;padding:14px 20px 5px;text-transform:uppercase;}
.nav-item{display:flex;align-items:center;gap:10px;padding:10px 20px;font-size:13.5px;color:#555;cursor:pointer;border-left:3px solid transparent;transition:all .15s;user-select:none;}
.nav-item:hover{background:#f4f6fa;color:#1a56db;}
.nav-item.active{background:#eef2ff;color:#1a56db;border-left-color:#1a56db;font-weight:700;}
.nav-icon{font-size:17px;width:22px;text-align:center;}
.sidebar-footer{margin-top:auto;padding:14px 20px;font-size:11px;color:#ccc;border-top:1px solid #f0f0f0;}
.content{flex:1;padding:28px;overflow-y:auto;max-width:100%;}
.page-title{font-size:22px;font-weight:800;color:#1e2a3a;}
.page-sub{font-size:13px;color:#888;margin-top:3px;margin-bottom:24px;}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:16px;margin-bottom:26px;}
.scard{background:#fff;border-radius:12px;padding:20px;box-shadow:0 1px 4px rgba(0,0,0,.06);display:flex;align-items:center;gap:14px;}
.sc-icon{width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0;}
.ic-blue{background:#eef2ff;}.ic-green{background:#ecfdf5;}.ic-orange{background:#fff7ed;}.ic-red{background:#fef2f2;}.ic-purple{background:#f5f3ff;}
.sc-num{font-size:26px;font-weight:800;color:#1e2a3a;}
.sc-lbl{font-size:12px;color:#888;}
.sc-trend{font-size:11px;font-weight:600;margin-top:3px;}
.up{color:#0e9f6e;}.dn{color:#ef4444;}
.tbl-wrap{background:#fff;border-radius:12px;box-shadow:0 1px 4px rgba(0,0,0,.06);overflow:hidden;margin-bottom:24px;}
.tbl-head{padding:16px 20px;border-bottom:1px solid #f0f0f0;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;}
.tbl-title{font-size:15px;font-weight:700;color:#1e2a3a;}
table{width:100%;border-collapse:collapse;}
thead th{background:#f8f9fb;padding:10px 16px;text-align:left;font-size:11.5px;font-weight:700;color:#555;text-transform:uppercase;letter-spacing:.4px;border-bottom:1px solid #eee;}
tbody td{padding:12px 16px;font-size:13.5px;color:#333;border-bottom:1px solid #f5f5f5;}
tbody tr:hover{background:#fafbff;}
tbody tr:last-child td{border-bottom:none;}
.badge{display:inline-flex;align-items:center;padding:3px 10px;border-radius:20px;font-size:11.5px;font-weight:700;}
.b-green{background:#d1fae5;color:#065f46;}.b-blue{background:#dbeafe;color:#1e40af;}
.b-orange{background:#fef3c7;color:#92400e;}.b-red{background:#fee2e2;color:#991b1b;}
.b-gray{background:#f3f4f6;color:#4b5563;}.b-purple{background:#ede9fe;color:#5b21b6;}
.b-yellow{background:#fef9c3;color:#713f12;}.b-teal{background:#ccfbf1;color:#115e59;}
.btn{padding:9px 18px;border-radius:8px;font-size:13px;font-weight:700;cursor:pointer;border:none;transition:all .15s;}
.btn-blue{background:#1a56db;color:#fff;}.btn-blue:hover{background:#1444b0;}
.btn-green{background:#0e9f6e;color:#fff;}.btn-green:hover{background:#0b7a55;}
.btn-outline{background:#fff;color:#1a56db;border:1.5px solid #1a56db;}.btn-outline:hover{background:#eef2ff;}
.btn-ghost{background:#f4f6fa;color:#555;border:none;}.btn-ghost:hover{background:#e8eaf0;}
.btn-danger{background:#ef4444;color:#fff;}.btn-danger:hover{background:#dc2626;}
.btn-sm{padding:5px 12px;font-size:12px;}
.btn-warn{background:#f59e0b;color:#fff;}.btn-warn:hover{background:#d97706;}
.btn-purple{background:#7c3aed;color:#fff;}.btn-purple:hover{background:#6d28d9;}
.search-row{display:flex;gap:10px;margin-bottom:20px;flex-wrap:wrap;}
.sinp{flex:1;min-width:200px;padding:10px 14px;border:1.5px solid #e0e0e0;border-radius:8px;font-size:13.5px;outline:none;background:#fff;}
.sinp:focus{border-color:#1a56db;}
.ssel{padding:10px 12px;border:1.5px solid #e0e0e0;border-radius:8px;font-size:13.5px;outline:none;background:#fff;cursor:pointer;}
.panels{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:24px;}
.panel{background:#fff;border-radius:12px;padding:20px;box-shadow:0 1px 4px rgba(0,0,0,.06);}
.panel-title{font-size:14px;font-weight:700;color:#1e2a3a;margin-bottom:16px;display:flex;align-items:center;justify-content:space-between;}
.plink{font-size:12px;color:#1a56db;cursor:pointer;font-weight:600;}
.pront-hero{background:linear-gradient(135deg,#1a56db,#0e9f6e);color:#fff;border-radius:12px;padding:24px;margin-bottom:20px;display:flex;align-items:center;gap:20px;flex-wrap:wrap;}
.pront-av{width:64px;height:64px;border-radius:50%;background:rgba(255,255,255,.25);display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:800;flex-shrink:0;}
.pront-info h2{font-size:20px;font-weight:800;}
.pront-info p{font-size:13px;opacity:.85;margin-top:4px;}
.pront-tags{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap;}
.ptag{background:rgba(255,255,255,.2);padding:3px 12px;border-radius:12px;font-size:11.5px;font-weight:600;}
.pront-tabs{display:flex;gap:0;border-bottom:2px solid #e8eaf0;margin-bottom:20px;overflow-x:auto;}
.ptab{padding:10px 18px;font-size:13px;cursor:pointer;color:#888;border-bottom:3px solid transparent;margin-bottom:-2px;white-space:nowrap;font-weight:600;}
.ptab.active{color:#1a56db;border-bottom-color:#1a56db;font-weight:700;}
.ptab-content{display:none;}.ptab-content.active{display:block;}
.timeline{display:flex;flex-direction:column;}
.tl-item{display:flex;gap:14px;padding-bottom:22px;position:relative;}
.tl-item::before{content:'';position:absolute;left:17px;top:36px;bottom:0;width:2px;background:#e8eaf0;}
.tl-item:last-child::before{display:none;}
.tl-dot{width:36px;height:36px;border-radius:50%;background:#1a56db;color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0;z-index:1;}
.tl-body{flex:1;background:#fff;border-radius:10px;padding:14px 16px;box-shadow:0 1px 4px rgba(0,0,0,.06);}
.tl-date{font-size:11.5px;color:#aaa;margin-bottom:4px;}
.tl-title{font-size:14px;font-weight:700;color:#1e2a3a;}
.tl-desc{font-size:13px;color:#666;margin-top:6px;line-height:1.6;}
.soap-lbl{font-weight:700;color:#1a56db;}
.vitais-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px;margin-bottom:20px;}
.vital-card{background:#fff;border-radius:10px;padding:14px;box-shadow:0 1px 4px rgba(0,0,0,.06);text-align:center;border-top:3px solid #1a56db;}
.vital-val{font-size:22px;font-weight:800;color:#1e2a3a;margin:4px 0;}
.vital-unit{font-size:11px;color:#aaa;}
.vital-lbl{font-size:12px;color:#888;font-weight:600;}
.vital-normal{border-top-color:#0e9f6e;}
.vital-alert{border-top-color:#ef4444;}
.med-row{display:flex;gap:8px;margin-bottom:8px;align-items:center;background:#f8f9fb;padding:10px 12px;border-radius:8px;flex-wrap:wrap;}
.med-row input,.med-row select{padding:7px 10px;border:1.5px solid #e0e0e0;border-radius:6px;font-size:13px;outline:none;background:#fff;}
.med-row .med-nome{flex:2;min-width:160px;}
.med-row .med-dose{flex:1;min-width:100px;}
.med-row .med-freq{flex:1;min-width:120px;}
.med-row .med-dur{flex:1;min-width:100px;}
.doc-card{background:#fff;border-radius:10px;padding:14px 16px;box-shadow:0 1px 4px rgba(0,0,0,.06);margin-bottom:10px;border-left:4px solid #1a56db;}
.doc-card.receita{border-left-color:#0e9f6e;}
.doc-card.atestado{border-left-color:#7c3aed;}
.doc-card.laudo{border-left-color:#0891b2;}
.doc-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;flex-wrap:wrap;gap:8px;}
.doc-title{font-size:14px;font-weight:700;color:#1e2a3a;}
.doc-date{font-size:12px;color:#aaa;}
.doc-body{font-size:13px;color:#555;line-height:1.6;}
.exam-upload{border:2px dashed #1a56db;border-radius:12px;padding:30px;text-align:center;background:#f8f9fb;cursor:pointer;transition:all .15s;margin-bottom:16px;}
.exam-upload:hover{background:#eef2ff;border-color:#1444b0;}
.exam-upload input[type=file]{display:none;}
.exam-upload .eu-icon{font-size:36px;margin-bottom:8px;}
.exam-upload p{font-size:13.5px;color:#555;font-weight:600;}
.exam-upload small{font-size:12px;color:#aaa;}
.exam-file{background:#fff;border-radius:10px;padding:14px 16px;box-shadow:0 1px 4px rgba(0,0,0,.06);margin-bottom:8px;display:flex;align-items:center;gap:12px;}
.ef-icon{width:40px;height:40px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;}
.ef-pdf{background:#fee2e2;}.ef-img{background:#dbeafe;}
.ef-info{flex:1;}
.ef-name{font-size:13.5px;font-weight:700;color:#1e2a3a;}
.ef-meta{font-size:12px;color:#aaa;margin-top:2px;}
.pdf-viewer-overlay{position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:600;display:none;flex-direction:column;}
.pdf-viewer-overlay.open{display:flex;}
.pdf-viewer-header{background:#1e2a3a;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;}
.pdf-viewer-title{color:#fff;font-size:14px;font-weight:700;}
.pdf-viewer-close{color:#fff;background:none;border:none;font-size:24px;cursor:pointer;}
.pdf-viewer-body{flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.pdf-viewer-body iframe{width:100%;height:100%;border:none;}
.pdf-viewer-body img{max-width:100%;max-height:100%;object-fit:contain;}
.fin-3{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin-bottom:24px;}
.fcrd{background:#fff;border-radius:12px;padding:22px;box-shadow:0 1px 4px rgba(0,0,0,.06);text-align:center;}
.fcrd-num{font-size:28px;font-weight:800;margin-top:6px;}
.fcrd-lbl{font-size:12px;color:#888;margin-top:4px;}
.bar-chart{display:flex;flex-direction:column;gap:12px;}
.bar-row{display:flex;align-items:center;gap:10px;}
.bar-lbl{font-size:12px;color:#555;width:110px;text-align:right;flex-shrink:0;}
.bar-track{flex:1;background:#f0f2f8;border-radius:6px;height:22px;overflow:hidden;}
.bar-fill{height:100%;border-radius:6px;display:flex;align-items:center;padding-left:10px;font-size:11px;color:#fff;font-weight:700;}
.bf-blue{background:linear-gradient(90deg,#1a56db,#3b82f6);}
.bf-green{background:linear-gradient(90deg,#0e9f6e,#34d399);}
.bf-orange{background:linear-gradient(90deg,#f59e0b,#fbbf24);}
.bf-purple{background:linear-gradient(90deg,#8b5cf6,#a78bfa);}
.modal-bg{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:300;display:none;align-items:center;justify-content:center;padding:16px;}
.modal-bg.open{display:flex;}
.modal{background:#fff;border-radius:16px;padding:30px;width:100%;max-width:620px;max-height:92vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.2);}
.modal-lg{max-width:800px;}
.modal-sm{max-width:440px;}
.modal-title{font-size:17px;font-weight:800;color:#1e2a3a;margin-bottom:22px;display:flex;justify-content:space-between;align-items:center;}
.modal-x{cursor:pointer;font-size:24px;color:#bbb;background:none;border:none;line-height:1;}
.modal-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:22px;border-top:1px solid #f0f0f0;padding-top:18px;}
.ag-grid{display:grid;border:1px solid #e8eaf0;border-radius:12px;overflow:hidden;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.06);}
.ag-head{background:#1a56db;color:#fff;text-align:center;padding:12px 4px;font-size:12px;font-weight:700;}
.ag-head.corner{background:#f8f9fb;color:#888;}
.ag-time{background:#f8f9fb;padding:6px 8px;font-size:11px;color:#888;text-align:right;border-bottom:1px solid #f0f0f0;border-right:1px solid #f0f0f0;display:flex;align-items:center;justify-content:flex-end;}
.ag-slot{min-height:52px;border-bottom:1px solid #f0f0f0;border-right:1px solid #f0f0f0;padding:4px;}
.ag-appt{background:#dbeafe;border-left:3px solid #1a56db;border-radius:4px;padding:4px 6px;font-size:11px;color:#1e40af;cursor:pointer;margin-bottom:2px;line-height:1.4;}
.ag-appt.g{background:#d1fae5;border-left-color:#0e9f6e;color:#065f46;}
.ag-appt.o{background:#fef3c7;border-left-color:#f59e0b;color:#92400e;}
.ag-free{color:#d1d5db;font-size:11px;display:flex;align-items:center;justify-content:center;height:100%;cursor:pointer;}
.ag-free:hover{color:#1a56db;}
.atend-card{background:#fff;border-radius:12px;padding:18px 20px;box-shadow:0 1px 4px rgba(0,0,0,.06);display:flex;align-items:center;gap:14px;margin-bottom:12px;border-left:4px solid transparent;transition:border-color .15s;flex-wrap:wrap;}
.atend-card:hover{border-left-color:#1a56db;}
.atend-card.em-atendimento{border-left-color:#0e9f6e;background:#f0fdf4;}
.atend-card.aguardando{border-left-color:#f59e0b;}
.ac-av{width:48px;height:48px;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800;flex-shrink:0;}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.f-col{display:flex;flex-direction:column;gap:6px;}
.f-col label{font-size:13px;font-weight:600;color:#444;}
.f-col input,.f-col select,.f-col textarea{padding:10px 13px;border:1.5px solid #e0e0e0;border-radius:8px;font-size:13.5px;outline:none;background:#fff;}
.f-col input:focus,.f-col select:focus,.f-col textarea:focus{border-color:#1a56db;}
.f-col textarea{resize:vertical;min-height:80px;}
.f-section{font-size:13px;font-weight:800;color:#1a56db;margin:20px 0 12px;padding-bottom:8px;border-bottom:2px solid #eef2ff;grid-column:1/-1;}
.f-full{grid-column:1/-1;}
.user-card{background:#fff;border-radius:12px;padding:18px 20px;box-shadow:0 1px 4px rgba(0,0,0,.06);display:flex;align-items:center;gap:14px;margin-bottom:12px;flex-wrap:wrap;}
.uc-av{width:44px;height:44px;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800;flex-shrink:0;}
.uc-info{flex:1;}
.uc-name{font-size:15px;font-weight:700;color:#1e2a3a;}
.uc-sub{font-size:12px;color:#888;margin-top:3px;}
.uc-perms{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px;}
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px;}
.detail-item label{font-size:11.5px;font-weight:700;color:#aaa;text-transform:uppercase;letter-spacing:.5px;display:block;margin-bottom:3px;}
.detail-item span{font-size:14px;color:#1e2a3a;font-weight:600;}
.toast{position:fixed;bottom:28px;right:28px;color:#fff;padding:14px 22px;border-radius:10px;font-size:13.5px;font-weight:600;box-shadow:0 6px 24px rgba(0,0,0,.2);z-index:700;display:none;animation:sup .3s ease;max-width:360px;}
.toast.success{background:#0e9f6e;}
.toast.error{background:#ef4444;}
.toast.info{background:#1a56db;}
.toast.warning{background:#f59e0b;}
@keyframes sup{from{transform:translateY(16px);opacity:0;}to{transform:translateY(0);opacity:1;}}
.export-panel{background:#fff;border-radius:12px;padding:24px;box-shadow:0 1px 4px rgba(0,0,0,.06);margin-bottom:24px;}
.export-panel h3{font-size:15px;font-weight:700;color:#1e2a3a;margin-bottom:16px;}
.export-filters{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-bottom:16px;}
.export-filters select,.export-filters input{padding:9px 12px;border:1.5px solid #e0e0e0;border-radius:8px;font-size:13px;outline:none;background:#fff;}

.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;padding:16px;}
.cal-head{text-align:center;font-weight:700;color:#555;padding:10px;background:#f8f9fb;border-radius:8px;}
.cal-empty{min-height:110px;}
.cal-day{min-height:110px;background:#fff;border:1px solid #e8eaf0;border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:5px;}
.cal-day.blocked{background:#fff7f7;border-color:#fecaca;}
.cal-date{font-size:13px;font-weight:800;color:#1e2a3a;}
.cal-event{font-size:11px;padding:4px 6px;border-radius:6px;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ev-blue{background:#2563eb;}
.ev-green{background:#059669;}
.cal-more{font-size:11px;color:#888;margin-top:auto;}


.bloq-card{
  padding:18px;
}
.bloq-grid{
  display:grid;
  grid-template-columns:1.2fr 150px 115px 115px 1.6fr auto;
  gap:12px;
  align-items:end;
}
.bloq-grid .f-col label{
  font-size:12px;
  font-weight:700;
  color:#334155;
  margin-bottom:6px;
  display:block;
}
.bloq-grid .sinp,
.bloq-grid .ssel{
  height:40px;
  border:1px solid #d8dee9;
  border-radius:8px;
  padding:0 12px;
  background:#fff;
  width:100%;
}
.bloq-help{
  margin:12px 0 0;
  padding:10px 12px;
  border-radius:10px;
  background:#f8fafc;
  color:#64748b;
  font-size:12px;
  line-height:1.5;
}
.bloq-list{
  margin-top:16px;
  border-top:1px solid #edf0f5;
  padding-top:12px;
}
@media(max-width:1100px){
  .bloq-grid{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:700px){
  .bloq-grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:768px){
  .sidebar{display:none;}
  .panels{grid-template-columns:1fr;}
  .fin-3{grid-template-columns:1fr;}
  .form-grid{grid-template-columns:1fr;}
  .vitais-grid{grid-template-columns:repeat(2,1fr);}
  .atend-card{flex-direction:column;align-items:flex-start;}
}

/* Ajuste seguro do bloco Novo Bloqueio */
.bloq-card{
  padding:18px !important;
}
.bloq-grid{
  display:grid !important;
  grid-template-columns:minmax(220px,1.4fr) minmax(145px,.8fr) minmax(110px,.7fr) minmax(110px,.7fr) minmax(240px,1.4fr) minmax(120px,.6fr) !important;
  gap:14px !important;
  align-items:end !important;
}
.bloq-grid .f-col{
  min-width:0 !important;
}
.bloq-grid .f-col label{
  display:block !important;
  font-size:12px !important;
  font-weight:800 !important;
  color:#334155 !important;
  margin-bottom:6px !important;
}
.bloq-grid .sinp,
.bloq-grid .ssel{
  width:100% !important;
  min-width:0 !important;
  height:42px !important;
  border:1px solid #dbe3ef !important;
  border-radius:10px !important;
  padding:0 12px !important;
  background:#fff !important;
}
.bloq-grid .btn{
  height:42px !important;
  border-radius:10px !important;
  white-space:nowrap !important;
}
.bloq-help{
  margin-top:14px !important;
  padding:12px 14px !important;
  border-radius:12px !important;
  background:#f8fafc !important;
  color:#64748b !important;
  font-size:12.5px !important;
  line-height:1.5 !important;
}
.bloq-list{
  margin-top:16px !important;
  border-top:1px solid #edf0f5 !important;
  padding-top:12px !important;
}
@media(max-width:1250px){
  .bloq-grid{
    grid-template-columns:1fr 1fr 1fr !important;
  }
}
@media(max-width:850px){
  .bloq-grid{
    grid-template-columns:1fr 1fr !important;
  }
}
@media(max-width:620px){
  .bloq-grid{
    grid-template-columns:1fr !important;
  }
}


/* EXAMES - layout definitivo */
.exames-page{
  padding:18px 4px 4px;
}
.exames-actions-bar{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-bottom:18px;
}
.exames-section{
  background:#fff;
  border:1px solid #e5eaf2;
  border-radius:16px;
  padding:18px;
  margin-bottom:18px;
  box-shadow:0 2px 10px rgba(15,23,42,.04);
}
.exames-section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:15px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:14px;
}
.exames-empty{
  text-align:center;
  color:#94a3b8;
  padding:22px;
  font-size:14px;
}
.exames-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:14px;
}
.exame-card{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:14px;
  padding:14px;
}
.exame-card h4{
  margin:0 0 8px;
  font-size:14px;
  color:#0f172a;
}
.exame-meta{
  font-size:12px;
  color:#64748b;
  margin-bottom:10px;
}
.exame-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.exames-upload-box{
  border:2px dashed #2563eb;
  border-radius:16px;
  padding:28px;
  text-align:center;
  background:#f8fbff;
  cursor:pointer;
  width:100%;
}
.exames-upload-box:hover{
  background:#eef5ff;
}
.exames-upload-icon{
  font-size:36px;
  margin-bottom:8px;
}
.exames-upload-title{
  font-weight:700;
  color:#334155;
}
.exames-upload-sub{
  margin-top:6px;
  font-size:12px;
  color:#94a3b8;
}


/* EXAMES FIX DEFINITIVO */
.exames-page{padding:16px 0;}
.exames-actions-bar{display:flex;justify-content:flex-end;margin-bottom:16px;}
.exames-section{background:#fff;border:1px solid #e5eaf2;border-radius:16px;padding:18px;margin-bottom:18px;box-shadow:0 2px 10px rgba(15,23,42,.04);}
.exames-section-title{font-size:15px;font-weight:800;color:#0f172a;margin-bottom:14px;}
.exames-empty{text-align:center;color:#94a3b8;padding:22px;font-size:14px;}
.exames-upload-box{display:block;border:2px dashed #2563eb;border-radius:16px;padding:28px;text-align:center;background:#f8fbff;cursor:pointer;width:100%;box-sizing:border-box;}
.exames-upload-box input{display:none;}
.exames-upload-icon{font-size:36px;margin-bottom:8px;}
.exames-upload-title{font-weight:700;color:#334155;}
.exames-upload-sub{margin-top:6px;font-size:12px;color:#94a3b8;}


/* VAGAS DO DIA */
.vagas-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(135px,1fr));
  gap:10px;
}
.vaga-card{
  border-radius:12px;
  padding:12px;
  border:1px solid #e2e8f0;
  background:#fff;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.vaga-card strong{
  font-size:16px;
  color:#0f172a;
}
.vaga-card span{
  font-size:12px;
  font-weight:800;
}
.vaga-card small{
  font-size:11px;
  color:#64748b;
}
.vaga-livre{
  border-color:#bbf7d0;
  background:#f0fdf4;
}
.vaga-livre span{color:#15803d;}
.vaga-ocupada{
  border-color:#fecaca;
  background:#fef2f2;
}
.vaga-ocupada span{color:#b91c1c;}
.vaga-bloqueada{
  border-color:#fde68a;
  background:#fffbeb;
}
.vaga-bloqueada span{color:#b45309;}


/* INDICADORES SEGUROS DE VAGAS NO CALENDÁRIO */
.cal-vaga-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:6px;
  padding:3px 7px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  line-height:1.2;
  white-space:nowrap;
}
.dia-com-vaga{background:#dcfce7;color:#15803d;}
.dia-lotado{background:#fee2e2;color:#b91c1c;}
.dia-bloqueado{background:#fef3c7;color:#b45309;}
.dia-sem-horario{background:#e2e8f0;color:#64748b;}


/* CALENDÁRIO COM STATUS DE VAGAS */
.cal-dia-livre{
  background:#dbeafe !important;
  border:2px solid #60a5fa !important;
}
.cal-dia-livre:hover{
  background:#bfdbfe !important;
}

.cal-dia-lotado{
  background:#fee2e2 !important;
  border:2px solid #f87171 !important;
}

.cal-dia-bloqueado{
  background:#fef3c7 !important;
  border:2px solid #fbbf24 !important;
}

.cal-vagas-label{
  margin-top:6px;
  font-size:10px;
  font-weight:800;
  text-align:center;
  border-radius:999px;
  padding:2px 6px;
  background:#eff6ff;
  color:#2563eb;
}


/* CALENDÁRIO STATUS DE VAGAS - FINAL */
.cal-dia-livre{background:#dbeafe!important;border:2px solid #60a5fa!important;}
.cal-dia-livre:hover{background:#bfdbfe!important;}
.cal-dia-lotado{background:#fee2e2!important;border:2px solid #f87171!important;}
.cal-dia-bloqueado{background:#fef3c7!important;border:2px solid #fbbf24!important;}
.cal-dia-sem-horario{background:#f1f5f9!important;border:1px solid #cbd5e1!important;}
.cal-dia-poucas-vagas{background:#fef3c7!important;border:2px solid #fbbf24!important;}
.cal-dia-poucas-vagas:hover{background:#fde68a!important;}

.cal-vagas-label{
  margin-top:6px;
  font-size:10px;
  font-weight:800;
  text-align:center;
  border-radius:999px;
  padding:2px 6px;
  background:#eff6ff;
  color:#2563eb;
}


/* CORREÇÃO MENU/BOTÕES */
.sidebar-footer{
  margin-top:auto;
  padding:14px;
  border-top:1px solid rgba(255,255,255,.12);
}
.sidebar-footer .btn{
  display:flex;
  align-items:center;
  gap:8px;
}
.tbl-head .btn,
.modal-footer .btn,
.exame-actions .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}


/* REMOVER SAIR DO TOPO */
.header button[onclick="logout()"],
.topbar button[onclick="logout()"],
.hdr button[onclick="logout()"],
.header .logout,
.topbar .logout,
.hdr .logout{
  display:none!important;
}


/* LOGOUT FINAL */
.btn-logout,
.header-right > button[onclick*="Logout"],
.header-right > button[onclick*="logout"],
.header-right > button[onclick*="confirmarLogout"]{
  display:none!important;
}
.sidebar-footer{
  margin-top:auto;
  padding:14px;
  border-top:1px solid rgba(255,255,255,.12);
}
.sidebar-footer .btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}


/* AGENDA PEC / e-SUS - layout final */
.agenda-pec-wrap{
  display:grid;
  grid-template-columns:minmax(360px,1.1fr) minmax(420px,1.3fr);
  gap:18px;
  align-items:start;
}
.agenda-pec-card{
  background:#fff;
  border:1px solid #e5eaf2;
  border-radius:16px;
  box-shadow:0 2px 10px rgba(15,23,42,.04);
  overflow:hidden;
}
.agenda-pec-head{
  padding:14px 16px;
  border-bottom:1px solid #eef2f7;
  background:#f8fafc;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.agenda-pec-title{
  font-size:15px;
  font-weight:800;
  color:#0f172a;
}
.agenda-pec-body{
  padding:16px;
}
.agenda-dia-painel{
  min-height:420px;
}
.agenda-dia-resumo{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:14px;
}
.agenda-dia-lista{
  display:grid;
  gap:10px;
}
.agenda-slot{
  display:grid;
  grid-template-columns:70px 1fr auto;
  gap:10px;
  align-items:center;
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:10px;
  background:#fff;
}
.agenda-slot.livre{
  background:#eff6ff;
  border-color:#93c5fd;
}
.agenda-slot.ocupado{
  background:#fff7ed;
  border-color:#fdba74;
}
.agenda-slot.bloqueado{
  background:#fef2f2;
  border-color:#fca5a5;
}
.agenda-slot-hora{
  font-weight:900;
  color:#0f172a;
  font-size:15px;
}
.agenda-slot-info{
  font-size:13px;
  color:#334155;
}
.agenda-slot-info small{
  display:block;
  color:#64748b;
  margin-top:2px;
}
.agenda-cal-dia{
  cursor:pointer;
  transition:.15s;
}
.agenda-cal-dia:hover{
  transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(37,99,235,.16);
}
.agenda-dia-selecionado{
  outline:3px solid rgba(37,99,235,.35)!important;
}
@media(max-width:1100px){
  .agenda-pec-wrap{grid-template-columns:1fr;}
}


/* AGENDA MODELO PEC/e-SUS - FINAL */
.ag-pec{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:16px;
  min-height:calc(100vh - 120px);
}
.ag-pec-left,
.ag-pec-main{
  background:#fff;
  border:1px solid #d9dee8;
  border-radius:4px;
}
.ag-pec-left{
  padding:12px;
}
.ag-pec-main{
  overflow:hidden;
}
.ag-pec-cal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:14px;
}
.ag-pec-cal-head button{
  border:0;
  background:#fff;
  cursor:pointer;
  font-size:20px;
  padding:4px 8px;
}
.ag-pec-hoje{
  border:1px solid #2563eb!important;
  color:#2563eb!important;
  background:#fff!important;
  border-radius:4px;
  font-weight:700;
  font-size:12px!important;
}
.ag-pec-mes{
  font-weight:800;
  color:#111827;
}
.ag-pec-week{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:2px;
  font-size:12px;
  font-weight:800;
  text-align:center;
  color:#111827;
  margin-bottom:8px;
}
.ag-pec-days{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:2px;
}
.ag-pec-day{
  min-height:34px;
  border-radius:4px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  cursor:pointer;
  position:relative;
  border:1px solid transparent;
}
.ag-pec-day:hover{
  border-color:#2563eb;
}
.ag-pec-day.other{
  color:#9ca3af;
}
.ag-pec-day.selected{
  color:#0b57d0;
  font-weight:900;
  border-color:#0b57d0;
}
.ag-pec-day.has-free{
  background:#dbeafe;
}
.ag-pec-day.few-free{
  background:#fef3c7;
}
.ag-pec-day.full{
  background:#fee2e2;
}
.ag-pec-day.closed{
  background:#f1f5f9;
  color:#94a3b8;
}
.ag-pec-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  position:absolute;
  bottom:3px;
  left:50%;
  transform:translateX(-50%);
  background:#2563eb;
}
.ag-pec-top{
  border-bottom:1px solid #d9dee8;
  padding:12px 16px;
}
.ag-pec-title-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.ag-pec-title-row button{
  border:0;
  background:#fff;
  cursor:pointer;
  font-size:22px;
  color:#6b7280;
}
.ag-pec-title{
  font-size:18px;
  font-weight:900;
  color:#111827;
}
.ag-pec-filter{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:8px;
  align-items:center;
}
.ag-pec-search{
  height:32px;
  border:1px solid #9ca3af;
  border-radius:0;
  padding:0 10px;
}
.ag-pec-select{
  height:32px;
  border:1px solid #9ca3af;
  border-radius:0;
  padding:0 10px;
  background:#fff;
}
.ag-pec-tools{
  display:flex;
  gap:10px;
  font-size:20px;
  color:#6b7280;
}
.ag-pec-body{
  padding:14px 16px;
}
.ag-pec-empty{
  text-align:center;
  font-weight:800;
  padding:22px;
  color:#111827;
}
.ag-pec-summary{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.ag-pec-list{
  display:grid;
  gap:8px;
}
.ag-pec-slot{
  display:grid;
  grid-template-columns:72px 1fr auto;
  align-items:center;
  gap:10px;
  border:1px solid #e5e7eb;
  padding:10px;
  border-radius:4px;
}
.ag-pec-slot.free{
  background:#eff6ff;
  border-color:#93c5fd;
}
.ag-pec-slot.busy{
  background:#fff7ed;
  border-color:#fdba74;
}
.ag-pec-slot.blocked{
  background:#fef2f2;
  border-color:#fca5a5;
}
.ag-pec-hour{
  font-weight:900;
  color:#111827;
}
.ag-pec-info strong{
  display:block;
  color:#111827;
}
.ag-pec-info small{
  color:#64748b;
}
@media(max-width:900px){
  .ag-pec{grid-template-columns:1fr;}
}


/* AGENDA TOOLS AJUSTADAS */
.ag-pec-tools{
  display:flex;
  gap:8px;
  align-items:center;
}
.ag-pec-tools .btn{
  font-size:12px;
  height:32px;
}


/* BLOQUEIO MÊS - SELECT COMPACTO */
.agenda-config-grid-mes{
  display:grid!important;
  grid-template-columns:220px 170px 150px 170px!important;
  gap:10px!important;
  align-items:end!important;
}

#cfg-mes-med{
  width:220px!important;
  max-width:300px!important;
}


/* CORREÇÃO BLOQUEIO DIA/PERÍODO/HORÁRIO */
.agenda-config-grid-bloqueio{
  display:grid!important;
  grid-template-columns:220px 150px 105px 105px minmax(220px,1fr) 110px!important;
  gap:10px!important;
  align-items:end!important;
  width:100%!important;
}

.agenda-config-grid-bloqueio .f-col{
  min-width:0!important;
}

.agenda-config-grid-bloqueio .sinp,
.agenda-config-grid-bloqueio .ssel{
  width:100%!important;
}

.agenda-config-grid-bloqueio .btn{
  height:42px!important;
}

.agenda-unblock-prof{
  margin-top:8px;
}

.agenda-unblock-prof .btn{
  width:140px!important;
  height:34px!important;
  font-size:12px!important;
}

@media(max-width:900px){
  .agenda-config-grid-bloqueio{
    grid-template-columns:1fr!important;
  }
}


/* CONFIGURAÇÕES DA AGENDA - LAYOUT LIMPO FINAL */
.modal.agenda-config-modal{
  width:94vw!important;
  max-width:1040px!important;
}

.agenda-config-wrap{
  display:grid!important;
  gap:18px!important;
}

.agenda-config-section{
  background:#fff!important;
  border:1px solid #e5e7eb!important;
  border-radius:14px!important;
  overflow:hidden!important;
}

.agenda-config-section-head{
  padding:14px 16px!important;
  border-bottom:1px solid #eef2f7!important;
  font-weight:900!important;
  color:#0f172a!important;
  font-size:15px!important;
}

.agenda-config-section-body{
  padding:16px!important;
}

.agenda-config-mes-grid{
  display:grid!important;
  grid-template-columns:230px 170px 150px 170px!important;
  gap:12px!important;
  align-items:end!important;
}


.agenda-config-horarios-top{
  display:grid!important;
  grid-template-columns:230px 150px!important;
  gap:12px!important;
  align-items:end!important;
  margin-bottom:14px!important;
}

.agenda-config-wrap .f-col{
  min-width:0!important;
}

.agenda-config-wrap .sinp,
.agenda-config-wrap .ssel{
  width:100%!important;
  min-width:0!important;
}

.agenda-config-unblock{
  margin-top:8px!important;
}

.agenda-config-unblock .btn{
  width:130px!important;
  height:34px!important;
  font-size:12px!important;
}

.agenda-config-help{
  margin-top:10px!important;
  color:#64748b!important;
  font-size:12px!important;
}

@media(max-width:1050px){
  .agenda-config-mes-grid,
  .agenda-config-bloqueio-grid,
  .agenda-config-horarios-top{
    grid-template-columns:1fr 1fr!important;
  }
}

@media(max-width:700px){
  .agenda-config-mes-grid,
  .agenda-config-bloqueio-grid,
  .agenda-config-horarios-top{
    grid-template-columns:1fr!important;
  }
}


/* RELATÓRIOS - REORGANIZAÇÃO */
.relatorios-page{
  display:grid;
  gap:18px;
}

.rel-cards{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(180px,1fr))!important;
  gap:16px!important;
}

.rel-card{
  min-height:120px!important;
  padding:18px!important;
  border-radius:18px!important;
}

.rel-export{
  padding:18px!important;
  border-radius:18px!important;
}

.rel-export-filters{
  display:grid!important;
  grid-template-columns:220px 220px 180px 180px!important;
  gap:12px!important;
  margin-bottom:16px!important;
}

.rel-export-actions{
  display:grid!important;
  grid-template-columns:repeat(4,220px)!important;
  gap:12px!important;
}

.rel-graficos{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:18px!important;
}

.rel-grafico-card{
  min-height:320px!important;
  border-radius:18px!important;
}

.rel-grafico-card canvas{
  max-height:240px!important;
}

@media(max-width:1200px){
  .rel-cards{
    grid-template-columns:repeat(2,1fr)!important;
  }

  .rel-export-filters{
    grid-template-columns:1fr 1fr!important;
  }

  .rel-export-actions{
    grid-template-columns:1fr 1fr!important;
  }

  .rel-graficos{
    grid-template-columns:1fr!important;
  }
}

@media(max-width:700px){
  .rel-cards,
  .rel-export-filters,
  .rel-export-actions{
    grid-template-columns:1fr!important;
  }
}


/* BLOQUEIO DIA/PERÍODO/HORÁRIO - ALINHADO FINAL */
.agenda-config-bloqueio-grid{
  display:grid!important;
  grid-template-columns:280px 190px 150px 150px!important;
  gap:14px!important;
  align-items:end!important;
  width:max-content!important;
  max-width:100%!important;
}

.agenda-config-bloqueio-actions{
  display:grid!important;
  grid-template-columns:498px 150px 150px!important;
  gap:14px!important;
  align-items:end!important;
  margin-top:14px!important;
  width:max-content!important;
  max-width:100%!important;
}

.agenda-config-bloqueio-grid .sinp,
.agenda-config-bloqueio-grid .ssel,
.agenda-config-bloqueio-actions .sinp{
  width:100%!important;
}

.agenda-config-bloqueio-actions .btn{
  width:100%!important;
  height:48px!important;
}

@media(max-width:900px){
  .agenda-config-bloqueio-grid,
  .agenda-config-bloqueio-actions{
    grid-template-columns:1fr!important;
    width:100%!important;
  }
}


/* AGENDA PRINCIPAL - BUSCA PROFISSIONAL LARGA FINAL */
.ag-pec-main{
  min-width:820px!important;
}

.ag-pec-filter{
  display:grid!important;
  grid-template-columns:minmax(620px,1fr) auto!important;
  gap:14px!important;
  align-items:center!important;
}

.ag-pec-prof-wrap{
  width:100%!important;
  max-width:760px!important;
}

#agenda-pec-busca-prof{
  width:100%!important;
  min-width:620px!important;
  height:42px!important;
  font-size:14px!important;
  padding:0 14px!important;
}

.ag-pec-title{
  white-space:nowrap!important;
}

@media(max-width:1100px){
  .ag-pec-main{
    min-width:0!important;
  }

  .ag-pec-filter{
    grid-template-columns:1fr!important;
  }

  #agenda-pec-busca-prof{
    min-width:0!important;
  }

  .ag-pec-title{
    white-space:normal!important;
  }
}


/* AJUSTE PONTUAL: Queixa/Motivo e Observação na mesma linha na agenda */
.agenda-detalhes-inline{
  display:block!important;
  color:#64748b!important;
  margin-top:2px!important;
  white-space:normal!important;
}
.agenda-detalhes-inline span,
.agenda-label-inline{
  display:inline!important;
}
.agenda-label-inline{
  font-weight:800!important;
  color:#0f172a!important;
}

/* LOGIN PREMIUM COM LOGO MS - ajuste somente da tela de login */
#login-page{
  min-height:100vh!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:32px 16px!important;
  background:
    linear-gradient(120deg,rgba(241,245,249,.88),rgba(255,255,255,.76)),
    radial-gradient(circle at 20% 30%,rgba(37,99,235,.12),transparent 34%),
    radial-gradient(circle at 78% 20%,rgba(14,159,110,.10),transparent 30%),
    linear-gradient(135deg,#eef5fb 0%,#ffffff 48%,#edf7ff 100%)!important;
  position:relative!important;
  overflow:hidden!important;
}
#login-page::before{
  content:'';
  position:absolute;
  inset:0;
  background:
    linear-gradient(90deg,rgba(255,255,255,.35),rgba(255,255,255,.78)),
    repeating-linear-gradient(90deg,transparent 0 90px,rgba(15,23,42,.025) 90px 91px),
    repeating-linear-gradient(0deg,transparent 0 90px,rgba(15,23,42,.02) 90px 91px);
  pointer-events:none;
}
.login-box{
  position:relative!important;
  z-index:1!important;
  width:100%!important;
  max-width:520px!important;
  padding:44px 46px 34px!important;
  border-radius:24px!important;
  background:rgba(255,255,255,.94)!important;
  border:1px solid rgba(226,232,240,.95)!important;
  box-shadow:0 24px 80px rgba(15,23,42,.16)!important;
  backdrop-filter:blur(12px)!important;
}
.login-logo-premium{
  text-align:center!important;
  margin-bottom:28px!important;
}
.login-brand-logo{
  display:block!important;
  width:min(270px,74vw)!important;
  max-height:270px!important;
  object-fit:contain!important;
  margin:0 auto 18px!important;
  mix-blend-mode:multiply!important;
  filter:drop-shadow(0 10px 24px rgba(15,23,42,.10))!important;
}
.login-logo h1{
  margin:6px 0 0!important;
  color:#0f2a4d!important;
  font-size:25px!important;
  font-weight:900!important;
}
.login-logo p{
  color:#64748b!important;
  font-size:14px!important;
  margin-top:6px!important;
}
.inp-group label{
  color:#334155!important;
}
.inp-group input{
  height:48px!important;
  border-radius:12px!important;
  border:1.5px solid #dbe3ef!important;
  background:#fff!important;
  font-size:14px!important;
}
.inp-group input:focus{
  border-color:#0f2a4d!important;
  box-shadow:0 0 0 4px rgba(15,42,77,.08)!important;
}
.btn-enter{
  height:50px!important;
  border-radius:12px!important;
  margin-top:10px!important;
  background:linear-gradient(135deg,#071b36,#0f2a4d)!important;
  box-shadow:0 10px 24px rgba(15,42,77,.22)!important;
}
.demo-hint{
  margin-top:20px!important;
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  border-radius:14px!important;
  color:#64748b!important;
}
.demo-hint strong{color:#0f2a4d!important;}
.login-secure-note{
  margin-top:22px;
  text-align:center;
  color:#64748b;
  font-size:12.5px;
  line-height:1.5;
}
.login-secure-note strong{color:#0f2a4d;}
@media(max-width:560px){
  .login-box{padding:34px 24px 28px!important;border-radius:20px!important;}
  .login-brand-logo{width:min(220px,78vw)!important;}
}


/* LOGIN PREMIUM COM LOGO MS — ajuste somente na tela de login */
#login-page{
  min-height:100vh!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:28px!important;
  background:
    radial-gradient(circle at 15% 20%, rgba(219,234,254,.95), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(226,232,240,.9), transparent 28%),
    linear-gradient(135deg,#f8fbff 0%,#edf4fb 48%,#ffffff 100%)!important;
  position:relative!important;
  overflow:hidden!important;
}
#login-page::before{
  content:''!important;
  position:absolute!important;
  inset:0!important;
  background:
    linear-gradient(90deg,rgba(255,255,255,.28),rgba(255,255,255,.7)),
    repeating-linear-gradient(90deg,transparent 0 95px,rgba(15,23,42,.025) 95px 96px),
    repeating-linear-gradient(0deg,transparent 0 95px,rgba(15,23,42,.018) 95px 96px)!important;
  pointer-events:none!important;
}
#login-page::after{
  content:''!important;
  position:absolute!important;
  width:620px!important;
  height:620px!important;
  right:-220px!important;
  bottom:-260px!important;
  border-radius:50%!important;
  background:rgba(15,42,77,.05)!important;
  pointer-events:none!important;
}
#login-page .login-box{
  position:relative!important;
  z-index:1!important;
  width:100%!important;
  max-width:530px!important;
  padding:46px 48px 34px!important;
  border-radius:26px!important;
  background:rgba(255,255,255,.95)!important;
  border:1px solid rgba(226,232,240,.95)!important;
  box-shadow:0 30px 90px rgba(15,23,42,.16)!important;
  backdrop-filter:blur(14px)!important;
}
#login-page .login-logo{
  text-align:center!important;
  margin-bottom:28px!important;
}
#login-page .login-logo .icon{display:none!important;}
#login-page .login-brand-logo{
  display:block!important;
  width:min(292px,78vw)!important;
  max-height:292px!important;
  object-fit:contain!important;
  margin:0 auto 18px!important;
  mix-blend-mode:multiply!important;
  filter:drop-shadow(0 12px 26px rgba(15,23,42,.10))!important;
}
#login-page .login-logo h1{
  margin:8px 0 0!important;
  color:#102a4c!important;
  font-size:26px!important;
  font-weight:900!important;
  letter-spacing:-.3px!important;
}
#login-page .login-logo p{
  color:#64748b!important;
  font-size:14px!important;
  margin-top:6px!important;
}
#login-page .inp-group label{
  color:#334155!important;
  font-weight:700!important;
}
#login-page .inp-group input{
  height:50px!important;
  border-radius:13px!important;
  border:1.5px solid #dbe3ef!important;
  background:#fff!important;
  font-size:14px!important;
}
#login-page .inp-group input:focus{
  border-color:#102a4c!important;
  box-shadow:0 0 0 4px rgba(16,42,76,.08)!important;
}
#login-page .btn-enter{
  height:52px!important;
  border-radius:13px!important;
  margin-top:10px!important;
  background:linear-gradient(135deg,#071b36,#102a4c)!important;
  box-shadow:0 12px 26px rgba(15,42,77,.24)!important;
}
#login-page .btn-enter:hover{
  transform:translateY(-1px)!important;
  opacity:1!important;
}
#login-page .demo-hint{
  margin-top:20px!important;
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  border-radius:14px!important;
  color:#64748b!important;
}
#login-page .demo-hint strong{color:#102a4c!important;}
#login-page .login-secure-note{
  margin-top:22px!important;
  text-align:center!important;
  color:#64748b!important;
  font-size:12.5px!important;
  line-height:1.5!important;
}
#login-page .login-secure-note strong{color:#102a4c!important;}
@media(max-width:560px){
  #login-page{padding:16px!important;}
  #login-page .login-box{padding:34px 24px 28px!important;border-radius:22px!important;}
  #login-page .login-brand-logo{width:min(230px,82vw)!important;}
}


/* CORREÇÃO LOGIN: esconder a tela de login após entrar */
#login-page.login-hidden{display:none!important;}
#app.app-visible{display:flex!important;}
#app.app-hidden{display:none!important;}


/* AJUSTE FINAL LOGIN SEM ROLAGEM - SOMENTE TELA DE LOGIN */
#login-page{
  min-height:100vh!important;
  height:100vh!important;
  padding:10px 16px!important;
  overflow:hidden!important;
}
#login-page .login-box{
  max-width:500px!important;
  padding:24px 34px 20px!important;
  border-radius:22px!important;
  max-height:calc(100vh - 24px)!important;
  overflow:hidden!important;
}
#login-page .login-logo{
  margin-bottom:14px!important;
}
#login-page .login-brand-logo{
  width:min(320px,82vw)!important;
  max-height:240px!important;
  margin:0 auto 8px!important;
}
#login-page .login-logo h1{
  font-size:21px!important;
  margin-top:4px!important;
}
#login-page .login-logo p{
  font-size:12px!important;
  margin-top:3px!important;
}
#login-page .inp-group{
  margin-bottom:10px!important;
}
#login-page .inp-group label{
  font-size:12px!important;
  margin-bottom:4px!important;
}
#login-page .inp-group input{
  height:42px!important;
  padding:8px 12px!important;
  border-radius:10px!important;
}
#login-page .btn-enter{
  height:44px!important;
  margin-top:4px!important;
  border-radius:10px!important;
}
#login-page .demo-hint{
  margin-top:12px!important;
  padding:10px 12px!important;
  border-radius:12px!important;
  font-size:11px!important;
  line-height:1.55!important;
}
#login-page .login-secure-note{
  display:none!important;
}
@media(max-height:720px){
  #login-page .login-box{padding:18px 30px 16px!important;}
  #login-page .login-brand-logo{width:min(170px,56vw)!important;max-height:118px!important;}
  #login-page .demo-hint{font-size:10.5px!important;line-height:1.45!important;margin-top:9px!important;}
  #login-page .inp-group input{height:39px!important;}
  #login-page .btn-enter{height:41px!important;}
}
@media(max-width:560px){
  #login-page{padding:8px!important;}
  #login-page .login-box{padding:20px 20px 16px!important;max-width:94vw!important;}
  #login-page .login-brand-logo{width:min(185px,66vw)!important;max-height:130px!important;}
}


/* Login limpo sem contas de demonstração */
#login-page{overflow:hidden!important;}
#login-page .demo-hint, #login-page .login-secure-note{display:none!important;}
#login-page .login-box{padding:28px 34px 30px!important;max-width:430px!important;}
#login-page .login-logo{margin-bottom:20px!important;}
#login-page .login-brand-logo{max-width:340px!important;width:100%!important;height:auto!important;object-fit:contain!important;}
#login-page .inp-group{margin-bottom:13px!important;}
#login-page .btn-enter{margin-top:4px!important;}
@media(max-height:720px){#login-page .login-box{padding:20px 28px 22px!important;}#login-page .login-brand-logo{max-width:300px!important;}#login-page .login-logo{margin-bottom:14px!important;}}


/* CORREÇÃO LOGIN: esconder a tela de login após entrar */
#login-page.login-hidden{display:none!important;}
#app.app-visible{display:flex!important;}
#app.app-hidden{display:none!important;}


/* =========================================================
   CAMADA VISUAL PREMIUM — MODERNIZAÇÃO SEM ALTERAR A LÓGICA
   Aplicada por cima do layout atual para preservar funções.
   ========================================================= */
:root{
  --ms-bg:#f8fafc;
  --ms-bg-soft:#eef4ff;
  --ms-card:#ffffff;
  --ms-primary:#2563eb;
  --ms-primary-dark:#0f2a4d;
  --ms-success:#10b981;
  --ms-warning:#f59e0b;
  --ms-danger:#ef4444;
  --ms-text:#0f172a;
  --ms-muted:#64748b;
  --ms-border:#e2e8f0;
  --ms-shadow:0 10px 30px rgba(15,23,42,.07),0 1px 3px rgba(15,23,42,.05);
  --ms-shadow-soft:0 6px 18px rgba(15,23,42,.055);
  --ms-radius:18px;
}

html{scroll-behavior:smooth;}
body{
  font-family:'Inter','Segoe UI',Arial,sans-serif!important;
  color:var(--ms-text)!important;
  background:
    radial-gradient(circle at top left,rgba(37,99,235,.08),transparent 28%),
    linear-gradient(180deg,var(--ms-bg) 0%,var(--ms-bg-soft) 100%)!important;
}

/* Header mais limpo */
.header{
  height:66px!important;
  padding:0 28px!important;
  border-bottom:1px solid rgba(226,232,240,.85)!important;
  background:rgba(255,255,255,.88)!important;
  backdrop-filter:blur(16px)!important;
  box-shadow:0 4px 20px rgba(15,23,42,.045)!important;
}
.header-brand{
  color:var(--ms-primary-dark)!important;
  letter-spacing:-.02em!important;
}
.hbrand-dot{
  width:12px!important;
  height:12px!important;
  box-shadow:0 0 0 6px rgba(37,99,235,.10)!important;
}
.profile-chip{
  background:#f8fafc!important;
  border:1px solid var(--ms-border)!important;
  border-radius:999px!important;
  padding:6px 14px 6px 6px!important;
  box-shadow:0 2px 10px rgba(15,23,42,.035)!important;
}

/* Menu lateral SaaS premium */
.sidebar{
  width:244px!important;
  top:66px!important;
  height:calc(100vh - 66px)!important;
  min-height:calc(100vh - 66px)!important;
  background:linear-gradient(180deg,#0f172a 0%,#111c33 100%)!important;
  border-right:none!important;
  padding:18px 12px!important;
  box-shadow:8px 0 30px rgba(15,23,42,.08)!important;
}
.nav-section{
  color:rgba(255,255,255,.38)!important;
  padding:16px 12px 7px!important;
  font-size:10px!important;
}
.nav-item{
  color:rgba(255,255,255,.72)!important;
  border-left:0!important;
  border-radius:14px!important;
  margin:4px 0!important;
  padding:11px 13px!important;
  font-weight:650!important;
}
.nav-item:hover{
  background:rgba(255,255,255,.09)!important;
  color:#fff!important;
  transform:translateX(2px)!important;
}
.nav-item.active{
  background:linear-gradient(135deg,#2563eb,#1d4ed8)!important;
  color:#fff!important;
  box-shadow:0 8px 22px rgba(37,99,235,.35)!important;
}
.sidebar-footer{
  border-top:1px solid rgba(255,255,255,.10)!important;
  color:rgba(255,255,255,.45)!important;
}
.sidebar-footer .btn{
  background:rgba(255,255,255,.08)!important;
  color:#fff!important;
  border:1px solid rgba(255,255,255,.12)!important;
}

/* Conteúdo com mais respiro */
.content{
  padding:34px!important;
}
.page-title{
  font-size:28px!important;
  letter-spacing:-.04em!important;
  color:var(--ms-text)!important;
}
.page-sub{
  color:var(--ms-muted)!important;
  font-size:14px!important;
  margin-bottom:28px!important;
}

/* Cards, painéis e tabelas premium */
.scard,.panel,.tbl-wrap,.modal,.fcrd,.export-panel,.agenda-pec-card,.ag-pec-left,.ag-pec-main,.exames-section,.exame-card,.doc-card,.tl-body,.vital-card,.user-card,.atend-card{
  border-radius:var(--ms-radius)!important;
  border:1px solid rgba(226,232,240,.9)!important;
  background:rgba(255,255,255,.96)!important;
  box-shadow:var(--ms-shadow-soft)!important;
}
.scard{
  padding:22px!important;
  min-height:112px!important;
  transition:transform .18s ease, box-shadow .18s ease!important;
}
.scard:hover,.panel:hover,.fcrd:hover,.atend-card:hover{
  transform:translateY(-2px)!important;
  box-shadow:var(--ms-shadow)!important;
}
.sc-icon{
  width:52px!important;
  height:52px!important;
  border-radius:16px!important;
}
.sc-num{
  font-size:32px!important;
  letter-spacing:-.04em!important;
  color:var(--ms-text)!important;
}
.sc-lbl,.fcrd-lbl{
  color:var(--ms-muted)!important;
  font-weight:600!important;
}
.stats-grid,.panels,.fin-3,.rel-cards,.rel-graficos{
  gap:22px!important;
}
.tbl-head{
  padding:18px 22px!important;
  background:linear-gradient(180deg,#fff,#f8fafc)!important;
}
.tbl-title,.panel-title{
  color:var(--ms-text)!important;
  font-size:16px!important;
}
thead th{
  background:#f8fafc!important;
  color:#475569!important;
  font-size:11px!important;
}
tbody td{color:#334155!important;}
tbody tr:hover{background:#f8fbff!important;}

/* Botões modernos */
.btn,.btn-enter{
  border-radius:14px!important;
  font-weight:800!important;
  letter-spacing:-.01em!important;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease!important;
}
.btn:not(.btn-sm){
  min-height:42px!important;
}
.btn:hover,.btn-enter:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 8px 20px rgba(15,23,42,.12)!important;
}
.btn-blue{
  background:linear-gradient(135deg,#2563eb,#1d4ed8)!important;
}
.btn-green{
  background:linear-gradient(135deg,#10b981,#059669)!important;
}
.btn-purple{
  background:linear-gradient(135deg,#7c3aed,#6d28d9)!important;
}
.btn-danger{
  background:linear-gradient(135deg,#ef4444,#dc2626)!important;
}
.btn-outline{
  border:1.5px solid rgba(37,99,235,.35)!important;
  background:#fff!important;
  color:#1d4ed8!important;
}
.btn-ghost{
  background:#f1f5f9!important;
  color:#475569!important;
}

/* Inputs e formulários */
.sinp,.ssel,.f-col input,.f-col select,.f-col textarea,.inp-group input,.med-row input,.med-row select,.export-filters select,.export-filters input{
  border-radius:14px!important;
  border:1.5px solid #dbe3ef!important;
  background:#fff!important;
  color:#0f172a!important;
  transition:border-color .18s ease, box-shadow .18s ease!important;
}
.sinp:focus,.ssel:focus,.f-col input:focus,.f-col select:focus,.f-col textarea:focus,.inp-group input:focus,.med-row input:focus,.med-row select:focus{
  border-color:#2563eb!important;
  box-shadow:0 0 0 4px rgba(37,99,235,.10)!important;
}
.f-col label,.inp-group label{
  color:#334155!important;
  font-weight:750!important;
}

/* Agenda mais moderna */
.ag-pec{
  gap:20px!important;
}
.ag-pec-left,.ag-pec-main{
  border-radius:20px!important;
  overflow:hidden!important;
}
.ag-pec-top{
  background:linear-gradient(180deg,#fff,#f8fafc)!important;
  border-bottom:1px solid #e2e8f0!important;
  padding:16px 18px!important;
}
.ag-pec-title{
  font-size:21px!important;
  letter-spacing:-.04em!important;
}
.ag-pec-day{
  border-radius:12px!important;
  transition:.18s ease!important;
}
.ag-pec-day:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 5px 12px rgba(37,99,235,.16)!important;
}
.ag-pec-day.selected{
  background:#2563eb!important;
  color:#fff!important;
  border-color:#2563eb!important;
}
.ag-pec-slot,.agenda-slot{
  border-radius:16px!important;
  border:1px solid rgba(226,232,240,.95)!important;
  box-shadow:0 4px 14px rgba(15,23,42,.045)!important;
  transition:.18s ease!important;
}
.ag-pec-slot:hover,.agenda-slot:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 10px 24px rgba(15,23,42,.08)!important;
}
.ag-pec-slot.free,.agenda-slot.livre{
  background:#eff6ff!important;
  border-color:#bfdbfe!important;
}
.ag-pec-slot.busy,.agenda-slot.ocupado{
  background:#fff7ed!important;
  border-color:#fed7aa!important;
}
.ag-pec-slot.blocked,.agenda-slot.bloqueado{
  background:#fef2f2!important;
  border-color:#fecaca!important;
}

/* Prontuário */
.pront-hero{
  border-radius:24px!important;
  background:linear-gradient(135deg,#0f2a4d,#2563eb 58%,#10b981)!important;
  box-shadow:0 18px 40px rgba(37,99,235,.20)!important;
}
.pront-tabs{
  background:#fff!important;
  border-radius:16px!important;
  padding:6px!important;
  border:1px solid #e2e8f0!important;
}
.ptab{
  border-radius:12px!important;
  border-bottom:0!important;
  margin-bottom:0!important;
}
.ptab.active{
  background:#eff6ff!important;
  color:#1d4ed8!important;
}

/* Modal e notificações */
.modal-bg{
  backdrop-filter:blur(8px)!important;
  background:rgba(15,23,42,.42)!important;
}
.modal{
  padding:30px!important;
  box-shadow:0 30px 80px rgba(15,23,42,.22)!important;
}
.modal-title{
  font-size:19px!important;
  color:#0f172a!important;
}
.notif-dropdown{
  border-radius:20px!important;
  border:1px solid #e2e8f0!important;
  box-shadow:0 20px 60px rgba(15,23,42,.18)!important;
}
.toast{
  border-radius:16px!important;
  box-shadow:0 16px 35px rgba(15,23,42,.20)!important;
}

/* Exames/upload */
.exam-upload,.exames-upload-box{
  border-radius:22px!important;
  border-color:#93c5fd!important;
  background:linear-gradient(180deg,#f8fbff,#eff6ff)!important;
}
.exam-upload:hover,.exames-upload-box:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 10px 24px rgba(37,99,235,.12)!important;
}

/* Login preservado, só refina o cartão */
#login-page .login-box{
  box-shadow:0 30px 90px rgba(15,23,42,.18)!important;
}
#login-page .btn-enter{
  background:linear-gradient(135deg,#071b36,#0f2a4d,#1d4ed8)!important;
}

/* Responsivo */
@media(max-width:768px){
  .content{padding:22px!important;}
  .page-title{font-size:23px!important;}
  .header{padding:0 16px!important;}
}

/* AJUSTE FINAL: LOGO MAIOR SEM QUEBRAR LOGIN */
#login-page{
  height:100vh!important;
  min-height:100vh!important;
  overflow:hidden!important;
}

#login-page .login-box{
  max-width:430px!important;
  padding:22px 32px 22px!important;
  max-height:calc(100vh - 20px)!important;
  overflow:hidden!important;
}

#login-page .login-logo{
  margin-bottom:10px!important;
}

#login-page .login-brand-logo{
  width:300px!important;
  height:auto!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:contain!important;
  margin:0 auto 6px!important;
  display:block!important;
}

@media(max-height:720px){
  #login-page .login-brand-logo{
    width:260px!important;
  }
  #login-page .login-box{
    padding:18px 30px 18px!important;
  }
}

@media(max-width:560px){
  #login-page .login-brand-logo{
    width:250px!important;
    max-width:90vw!important;
  }
  #login-page .login-box{
    max-width:94vw!important;
    padding:20px 22px 20px!important;
  }
}


/* AGENDA MÉDICA NOVA */
.agenda-med-toolbar-nova{
  display:grid!important;
  grid-template-columns:220px minmax(280px,460px)!important;
  gap:14px!important;
  margin:16px 0 20px!important;
  align-items:end!important;
}

.agenda-med-toolbar-nova label{
  display:block!important;
  font-size:12px!important;
  font-weight:800!important;
  color:#334155!important;
  margin-bottom:6px!important;
}

.agenda-med-lista-nova{
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
}

.agenda-med-row-nova{
  background:#fff!important;
  border:1px solid #e5e7eb!important;
  border-radius:16px!important;
  padding:14px!important;
  display:grid!important;
  grid-template-columns:80px 1fr auto!important;
  gap:14px!important;
  align-items:center!important;
  box-shadow:0 2px 10px rgba(15,23,42,.035)!important;
}

.agenda-med-row-nova.livre{
  border-left:4px solid #3b82f6!important;
  background:#eff6ff!important;
}

.agenda-med-row-nova.ocupado{
  border-left:4px solid #10b981!important;
}

.agenda-med-hora-nova{
  font-weight:900!important;
  color:#0f172a!important;
  font-size:15px!important;
}

.agenda-med-info-nova strong{
  display:block!important;
  color:#111827!important;
  font-size:14px!important;
}

.agenda-med-info-nova small{
  color:#64748b!important;
  font-size:12px!important;
}

.agenda-med-actions-nova{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}

.agenda-med-final{
  display:flex!important;
  justify-content:flex-end!important;
}

@media(max-width:900px){
  .agenda-med-toolbar-nova{
    grid-template-columns:1fr!important;
  }

  .agenda-med-row-nova{
    grid-template-columns:1fr!important;
  }

  .agenda-med-actions-nova{
    justify-content:flex-start!important;
  }
}


/* FILA / ATENDIMENTO NOVA */
.fila-nova-top{
  margin:16px 0 20px!important;
  display:flex!important;
  gap:10px!important;
  flex-wrap:wrap!important;
}

#fila-nova-encaixe{
  min-height:44px!important;
  border-radius:12px!important;
  padding:0 22px!important;
  font-weight:900!important;
}

.fila-nova-stats{
  grid-template-columns:repeat(3,minmax(180px,1fr))!important;
}

.fila-nova-lista{
  display:flex!important;
  flex-direction:column!important;
  gap:14px!important;
  margin-top:18px!important;
}

.fila-nova-card{
  background:#fff!important;
  border:1px solid #e5e7eb!important;
  border-radius:22px!important;
  padding:22px 26px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:18px!important;
  box-shadow:0 3px 14px rgba(15,23,42,.04)!important;
}

.fila-nova-card.aguardando{
  border-left:4px solid #f59e0b!important;
}

.fila-nova-card.atendendo{
  border-left:4px solid #10b981!important;
  background:#f0fdf4!important;
}

.fila-nova-left{
  display:flex!important;
  align-items:center!important;
  gap:16px!important;
  min-width:0!important;
  flex:1!important;
}

.fila-nova-avatar{
  width:58px!important;
  height:58px!important;
  border-radius:50%!important;
  background:linear-gradient(135deg,#2563eb,#0d9488)!important;
  color:#fff!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-weight:900!important;
  font-size:20px!important;
  flex-shrink:0!important;
}

.fila-nova-info{
  min-width:0!important;
}

.fila-nova-nome{
  font-size:17px!important;
  font-weight:900!important;
  color:#0f172a!important;
}

.fila-nova-sub{
  margin-top:5px!important;
  font-size:13px!important;
  color:#64748b!important;
}

.fila-nova-tags{
  margin-top:9px!important;
  display:flex!important;
  gap:7px!important;
  flex-wrap:wrap!important;
}

.fila-nova-actions{
  display:flex!important;
  gap:9px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}

.fila-nova-empty{
  padding:26px!important;
  background:#fff!important;
  border:1px dashed #cbd5e1!important;
  border-radius:16px!important;
  color:#94a3b8!important;
  text-align:center!important;
  font-size:14px!important;
}

.fila-nova-finalizados{
  margin-top:22px!important;
}

.fila-enc-sugestoes{
  display:grid!important;
  gap:6px!important;
  margin-top:6px!important;
}

.fila-enc-sugestoes button{
  text-align:left!important;
  border:1px solid #e2e8f0!important;
  background:#fff!important;
  border-radius:10px!important;
  padding:9px 12px!important;
  cursor:pointer!important;
  color:#0f172a!important;
}

.fila-enc-sugestoes button:hover{
  background:#f8fafc!important;
}

@media(max-width:900px){
  .fila-nova-stats{
    grid-template-columns:1fr!important;
  }

  .fila-nova-card{
    flex-direction:column!important;
    align-items:flex-start!important;
  }

  .fila-nova-actions{
    justify-content:flex-start!important;
  }
}


/* AGENDA MÉDICA IGUAL A AGENDA DE PROCEDIMENTOS */
.ag-med-pec .ag-pec-actions{
  display:flex!important;
  gap:6px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}

.ag-med-pec .ag-pec-slot{
  grid-template-columns:72px 1fr auto!important;
}

.ag-med-pec .ag-pec-search{
  width:100%!important;
  min-width:0!important;
}

.ag-med-pec .ag-pec-filter{
  display:grid!important;
  grid-template-columns:minmax(320px,1fr) 170px auto!important;
  gap:10px!important;
  align-items:center!important;
}

.ag-med-pec .ag-pec-prof-wrap{
  max-width:none!important;
  width:100%!important;
}

.ag-pec-actions-final{
  display:flex!important;
  justify-content:flex-end!important;
}

@media(max-width:1100px){
  .ag-med-pec .ag-pec-filter{
    grid-template-columns:1fr!important;
  }

  .ag-med-pec .ag-pec-slot{
    grid-template-columns:1fr!important;
  }

  .ag-med-pec .ag-pec-actions{
    justify-content:flex-start!important;
  }
}


/* AGENDA — TOPO LIMPO */
.ag-pec-filter-clean{
  grid-template-columns: minmax(320px, 1fr)!important;
}

.ag-pec-filter-clean .ag-pec-prof-wrap{
  max-width:760px!important;
  width:100%!important;
}

.ag-pec-filter-clean .ag-pec-search{
  width:100%!important;
}

.ag-pec-tools{
  display:none!important;
}

#agenda-med-pec-data,
#agenda-proc-nova-data{
  display:none!important;
}


/* CORES CORRETAS DO CALENDÁRIO DE VAGAS */
.ag-pec-day.has-free{
  background:#dbeafe!important;
  border-color:#60a5fa!important;
  color:#0f172a!important;
}

.ag-pec-day.few-free{
  background:#fef3c7!important;
  border-color:#f59e0b!important;
  color:#713f12!important;
}

.ag-pec-day.full{
  background:#fee2e2!important;
  border-color:#ef4444!important;
  color:#991b1b!important;
}

.ag-pec-day.selected{
  outline:3px solid rgba(37,99,235,.35)!important;
  font-weight:900!important;
}


/* UNIFICAÇÃO FINAL DAS AGENDAS */
.ag-pec-filter-clean{
  grid-template-columns:minmax(320px,760px)!important;
}

.ag-pec-filter-clean .ag-pec-prof-wrap,
.ag-pec-filter-clean .ag-pec-search{
  width:100%!important;
  max-width:760px!important;
  min-width:0!important;
}

.ag-pec-actions{
  display:flex!important;
  gap:6px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}

.ag-pec-actions-final{
  display:flex!important;
  justify-content:flex-end!important;
}

.ag-pec-tools,
#agenda-med-pec-data,
#agenda-proc-nova-data{
  display:none!important;
}

.ag-pec-day.has-free{
  background:#dbeafe!important;
  border-color:#60a5fa!important;
}

.ag-pec-day.few-free{
  background:#fef3c7!important;
  border-color:#f59e0b!important;
}

.ag-pec-day.full{
  background:#fee2e2!important;
  border-color:#ef4444!important;
}

@media(max-width:1100px){
  .ag-pec-filter-clean{
    grid-template-columns:1fr!important;
  }

  .ag-pec-actions{
    justify-content:flex-start!important;
  }
}


/* AGENDA — HORÁRIO PROFISSIONAL E DURAÇÃO */
.ag-pec-slot.blocked-by-duration{
  background:#f1f5f9!important;
  border-color:#cbd5e1!important;
  opacity:.95!important;
}

.ag-pec-slot.blocked-by-duration .ag-pec-hour{
  color:#64748b!important;
}

.ag-pec-slot.blocked-by-duration .ag-pec-info strong{
  color:#475569!important;
}

.ag-pec-slot.blocked-by-duration .ag-pec-info small{
  color:#64748b!important;
}


/* CORES FINAIS DO CALENDÁRIO POR VAGAS */
.ag-pec-day.has-free,
.ag-pec-day.cal-dia-livre{
  background:#dbeafe!important;
  border:2px solid #60a5fa!important;
  color:#0f172a!important;
}

.ag-pec-day.few-free,
.ag-pec-day.cal-dia-poucas-vagas{
  background:#fef3c7!important;
  border:2px solid #f59e0b!important;
  color:#713f12!important;
}

.ag-pec-day.full,
.ag-pec-day.cal-dia-lotado{
  background:#fee2e2!important;
  border:2px solid #ef4444!important;
  color:#991b1b!important;
}

.ag-pec-day.selected{
  outline:3px solid rgba(37,99,235,.45)!important;
  font-weight:900!important;
}




/* AGENDA TOOLS E ATENDIDOS INTEGRADO */
.agenda-tools-restaurados{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
  margin-top:10px!important;
}

.fila-atendidos-hoje-integrado{
  margin-top:22px!important;
}

.fila-section-title{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin:0 0 12px!important;
  padding:0 2px!important;
  color:#0f172a!important;
  font-weight:900!important;
  font-size:16px!important;
}

.fila-section-title small{
  font-size:12px!important;
  color:#64748b!important;
  font-weight:700!important;
}

.fila-nova-card.realizado{
  border-left:4px solid #10b981!important;
  background:#f0fdf4!important;
  opacity:.98!important;
}

.fila-nova-card.realizado .fila-nova-avatar{
  background:linear-gradient(135deg,#10b981,#059669)!important;
}


/* AGENDA — BOTÕES AO LADO DO PROFISSIONAL + DIAS SEM AGENDA */
.ag-pec-filter-com-tools{
  display:grid!important;
  grid-template-columns:minmax(320px,1fr) auto!important;
  gap:10px!important;
  align-items:center!important;
}

.ag-pec-filter-com-tools .agenda-tools-restaurados{
  display:flex!important;
  gap:8px!important;
  align-items:center!important;
  justify-content:flex-end!important;
  margin:0!important;
  white-space:nowrap!important;
}

.agenda-btn-print-icon{
  width:38px!important;
  min-width:38px!important;
  height:38px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:18px!important;
  border-color:#94a3b8!important;
  color:#0f172a!important;
  background:#fff!important;
}

.agenda-btn-config-visible{
  width:38px!important;
  min-width:38px!important;
  height:38px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:18px!important;
  background:#2563eb!important;
  color:#fff!important;
  border:1px solid #1d4ed8!important;
  box-shadow:0 4px 12px rgba(37,99,235,.25)!important;
}

.ag-pec-day.sem-agenda-profissional{
  background:#e5e7eb!important;
  border:2px solid #9ca3af!important;
  color:#6b7280!important;
  opacity:.8!important;
}

.ag-pec-day.sem-agenda-profissional .ag-pec-dot{
  background:#9ca3af!important;
}

@media(max-width:900px){
  .ag-pec-filter-com-tools{
    grid-template-columns:1fr!important;
  }

  .ag-pec-filter-com-tools .agenda-tools-restaurados{
    justify-content:flex-start!important;
  }
}


/* MENU PACIENTES NOVO */
.paciente-topo-novo{
  display:grid!important;
  grid-template-columns:1fr 180px auto!important;
  gap:12px!important;
  align-items:center!important;
  margin:16px 0 18px!important;
}

.paciente-stats-novo{
  grid-template-columns:repeat(3,minmax(160px,1fr))!important;
  margin-bottom:18px!important;
}

.paciente-lista-novo{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
}

.paciente-card-novo{
  background:#fff!important;
  border:1px solid #e5e7eb!important;
  border-radius:20px!important;
  padding:18px 20px!important;
  display:flex!important;
  align-items:center!important;
  gap:16px!important;
  box-shadow:0 3px 14px rgba(15,23,42,.04)!important;
}

.paciente-avatar-novo{
  width:58px!important;
  height:58px!important;
  border-radius:18px!important;
  background:linear-gradient(135deg,#2563eb,#0d9488)!important;
  color:#fff!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-weight:900!important;
  font-size:20px!important;
  flex-shrink:0!important;
}

.paciente-info-novo{
  flex:1!important;
  min-width:0!important;
}

.paciente-nome-novo{
  font-size:17px!important;
  font-weight:900!important;
  color:#0f172a!important;
  margin-bottom:5px!important;
}

.paciente-meta-novo{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:10px 16px!important;
  color:#64748b!important;
  font-size:12px!important;
}

.paciente-tags-novo{
  display:flex!important;
  gap:7px!important;
  flex-wrap:wrap!important;
  margin-top:9px!important;
}

.paciente-actions-novo{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}

.icon-only{
  width:36px!important;
  height:36px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:16px!important;
}

.paciente-empty-novo{
  background:#fff!important;
  border:1px dashed #cbd5e1!important;
  border-radius:16px!important;
  padding:28px!important;
  text-align:center!important;
  color:#94a3b8!important;
}

@media(max-width:900px){
  .paciente-topo-novo{
    grid-template-columns:1fr!important;
  }

  .paciente-stats-novo{
    grid-template-columns:1fr!important;
  }

  .paciente-card-novo{
    align-items:flex-start!important;
    flex-direction:column!important;
  }

  .paciente-actions-novo{
    justify-content:flex-start!important;
  }
}


/* MENU USUÁRIOS NOVO */
.usuario-topo-novo{
  display:grid!important;
  grid-template-columns:1fr 190px 160px auto!important;
  gap:12px!important;
  align-items:center!important;
  margin:16px 0 18px!important;
}

.usuario-stats-novo{
  grid-template-columns:repeat(3,minmax(160px,1fr))!important;
  margin-bottom:18px!important;
}

.usuario-lista-novo{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
}

.usuario-card-novo{
  background:#fff!important;
  border:1px solid #e5e7eb!important;
  border-radius:20px!important;
  padding:18px 20px!important;
  display:flex!important;
  align-items:center!important;
  gap:16px!important;
  box-shadow:0 3px 14px rgba(15,23,42,.04)!important;
}

.usuario-card-novo.inativo{
  opacity:.72!important;
  background:#f8fafc!important;
}

.usuario-avatar-novo{
  width:58px!important;
  height:58px!important;
  border-radius:18px!important;
  background:linear-gradient(135deg,#7c3aed,#2563eb)!important;
  color:#fff!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-weight:900!important;
  font-size:20px!important;
  flex-shrink:0!important;
}

.usuario-info-novo{
  flex:1!important;
  min-width:0!important;
}

.usuario-nome-novo{
  font-size:17px!important;
  font-weight:900!important;
  color:#0f172a!important;
  margin-bottom:5px!important;
}

.usuario-meta-novo{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:10px 16px!important;
  color:#64748b!important;
  font-size:12px!important;
}

.usuario-tags-novo{
  display:flex!important;
  gap:7px!important;
  flex-wrap:wrap!important;
  margin-top:9px!important;
}

.usuario-actions-novo{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}

.usuario-actions-novo button:disabled,
.usuario-topo-novo button:disabled{
  opacity:.45!important;
  cursor:not-allowed!important;
}

.usuario-empty-novo{
  background:#fff!important;
  border:1px dashed #cbd5e1!important;
  border-radius:16px!important;
  padding:28px!important;
  text-align:center!important;
  color:#94a3b8!important;
}

.usuario-alerta-novo{
  margin-top:14px!important;
}

@media(max-width:1000px){
  .usuario-topo-novo{
    grid-template-columns:1fr!important;
  }

  .usuario-stats-novo{
    grid-template-columns:1fr!important;
  }

  .usuario-card-novo{
    align-items:flex-start!important;
    flex-direction:column!important;
  }

  .usuario-actions-novo{
    justify-content:flex-start!important;
  }
}


/* FINANCEIRO / RELATÓRIOS — CARDS MODERNOS */
.financeiro-modernizado .fr-grid-3x2,
.relatorio-modernizado .fr-grid-3x2{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(180px,1fr))!important;
  gap:16px!important;
  margin:18px 0!important;
}

.financeiro-modernizado .fr-modern-card,
.relatorio-modernizado .fr-modern-card,
.financeiro-modernizado .scard,
.relatorio-modernizado .scard{
  background:linear-gradient(180deg,#ffffff,#f8fafc)!important;
  border:1px solid #e5e7eb!important;
  border-radius:22px!important;
  padding:20px!important;
  box-shadow:0 8px 24px rgba(15,23,42,.06)!important;
  min-height:118px!important;
}

.financeiro-modernizado .sc-num,
.relatorio-modernizado .sc-num{
  font-size:28px!important;
  font-weight:900!important;
  color:#0f172a!important;
}

.financeiro-modernizado .sc-lbl,
.relatorio-modernizado .sc-lbl{
  font-size:12px!important;
  color:#64748b!important;
  font-weight:700!important;
  text-transform:uppercase!important;
  letter-spacing:.04em!important;
}

.fr-export-actions{
  display:flex!important;
  gap:8px!important;
  justify-content:flex-end!important;
  margin:8px 0 14px!important;
}

.financeiro-modernizado .tbl-wrap,
.relatorio-modernizado .tbl-wrap{
  border-radius:20px!important;
  border:1px solid #e5e7eb!important;
  box-shadow:0 8px 24px rgba(15,23,42,.04)!important;
  overflow:hidden!important;
}

@media(max-width:1000px){
  .financeiro-modernizado .fr-grid-3x2,
  .relatorio-modernizado .fr-grid-3x2{
    grid-template-columns:1fr!important;
  }

  .fr-export-actions{
    justify-content:flex-start!important;
  }
}


/* FINANCEIRO ORIGINAL APROVADO */
.financeiro-cards-original{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(180px,1fr))!important;
  gap:16px!important;
  margin:18px 0 22px!important;
}

.fr-card-original{
  background:linear-gradient(180deg,#ffffff,#f8fafc)!important;
  border:1px solid #e5e7eb!important;
  border-radius:22px!important;
  padding:20px!important;
  box-shadow:0 8px 24px rgba(15,23,42,.06)!important;
  min-height:118px!important;
}

.fr-card-original .sc-num{
  font-size:28px!important;
  font-weight:900!important;
  color:#0f172a!important;
}

.fr-card-original .sc-lbl{
  font-size:12px!important;
  color:#64748b!important;
  font-weight:700!important;
  text-transform:uppercase!important;
  letter-spacing:.04em!important;
}

@media(max-width:1000px){
  .financeiro-cards-original{
    grid-template-columns:1fr!important;
  }
}


/* RELATÓRIOS — SEM VISUAL NOVO */
.relatorio-modernizado .fr-modern-card,
.relatorio-modernizado .fr-grid-3x2{
  all:unset;
}


/* FINANCEIRO — CARDS CERTOS */
.financeiro-cards-corretos{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(180px,1fr))!important;
  gap:16px!important;
  margin:18px 0 22px!important;
}

.financeiro-cards-corretos .fr-card-original{
  background:linear-gradient(180deg,#ffffff,#f8fafc)!important;
  border:1px solid #e5e7eb!important;
  border-radius:22px!important;
  padding:20px!important;
  box-shadow:0 8px 24px rgba(15,23,42,.06)!important;
  min-height:118px!important;
}

@media(max-width:1000px){
  .financeiro-cards-corretos{
    grid-template-columns:1fr!important;
  }
}


/* FINANCEIRO LIMPO — responsivo sem redimensionamento por script */
.financeiro-cards-limpo{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr))!important;
  gap:16px!important;
  width:100%!important;
}
.financeiro-cards-limpo .fcrd{
  width:100%!important;
  min-width:0!important;
}

/* AJUSTE: evita quebra dos valores nos cards do dashboard, principalmente Receita do dia */
#content .scard > div:last-child{
  min-width:0!important;
  max-width:100%!important;
}
#content .sc-num,
#content .fcrd-num{
  white-space:nowrap!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  line-height:1!important;
  font-size:clamp(24px, 2.1vw, 32px)!important;
}
