/* Dashboard independente. Escopo próprio para não alterar outros módulos. */
.crm-main.crm-main--dashboard { padding: 20px clamp(18px, 2.5vw, 36px) 40px; overflow: visible; }
.crm-dashboard { min-width: 0; --dashboard-gap: 12px; }
.crm-dashboard [hidden], .crm-dashboard-location [hidden] { display: none !important; }
.crm-dashboard h2, .crm-dashboard h3, .crm-dashboard h4, .crm-dashboard p { margin: 0; }
.crm-dashboard a { text-decoration: none; }
.crm-dashboard a:focus-visible, .crm-dashboard button:focus-visible, .crm-dashboard-location button:focus-visible, .crm-dashboard-location input:focus-visible { outline: 3px solid #8a5de6; outline-offset: 3px; }
.crm-dashboard-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--dashboard-gap); align-items: stretch; }
.crm-dashboard-hero { grid-column: span 3; min-width: 0; min-height: 168px; position: relative; isolation: isolate; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 22px; background: linear-gradient(110deg,#1e3a5f,#211f35); box-shadow: 0 18px 50px rgba(31,29,54,.14); }
.crm-dashboard-hero__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.crm-dashboard-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,rgba(0,0,0,.65),rgba(0,0,0,.15)); }
.crm-dashboard-hero::after { content: ''; width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; position: absolute; right: -120px; top: -180px; pointer-events: none; }
.crm-dashboard-hero__copy { min-height: 168px; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 30px clamp(24px,3vw,48px); color: #fff; overflow-wrap: anywhere; }
.crm-dashboard-hero h2 { font-size: clamp(24px,2.25vw,36px); line-height: 1.2; font-weight: 800; letter-spacing: -.04em; }
.crm-dashboard-hero p { margin-top: 10px; color: #f2c99f; font-size: clamp(13px,1.1vw,17px); font-weight: 600; line-height: 1.5; }
.crm-dashboard-clock { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; border: 1px solid #2c2944; border-radius: 22px; color: #fff; background: #211f35; box-shadow: 0 8px 28px rgba(31,29,54,.08); }
.crm-dashboard-clock__date { color: #b5bdd6; text-transform: uppercase; letter-spacing: .025em; font-size: 11px; line-height: 1.4; font-weight: 800; overflow-wrap: anywhere; }
.crm-dashboard-clock__time { display: flex; align-items: center; gap: 7px; margin: 8px 0 4px; font-size: clamp(23px,2.1vw,32px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.crm-dashboard-clock__time i { font-size: .83em; }
.crm-dashboard-clock__zone { color: #abb7d8; font-size: 10px; line-height: 1.4; }
.crm-dashboard-clock__location { align-self: flex-start; margin-top: 13px; padding: 0; border: 0; background: none; color: #c5c2d8; font-size: 10px; cursor: pointer; text-align: left; }
.crm-dashboard-clock__location:hover { color: #fff; text-decoration: underline; }
.crm-dashboard-stats {
    margin: 18px 0 22px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.crm-dashboard-stat {
    min-height: 116px;
    padding: 17px;
    border: 1px solid #e7e4eb;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 12px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(31,29,54,.045);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    color: inherit;
    text-decoration: none;
}
.crm-dashboard-stat:hover { border-color: #d9d4df; transform: translateY(-2px); box-shadow: 0 15px 36px rgba(31,29,54,.09); }
.crm-dashboard-stat::after { content: ""; width: 90px; height: 90px; border-radius: 50%; position: absolute; right: -43px; top: -45px; background: #f5f2ff; }
.crm-dashboard-stat__icon { width: 40px; height: 40px; grid-row: 1 / 4; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #6f56d9; background: #f0edff; font-size: 14px; }
.crm-dashboard-stat.is-attention .crm-dashboard-stat__icon { color: #df550c; background: #fff2e9; }
.crm-dashboard-stat.is-success .crm-dashboard-stat__icon { color: #2d9a69; background: #eaf8f1; }
.crm-dashboard-stat.is-warning .crm-dashboard-stat__icon { color: #b57807; background: #fff7df; }
.crm-dashboard-stat strong { font-size: 27px; line-height: 1; letter-spacing: -.04em; }
.crm-dashboard-stat span { margin-top: 6px; color: #55505e; font-size: 10px; font-weight: 800; }
.crm-dashboard-stat small { align-self: end; margin-top: 5px; color: #9893a0; font-size: 8px; }

.crm-dashboard-stat .crm-dashboard-stat__icon { display: inline-flex; align-items: center; justify-content: center; }
.crm-dashboard-stat.is-disabled { opacity: .65; }
.crm-dashboard-stat.is-disabled:hover { transform: none; }
.crm-dashboard-panels { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; align-items: stretch; margin-bottom: 24px; }
.crm-dashboard-stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.crm-dashboard-panel { min-width: 0; padding: 24px; border: 1px solid #e7e4eb; border-radius: 16px; background: #fff; box-shadow: 0 7px 28px rgba(31,29,54,.045); display: flex; flex-direction: column; }
.crm-dashboard-panel h3 { display: flex; align-items: center; gap: 9px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid #e7e4eb; font-size: 16px; line-height: 1.4; letter-spacing: -.018em; font-weight: 700; }
.crm-dashboard-panel h3 > i { flex: 0 0 auto; font-size: 17px; }
.crm-dashboard-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid #e7e4eb; }
.crm-dashboard-panel > header h3 { padding: 0; margin: 0; border: 0; }
.crm-dashboard-panel > header > a, .crm-dashboard .crm-dashboard-more { color: #2563eb; font-size: 11px; }
.crm-dashboard-panel > header > a { flex-shrink: 0; }
.crm-dashboard-panel a:hover { text-decoration: none; }
.crm-dashboard .crm-dashboard-more { display: block; margin-top: auto; padding-top: 16px; text-align: center; }
.crm-dashboard .crm-dashboard-more:hover { text-decoration: underline; }
.crm-dashboard-list { max-height: 400px; overflow-y: auto; overflow-x: hidden; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #d6d2dc transparent; }
.crm-dashboard-list.is-short { max-height: 250px; }
.crm-dashboard-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; margin: 4px 0 12px; border: 1px solid transparent; border-radius: 10px; min-width: 0; position: relative; transition: background .2s,border-color .2s; }
.crm-dashboard-row:last-child { margin-bottom: 0; }
.crm-dashboard-row:hover { background: #faf9fb; border-color: #eeeaf0; }
.crm-dashboard-thumb { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; border: 1px solid #eeeaf0; background: #faf9fb; color: #9ca3af; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.crm-dashboard-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.crm-dashboard-thumb.is-orange { background: #fff7ed; border-color: #ffedd5; }
.crm-dashboard-row__copy { flex: 1; min-width: 0; }
.crm-dashboard-row__copy strong, .crm-dashboard-row__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-dashboard-row__copy strong { font-size: 13px; font-weight: 600; line-height: 1.5; }
.crm-dashboard-row__copy small { font-size: 11px; color: #81808d; line-height: 1.5; }
.crm-dashboard-row__date { color: #9893a0; font-size: 10px; white-space: nowrap; }
.crm-dashboard-badge { display: inline-block; flex: 0 1 auto; max-width: 45%; padding: 3px 7px; border-radius: 4px; font-size: 9px; font-weight: 800; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.crm-dashboard-badge.is-waiting { background: #be123c; color: #fff; }
.crm-dashboard-badge.is-pending { background: #fde68a; color: #422006; }
.crm-dashboard-badge.is-production { background: #9333ea; color: #fff; }
.crm-dashboard-badge.is-review { background: #262626; color: #fff; }
.crm-dashboard-badge.is-success { background: #159a66; color: #fff; }
.crm-dashboard-alert { position: absolute; right: 2px; top: -3px; color: #d84b54; font-size: 10px; }
.crm-dashboard-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #d84b54; right: 3px; top: 3px; }
.crm-dashboard .is-blue { color: #3980f6; }
.crm-dashboard .is-orange { color: #df550c; }
.crm-dashboard .is-green { color: #2d9a69; }
.crm-dashboard .is-purple { color: #8a5de6; }
.crm-dashboard .is-amber { color: #ed9800; }
.crm-dashboard .is-red { color: #d84b54; }
.crm-dashboard .crm-dashboard-empty { padding: 12px 0; color: #9893a0; font-size: 12px; line-height: 1.6; }
.crm-dashboard-activity__item { display: flex; gap: 12px; padding: 12px 5px; border-bottom: 1px solid #f3f1f5; font-size: 12px; line-height: 1.5; color: #777381; border-radius: 6px; }
.crm-dashboard-activity__item:hover { background: #f6f8ff; }
.crm-dashboard-activity__item > i { margin-top: 5px; font-size: 8px; flex-shrink: 0; }
.crm-dashboard-activity__item > span { min-width: 0; overflow-wrap: anywhere; }
.crm-dashboard-activity__item b { color: #4c4757; }
.crm-dashboard-activity__item em { color: #7c788b; }
.crm-dashboard-activity__item p { margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #777381; }
.crm-dashboard-activity__item time { display: block; font-size: 10px; color: #a09aaa; margin-top: 4px; }
.crm-dashboard-publications { display: grid; gap: 18px; max-height: 650px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d6d2dc transparent; }
.crm-dashboard-publications.is-grid { grid-template-columns: repeat(3,minmax(0,1fr)); max-height: none; }
.crm-dashboard-publication { display: flex; flex-direction: column; border: 1px solid #e7e4eb; border-radius: 12px; overflow: hidden; min-width: 0; }
.crm-dashboard-publication__cover { height: 135px; background: #f7f7f9; display: flex; justify-content: center; align-items: center; position: relative; overflow: hidden; color: #c4c3cb; font-size: 30px; }
.crm-dashboard-publication__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.crm-dashboard-publication:hover .crm-dashboard-publication__cover img { transform: scale(1.025); }
.crm-dashboard-publication__cover > span { position: absolute; left: 10px; top: 10px; padding: 4px 8px; border-radius: 5px; background: rgba(255,255,255,.95); color: #4c4757; font-size: 9px; font-weight: 700; }
.crm-dashboard-publication__star { position: absolute; right: 10px; top: 10px; color: #e9a500; font-size: 15px; }
.crm-dashboard-publication__copy { padding: 14px; flex: 1; }
.crm-dashboard-publication__copy h4 { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.crm-dashboard-publication__copy p { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 9px; border-top: 1px solid #f3f1f5; font-size: 10px; color: #9893a0; }
.crm-dashboard-publication__copy p > span { color: #2563eb; }
.crm-dashboard-credit { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; padding: 16px; margin-bottom: 20px; border: 1px solid #bcebd6; border-radius: 12px; background: #eaf8f1; }
.crm-dashboard-credit small { width: 100%; font-size: 10px; text-transform: uppercase; color: #18704e; font-weight: 800; }
.crm-dashboard-credit strong { color: #2d9a69; font-size: 18px; }
.crm-dashboard-credit code { padding: 3px 7px; border: 1px solid #bcebd6; border-radius: 5px; background: #fff; font-size: 11px; overflow-wrap: anywhere; }
.crm-dashboard-credit > span { width: 100%; font-size: 11px; color: #18704e; }
.crm-dashboard-news { display: grid; gap: 12px; margin-bottom: 24px; }
.crm-dashboard-news__item { display: flex; align-items: center; gap: 15px; padding: 18px; border-radius: 14px; background: linear-gradient(110deg,#2563eb,#4338ca); }
.crm-dashboard .crm-dashboard-news__item { color: #fff; }
.crm-dashboard-news__item > i { font-size: 20px; }
.crm-dashboard-news__item > span { flex: 1; min-width: 0; }
.crm-dashboard-news__item small { display: block; color: #cbdcff; text-transform: uppercase; font-size: 10px; font-weight: 700; }
.crm-dashboard-news__item strong { display: block; margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }
.crm-dashboard-news__item > b { background: #fff; color: #2563eb; padding: 9px 14px; border-radius: 8px; font-size: 11px; white-space: nowrap; }
.crm-dashboard .crm-dashboard-warning { display: flex; align-items: flex-start; gap: 8px; padding: 12px 15px; margin-bottom: 20px; border: 1px solid #efdcac; background: #fffaf0; border-radius: 12px; color: #896514; font-size: 11px; line-height: 1.6; }
.crm-dashboard-refresh { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 20px; color: #9893a0; font-size: 10px; }
.crm-dashboard-refresh button { border: 1px solid #e7e4eb; padding: 7px 11px; border-radius: 8px; color: #676270; background: #fff; cursor: pointer; font-size: 10px; }
.crm-dashboard-refresh button:disabled { cursor: wait; opacity: .6; }
.crm-dashboard-location { width: min(460px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 25px; border: 1px solid #e7e4eb; border-radius: 20px; color: #211f35; box-shadow: 0 24px 80px rgba(31,29,54,.3); }
.crm-dashboard-location::backdrop { background: rgba(22,20,34,.55); backdrop-filter: blur(3px); }
.crm-dashboard-location h2 { margin: 0 0 12px; font-size: 20px; }
.crm-dashboard-location p { font-size: 12px; line-height: 1.65; color: #777381; }
.crm-dashboard-location .crm-dashboard-location__privacy { font-size: 11px; }
.crm-dashboard-location label { display: block; margin: 20px 0 6px; font-size: 12px; font-weight: 700; }
.crm-dashboard-location input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #ddd7e5; border-radius: 9px; font-size: 14px; }
.crm-dashboard-location button { min-height: 38px; padding: 9px 13px; border: 1px solid #e7e4eb; border-radius: 9px; background: #fff; color: #676270; font-size: 12px; cursor: pointer; }
.crm-dashboard-location .crm-dashboard-button { color: #fff; background: #df550c; border-color: #df550c; }
.crm-dashboard-location button:disabled { opacity: .6; cursor: wait; }
.crm-dashboard-location__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.crm-dashboard-location .crm-dashboard-location__message { min-height: 18px; color: #8b5d15; }
/* Preserva os acabamentos que o CSS anterior também aplicava aos módulos legados. */
#legacy-main-content .bg-white.rounded-xl { border-color: #e7e4eb !important; border-radius: 16px !important; box-shadow: 0 7px 28px rgba(31,29,54,.045) !important; }
#legacy-main-content .bg-white.rounded-xl:hover { box-shadow: 0 13px 36px rgba(31,29,54,.08) !important; }
#legacy-main-content h3 { letter-spacing: -.018em; }
#legacy-main-content .custom-scrollbar { scrollbar-width: thin; scrollbar-color: #d6d2dc transparent; }
@media (max-width: 1020px) {
    .crm-dashboard-page .crm-workspace { transition: none; }
}
@media (max-width: 1250px) and (min-width: 1021px) {
    .crm-dashboard-panel { padding: 18px; }
    .crm-dashboard-panels { gap: 16px; }
    .crm-dashboard-row { flex-wrap: wrap; }
    .crm-dashboard-badge { margin-left: 52px; max-width: 100%; }
}
@media (max-width: 1100px) {
    .crm-dashboard-top, .crm-dashboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .crm-dashboard-hero, .crm-dashboard-clock { grid-column: span 2; }
    .crm-dashboard-clock { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 20px; padding: 18px 22px; }
    .crm-dashboard-clock__date { align-self: center; }
    .crm-dashboard-clock__time { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; }
    .crm-dashboard-clock__zone { grid-column: 1; margin-top: 4px; }
    .crm-dashboard-clock__location { grid-column: 1 / -1; margin-top: 10px; }
}
@media (max-width: 900px) {
    .crm-dashboard-panels { grid-template-columns: 1fr; }
    .crm-dashboard-stack { gap: 18px; }
    .crm-dashboard-publications.is-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .crm-dashboard-panels.is-client .crm-dashboard-publications { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
    .crm-main.crm-main--dashboard { padding: 16px 12px 36px; }
    .crm-dashboard-hero, .crm-dashboard-clock { border-radius: 18px; }
    .crm-dashboard-hero__copy { min-height: 154px; padding: 25px 22px; }
    .crm-dashboard-hero { min-height: 154px; }
    .crm-dashboard-hero h2 { font-size: 25px; }
    .crm-dashboard-clock { padding: 18px; }
    .crm-dashboard-stat { min-height: 105px; padding: 13px; grid-template-columns: 34px minmax(0,1fr); column-gap: 9px; }
    .crm-dashboard-stat .crm-dashboard-stat__icon { width: 34px; height: 34px; border-radius: 10px; }
    .crm-dashboard-stat strong { font-size: 22px; }
    .crm-dashboard-stat span { font-size: 10px; }
    .crm-dashboard-stat small { font-size: 9px; }
    .crm-dashboard-panel { padding: 20px 16px; }
    .crm-dashboard-panels { gap: 18px; }
    .crm-dashboard-publications.is-grid, .crm-dashboard-panels.is-client .crm-dashboard-publications { grid-template-columns: 1fr; }
    .crm-dashboard-news__item { flex-wrap: wrap; }
    .crm-dashboard-news__item > b { margin-left: 35px; }
    .crm-dashboard-row__copy strong { font-size: 13px; }
    .crm-dashboard-location input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .crm-dashboard *, .crm-dashboard *::before, .crm-dashboard *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
