@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    font-family: 'DM Sans', sans-serif;
    color: #422a39;
    background: #fff8fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #aa3d69; outline-offset: 3px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-screen { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(circle at 20% 20%, #fff3f7, #f3cad9 75%); }
.auth-card { width: min(100%, 420px); padding: 37px; border-radius: 18px; background: #fff; box-shadow: 0 25px 70px #70324e30; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 36px; font: 800 19px 'Manrope', sans-serif; }
.auth-brand strong { display: grid; line-height: 1.25; letter-spacing: .06em; }
.auth-brand small { color: #8a3c61; font-size: 10px; letter-spacing: .16em; }
.auth-card h1 { margin: 0; font: 800 25px 'Manrope', sans-serif; }
.auth-intro { margin: 9px 0 26px; color: #694d5c; font-size: 13px; line-height: 1.6; }
#form-login { display: grid; gap: 16px; }
.auth-toggle { display: block; width: 100%; margin-top: 18px; padding: 9px; border: 0; background: transparent; color: #8d315a; font-size: 12px; font-weight: 700; }
.auth-toggle:hover { text-decoration: underline; }
.auth-footnote { margin: 23px 0 0; color: #6b5260; font-size: 11px; line-height: 1.6; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 31px 17px 23px;
    background: #f5dbe5;
    color: #4c2b3d;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 1px 13px 0; }
.brand-symbol {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: #fff5f9;
    color: #8c3159;
    font: 800 24px 'Manrope', sans-serif;
    letter-spacing: -3px;
}
.brand-name { display: grid; gap: 0; font: 800 18px 'Manrope', sans-serif; letter-spacing: .06em; line-height: 1.25; }
.brand-name small { color: #755166; font: 700 9px 'Manrope', sans-serif; letter-spacing: .19em; }
.sidebar-content { margin-top: 69px; }
.nav-caption { padding-left: 15px; margin: 0 0 17px; color: #79536a; font-size: 10px; font-weight: 700; letter-spacing: .17em; }
.navigation { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 14px; padding: 13px 15px; border-radius: 10px; color: #684357; font-weight: 600; font-size: 13px; transition: background .2s, color .2s; }
.nav-link svg { flex: 0 0 19px; width: 19px; height: 19px; }
.nav-link:hover, .nav-link:focus-visible, .nav-link.is-active { background: #f9c9da; color: #57243e; }
.nav-link.is-active { box-shadow: inset 3px 0 0 #a33867; }
.sidebar-foot { display: flex; align-items: start; gap: 11px; margin-top: auto; padding: 16px 12px; border: 1px solid #e8b9ca; border-radius: 12px; color: #563348; font-size: 12px; font-weight: 700; line-height: 1.5; }
.sidebar-foot-icon { color: #9b3561; font-size: 18px; line-height: 1; }
.sidebar-foot small { display: block; margin-top: 3px; color: #705267; font-size: 10px; font-weight: 400; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 91px; padding: 0 clamp(24px, 4vw, 66px); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border-bottom: 1px solid #f2dde5; }
.breadcrumb { margin: 0 0 4px; color: #775765; font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.breadcrumb span { padding: 0 8px; color: #af8b9e; }
.topbar-title { margin: 0; font: 700 15px 'Manrope', sans-serif; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.user-email { max-width: 185px; overflow: hidden; color: #6c4d5b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { padding: 7px 10px; border: 1px solid #efdae3; border-radius: 7px; background: #fff; color: #883559; font-size: 11px; font-weight: 700; }
.logout-button:hover { background: #fff0f5; }
.topbar-avatar { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; background: #fae0ea; color: #89345c; font: 800 15px 'Manrope', sans-serif; }
.main-content { width: 100%; max-width: 1530px; margin: 0 auto; padding: 32px clamp(24px, 4vw, 66px) 40px; }
.sync-notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; padding: 15px 18px; border: 1px solid #e9b7cb; border-radius: 10px; background: #fff0f6; }
.sync-notice p { margin: 0; color: #66344c; font-size: 12px; line-height: 1.6; }
.sync-notice .button { flex-shrink: 0; }

.welcome { position: relative; overflow: hidden; display: flex; align-items: center; min-height: 239px; padding: 39px 43px; border-radius: 18px; background: radial-gradient(circle at 85% 0%, #ffeaf2 0%, transparent 38%), linear-gradient(110deg, #fbe2eb 0%, #f7d2e0 55%, #efbad1 100%); color: #4e2539; }
.welcome-copy { position: relative; z-index: 1; max-width: 620px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 15px; color: #853658; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #ad4770; box-shadow: 0 0 0 4px #e796b84d; }
.welcome h1 { margin: 0 0 9px; font: 800 clamp(25px, 3vw, 37px)/1.2 'Manrope', sans-serif; letter-spacing: -.05em; }
.welcome h1 em { color: #93375e; font-style: normal; }
.welcome-copy > p:not(.eyebrow) { margin: 0 0 22px; color: #624057; font-size: 13px; line-height: 1.7; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 9px; padding: 11px 16px; font-weight: 700; font-size: 12px; transition: background .2s, transform .2s, box-shadow .2s; }
.button:hover { transform: translateY(-2px); }
.button-light { background: #9a3861; color: #fff; box-shadow: 0 5px 16px #73375033; }
.button-light:hover { background: #802c51; }
.button-light span { font-size: 21px; font-weight: 400; line-height: 0; }
.welcome-art { position: absolute; inset: 0 0 0 auto; width: 39%; min-width: 310px; pointer-events: none; }
.art-orbit { position: absolute; border: 1px solid #a54c7440; border-radius: 50%; }
.orbit-one { width: 345px; height: 345px; top: -93px; right: 10px; }
.orbit-two { width: 235px; height: 235px; top: -38px; right: 66px; }
.art-card { position: absolute; top: 63px; right: 59px; display: flex; align-items: center; gap: 13px; padding: 16px 21px; border: 1px solid #ffffffbf; border-radius: 14px; background: #fff8fbf0; box-shadow: 0 18px 33px #71385233; color: #6c5060; font-size: 12px; line-height: 1.7; transform: rotate(-7deg); }
.art-card strong { color: #5c2e46; font: 800 15px 'Manrope', sans-serif; }
.art-card-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #f9dbe7; color: #9a3a64; font-size: 24px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-top: 21px; }
.stat-card { position: relative; min-height: 150px; padding: 19px 19px 17px; border: 1px solid #f3e0e8; border-radius: 13px; background: #fff; box-shadow: 0 7px 22px #743a5610; }
.stat-icon { position: absolute; right: 17px; top: 17px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; font-size: 20px; font-weight: 600; }
.icon-today { background: #fae3ec; color: #943b64; }
.icon-clients { background: #eef0fb; color: #7779ba; }
.icon-pending { background: #fff2df; color: #c78732; }
.icon-done { background: #fce8ef; color: #9c4069; }
.stat-label { display: block; max-width: calc(100% - 30px); color: #694859; font-size: 11px; font-weight: 700; }
.stat-card strong { display: block; margin: 14px 0 3px; color: #4a293a; font: 800 30px/1 'Manrope', sans-serif; letter-spacing: -.05em; }
.stat-caption { color: #725868; font-size: 10px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(325px, .8fr); align-items: start; gap: 20px; margin-top: 22px; }
.panel { min-width: 0; border: 1px solid #f1dee7; border-radius: 15px; background: #fff; box-shadow: 0 7px 24px #743a5610; }
.appointments-panel, .clients-panel { padding: 27px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.section-kicker { margin: 0 0 7px; color: #963960; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.panel h2 { margin: 0; font: 800 20px/1.3 'Manrope', sans-serif; letter-spacing: -.035em; }
.panel-heading p:last-child, .form-intro { margin: 6px 0 0; color: #6d5260; font-size: 11px; line-height: 1.6; }
.count-chip { flex: 0 0 auto; padding: 7px 10px; border-radius: 7px; background: #fce9f0; color: #87375b; font-size: 10px; font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 25px 0 19px; }
.search-field { position: relative; flex: 1 1 160px; min-width: 0; }
.search-field svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; color: #856879; transform: translateY(-50%); pointer-events: none; }
.toolbar input, .toolbar select { width: 100%; min-height: 40px; border: 1px solid #eddae3; border-radius: 8px; background: #fffbfd; color: #503045; font-size: 11px; }
.toolbar .search-field input { padding: 0 12px 0 37px; }
.toolbar .day-filter { flex: 0 1 137px; width: 137px; padding: 0 8px; }
.toolbar select { flex: 0 0 113px; width: 113px; padding: 0 8px; }
.toolbar input::placeholder { color: #725767; }
.day-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 15px; padding: 10px 12px; border-radius: 8px; background: #fff0f5; color: #6c3150; font-size: 11px; font-weight: 800; }
.day-heading button { border: 0; background: transparent; color: #8b325b; font-size: 11px; font-weight: 800; text-decoration: underline; }
.appointments-list { display: grid; gap: 11px; }
.appointment-card { display: flex; align-items: start; gap: 14px; padding: 16px; border: 1px solid #f0e0e7; border-radius: 11px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.appointment-card:hover { border-color: #e8b2c8; box-shadow: 0 6px 20px #803c5c12; }
.date-badge { flex: 0 0 54px; display: grid; align-content: center; justify-items: center; min-height: 58px; border-radius: 9px; background: #fce7ef; color: #873458; }
.date-badge strong { font: 800 20px/1.2 'Manrope', sans-serif; }
.date-badge small { font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.appointment-card.is-completed .date-badge { background: #f9edf2; color: #714559; }
.appointment-info { flex: 1; min-width: 0; }
.appointment-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.appointment-heading h3 { overflow-wrap: anywhere; margin: 0; font: 800 13px/1.35 'Manrope', sans-serif; }
.status-pill { border-radius: 20px; padding: 4px 8px; background: #fff3df; color: #80520d; font-size: 9px; font-weight: 800; }
.status-pill.done { background: #fae4ec; color: #883657; }
.appointment-service { overflow-wrap: anywhere; margin: 5px 0 6px; color: #68475a; font-size: 11px; }
.appointment-meta { display: flex; flex-wrap: wrap; gap: 5px 13px; color: #705766; font-size: 10px; }
.appointment-note { overflow-wrap: anywhere; margin: 10px 0 0; padding: 8px 10px; border-radius: 6px; background: #fff6f9; color: #684e5f; font-size: 10px; line-height: 1.5; }
.appointment-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.day-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.day-navigation .action-button { min-height: 38px; }
#resumo-dia { flex: 1 1 180px; color: #705766; font-size: 11px; line-height: 1.5; }
.action-button.whatsapp { display: inline-flex; align-items: center; border-color: #b8dbca; color: #17603c; background: #f1faf5; }
.action-button.whatsapp:hover { background: #e2f3e9; }
button:disabled { cursor: wait; opacity: .65; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
.action-button { padding: 6px 10px; border: 1px solid #ebd3df; border-radius: 6px; background: #fff; color: #8a355c; font-size: 10px; font-weight: 700; transition: background .2s; }
.action-button:hover { background: #fff0f5; }
.action-button.complete { border-color: #e9bfd0; background: #fff0f5; }
.action-button.delete { border-color: #f1dedc; color: #a63831; }
.action-button.delete:hover { background: #fff0ee; }
.empty-state { padding: 49px 15px; border: 1px dashed #efcfdd; border-radius: 11px; background: #fffafd; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 51px; height: 51px; margin: 0 auto 13px; border-radius: 13px; background: #fbe4ed; color: #963c65; font-size: 27px; }
.empty-state h3 { margin: 0 0 6px; font: 800 14px 'Manrope', sans-serif; }
.empty-state p { max-width: 280px; margin: 0 auto 15px; color: #705463; font-size: 11px; line-height: 1.6; }
.empty-state a { color: #8c355b; font-size: 11px; font-weight: 800; }
.empty-state a:hover { text-decoration: underline; }

.form-panel { padding: 26px; }
.form-heading { display: flex; align-items: center; gap: 12px; }
.form-heading-icon { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; border-radius: 10px; background: #fbe0ea; color: #91355f; font-size: 27px; font-weight: 400; }
.form-intro { margin: 16px 0 22px; }
#form-agendamento { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { color: #573649; font-size: 11px; font-weight: 700; }
.field label > span:not(.optional) { color: #ce806c; }
.field .optional { color: #72596a; font-weight: 400; }
.field input, .field textarea { width: 100%; min-width: 0; min-height: 41px; border: 1px solid #efdae3; border-radius: 8px; outline: none; padding: 10px 12px; background: #fffbfd; color: #533147; font-size: 11px; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field textarea:focus { border-color: #a74874; box-shadow: 0 0 0 3px #a7487427; }
.field input::placeholder, .field textarea::placeholder { color: #725b6a; }
.field textarea { resize: vertical; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.form-message { margin: 0; padding: 10px 12px; border-radius: 7px; background: #fff0e9; color: #9a4434; font-size: 11px; line-height: 1.5; }
.button-full { width: 100%; min-height: 42px; }
.button-primary { background: #9a3861; color: #fff; box-shadow: 0 5px 12px #9a386127; }
.button-primary:hover { background: #802c51; }
.button-cancel { border-color: #ead3de; background: #fff; color: #823757; }
.button-cancel:hover { background: #fff0f5; }
.form-hint { margin: -7px 0 0; color: #725767; text-align: center; font-size: 10px; }

.clients-panel { margin-top: 22px; }
.backup-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 26px; }
.backup-panel > div:first-child > p:last-child { margin: 8px 0 0; max-width: 410px; color: #6c5261; font-size: 11px; line-height: 1.6; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.clients-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 23px; }
.client-card { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 13px; border: 1px solid #f0dfe7; border-radius: 9px; }
.client-avatar { flex: 0 0 38px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #fbe1ea; color: #863255; font: 800 12px 'Manrope', sans-serif; }
.client-card:nth-child(3n+2) .client-avatar { background: #f0ebf7; color: #5f467f; }
.client-card:nth-child(3n+3) .client-avatar { background: #fff2e3; color: #815a2c; }
.client-card h3 { overflow: hidden; margin: 0 0 3px; font: 800 11px 'Manrope', sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.client-card p { overflow: hidden; margin: 0; color: #705665; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.client-empty { margin: 0; padding: 16px; border-radius: 9px; background: #fff7fa; color: #6c5261; font-size: 11px; }
.footer { margin: auto auto 0; width: 100%; max-width: 1530px; padding: 0 clamp(24px, 4vw, 66px) 23px; color: #725868; font-size: 10px; }
.footer span { padding: 0 5px; }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 22px; max-width: min(360px, calc(100vw - 32px)); padding: 13px 18px; border-radius: 9px; background: #73314f; box-shadow: 0 10px 30px #54233e3d; color: #fff; font-size: 12px; font-weight: 600; }
.toast.error { background: #9b493b; }

@media (max-width: 1200px) {
    .app-shell { grid-template-columns: 205px minmax(0, 1fr); }
    .sidebar { padding-inline: 12px; }
    .main-content { padding-inline: 24px; }
    .topbar, .footer { padding-inline: 24px; }
    .content-grid { grid-template-columns: minmax(0, 1fr) 305px; gap: 15px; }
    .appointments-panel, .clients-panel, .form-panel { padding: 21px; }
    .stats-grid { gap: 10px; }
    .stat-card { padding-inline: 14px; }
}

@media (max-width: 960px) {
    .app-shell { display: block; }
    .sidebar { position: static; height: auto; padding: 16px 24px; flex-direction: row; align-items: center; justify-content: space-between; gap: 15px; }
    .brand { padding: 0; }
    .sidebar-content { margin: 0; }
    .nav-caption, .sidebar-foot { display: none; }
    .navigation { display: flex; gap: 2px; }
    .nav-link { padding: 10px; }
    .content-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr); }
    .toolbar .search-field { flex-basis: 100%; }
    .toolbar .day-filter { flex: 1 1 135px; }
    .clients-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .user-email { display: none; }
}

@media (max-width: 720px) {
    .topbar { height: 72px; }
    .topbar-right { gap: 10px; }
    .main-content { padding-top: 20px; }
    .welcome { padding: 30px; min-height: 220px; }
    .welcome-art { opacity: .25; right: -160px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid { grid-template-columns: 1fr; }
    .form-panel { grid-row: 1; }
    .clients-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .backup-panel { align-items: start; flex-direction: column; }
    .sync-notice { align-items: start; flex-direction: column; }
}

@media (max-width: 500px) {
    .auth-card { padding: 26px 22px; }
    .sidebar { padding: 15px 16px 9px; flex-wrap: wrap; }
    .brand-symbol { width: 35px; height: 35px; font-size: 21px; }
    .brand-name { font-size: 15px; }
    .sidebar-content { flex-basis: 100%; }
    .navigation { justify-content: space-between; }
    .nav-link { justify-content: center; flex: 1; gap: 6px; padding: 9px 7px; font-size: 11px; }
    .nav-link svg { width: 15px; height: 15px; flex-basis: 15px; }
    .topbar { padding-inline: 17px; height: 65px; }
    .breadcrumb { font-size: 8px; }
    .topbar-title { font-size: 12px; }
    .main-content { padding: 16px 13px 28px; }
    .welcome { padding: 27px 22px; border-radius: 13px; }
    .welcome h1 { font-size: 27px; }
    .welcome-copy > p:not(.eyebrow) { max-width: 250px; }
    .stat-card { min-height: 135px; }
    .stat-label { font-size: 10px; }
    .stat-icon { right: 11px; top: 12px; width: 29px; height: 29px; }
    .appointments-panel, .clients-panel, .form-panel { padding: 17px; }
    .toolbar { flex-wrap: wrap; }
    .toolbar .day-filter { flex: 1 1 135px; }
    .toolbar select { flex-basis: 105px; width: 105px; }
    .appointment-card { gap: 10px; padding: 12px; }
    .date-badge { flex-basis: 42px; min-height: 48px; }
    .date-badge strong { font-size: 17px; }
    .clients-list { grid-template-columns: 1fr; }
    .footer { padding: 0 17px 20px; line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
