:root {
    --bg-color: #0a0a0a;
    --card-bg: rgba(20, 20, 20, 0.85);
    --primary: #dc2626;
    /* Red 600 */
    --primary-glow: #ef444466;
    --secondary: #525252;
    --text-main: #ffffff;
    --text-muted: #a3a3a3;
    --accent: #f87171;
    /* Red 400 */
    --success: #10b981;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

body.analytics-mode,
body.settings-mode,
body.schedule-mode,
body.commercial-admin-mode,
body.connection-mode,
body.home-mode {
    overflow-y: auto;
    align-items: flex-start;
    padding: 24px 0 40px;
}

/* Background Animation */
.background-globes {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
}

.g1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation: float 10s infinite alternate;
}

.g2 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: -50px;
    right: -50px;
    animation: float 8s infinite alternate-reverse;
}

.g3 {
    width: 200px;
    height: 200px;
    background: #7f1d1d;
    /* Red 900 */
    top: 40%;
    left: 40%;
    animation: float 12s infinite alternate;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 30px);
    }
}

/* Main Container */
.main-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    z-index: 1;
    transition: max-width 0.35s ease;
}

body.analytics-mode .main-container {
    max-width: 1180px;
}

body.commercial-admin-mode .main-container {
    max-width: 1180px;
}

body.connection-mode .main-container {
    max-width: 820px;
}

body.schedule-mode .main-container {
    max-width: 1180px;
}

body.settings-mode .main-container {
    max-width: 1040px;
}

body.home-mode .main-container {
    max-width: 980px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 50%;
    background-color: white;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.4);
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05) rotate(5deg);
}

.badge {
    font-size: 0.75rem;
    background: linear-gradient(135deg, var(--primary), #991b1b);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.status {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status.connected {
    color: var(--success);
}

.status.disconnected {
    color: var(--text-muted);
}

/* Glassmorphism Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.card h2 {
    margin-bottom: 8px;
    font-weight: 600;
}

.description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-card {
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top right, rgba(220, 38, 38, 0.14), transparent 36%);
}

.auth-form {
    position: relative;
    z-index: 1;
}

.auth-form .btn-primary {
    margin-top: 8px;
}

.auth-help {
    position: relative;
    z-index: 1;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.auth-help strong {
    color: #fca5a5;
}

.auth-session-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.auth-session-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.tenant-switcher-label {
    display: flex;
    flex: 1 1 260px;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.tenant-switcher-label select {
    min-width: 190px;
    margin: 0;
    padding: 8px 10px;
    font-size: 0.82rem;
}

.auth-session-bar span {
    min-width: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-session-bar button {
    width: auto;
    min-width: 72px;
    margin: 0;
    padding: 8px 12px;
}

.change-password-panel {
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 42%),
        rgba(59, 130, 246, 0.06);
}

.change-password-panel.must-change {
    border-color: rgba(245, 158, 11, 0.38);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.15), transparent 42%),
        rgba(245, 158, 11, 0.07);
}

.change-password-panel form {
    margin-top: 12px;
}

.change-password-panel .manual-client-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.change-password-panel .manual-client-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 4px;
}

.change-password-panel .manual-client-actions button {
    width: auto;
    min-width: 170px;
    margin: 0;
}

/* Forms */
.input-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

select option {
    color: white;
    background: #171717;
}

textarea {
    resize: vertical;
}

input[type="date"],
input[type="time"] {
    color-scheme: dark;
}

/* Button */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #991b1b);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 20px;
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* QR Code Area */
.qr-container {
    background: white;
    padding: 16px;
    border-radius: 16px;
    width: 240px;
    height: 240px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.qr-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
}

.loader {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 500;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.account-card {
    min-height: 210px;
    border-radius: 22px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        radial-gradient(circle at top right, rgba(220, 38, 38, 0.18), transparent 36%),
        rgba(255, 255, 255, 0.045);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.25;
}

.status-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 7px 11px;
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.4);
    background: rgba(120, 53, 15, 0.25);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-badge.connected {
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(20, 83, 45, 0.28);
}

.status-badge.disconnected {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.42);
    background: rgba(127, 29, 29, 0.25);
}

.status-badge.warning {
    color: #fed7aa;
    border-color: rgba(251, 146, 60, 0.45);
    background: rgba(124, 45, 18, 0.28);
}

.account-card .qr-preview {
    display: flex;
    justify-content: center;
    margin: 16px 0 8px;
}

.account-card .qr-preview.hidden {
    display: none;
}

.thumb-qr {
    width: min(230px, 100%);
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 16px;
    padding: 10px;
    background: white;
}

.account-card .loader {
    width: 28px;
    height: 28px;
    margin: 22px auto 6px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.16);
    border-top-color: var(--primary);
    animation: messageSpin 0.8s linear infinite;
}

/* Dashboard & Logs */
.success-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 16px;
}

.stats {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-item .value {
    font-size: 1.1rem;
    font-weight: 600;
}

.value.active {
    color: var(--success);
}

.terminal-view {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    background: #000;
    color: #0f0;
    padding: 12px;
    border-radius: 12px;
    height: 150px;
    overflow-y: auto;
    opacity: 0.8;
}

.terminal-view p {
    margin-bottom: 4px;
    border-bottom: 1px solid #111;
}

/* Utilities */

/* Action Buttons Group */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.action-buttons button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
    /* Override generic margin */
    padding: 12px;
}

.action-buttons svg {
    min-width: 20px;
}

@media (max-width: 520px) {
    .business-account-grid {
        grid-template-columns: 1fr;
    }

    .auth-session-bar,
    .tenant-switcher-label,
    .auth-session-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tenant-switcher-label {
        width: 100%;
        flex: 0 0 auto;
    }

    .auth-session-actions {
        width: 100%;
    }

    .auth-session-bar button,
    .change-password-panel .manual-client-actions button {
        width: 100%;
    }

    .change-password-panel .manual-client-grid {
        grid-template-columns: 1fr;
    }
}

/* Central de mensagens */
body.messages-mode {
    overflow: hidden;
    align-items: stretch;
    padding: 18px;
}

body.messages-mode .main-container {
    max-width: 1440px;
    height: calc(100vh - 36px);
    padding: 0;
}

body.messages-mode header:not(.conversation-header) {
    display: none;
}

.messages-menu-btn {
    border-color: rgba(37, 211, 102, 0.25);
}

.whatsapp-icon {
    color: #25d366 !important;
    background: rgba(37, 211, 102, 0.14) !important;
}

.messages-card {
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(13, 17, 18, 0.96);
}

.messages-topbar {
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(25, 31, 32, .96);
}

.messages-title {
    display: flex;
    align-items: center;
    gap: 13px;
}

.messages-title h2 {
    margin: 0;
    font-size: 1.25rem;
}

.messages-title span {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: .77rem;
}

.messages-title span.online { color: #4ade80; }
.messages-title span.error { color: #f87171; }
.messages-title span.loading { color: #fbbf24; }

#messages-client-select {
    width: auto;
    min-width: 170px;
    margin: 0;
    padding: 10px 34px 10px 13px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.11);
    background-color: rgba(255,255,255,.06);
    color: white;
}

.messages-layout {
    display: grid;
    grid-template-columns: minmax(280px, 355px) minmax(0, 1fr);
    height: calc(100% - 74px);
}

.chat-sidebar {
    min-width: 0;
    border-right: 1px solid rgba(255,255,255,.08);
    background: rgba(17, 22, 23, .88);
    overflow: hidden;
}

.chat-search-wrap {
    height: 67px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 13px;
    color: #9ca3af;
}

.chat-search-wrap input {
    height: 40px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: white;
}

.chat-search-wrap {
    margin-top: 10px;
    height: 45px;
    padding: 0 13px;
    border-radius: 11px;
    background: rgba(255,255,255,.065);
}

.chat-list {
    height: calc(100% - 65px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.16) transparent;
}

.chat-list-item {
    width: 100%;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.055);
    border-radius: 0;
    background: transparent;
    color: white;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease;
}

.chat-list-item:hover { background: rgba(255,255,255,.05); }
.chat-list-item.active { background: rgba(37, 211, 102, .10); }

.chat-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #334155, #1f2937);
    color: #e5e7eb;
    font-size: .86rem;
    font-weight: 600;
}

.chat-list-copy {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 5px;
}

.chat-list-heading,
.chat-list-preview {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-list-heading strong,
.chat-list-preview > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list-heading time {
    flex: none;
    color: #9ca3af;
    font-size: .69rem;
}

.chat-list-preview { color: #9ca3af; font-size: .78rem; }
.chat-list-preview i { font-style: normal; color: #d1d5db; }
.chat-list-preview b {
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 5px;
    background: #25d366;
    color: #07140c;
    font-size: .67rem;
}

.conversation-panel {
    min-width: 0;
    position: relative;
    overflow: hidden;
    background-color: #0d1212;
    background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 18px 18px;
}

.conversation-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: #d1d5db;
}

.conversation-empty h3 { margin: 18px 0 7px; font-size: 1.3rem; }
.conversation-empty p { color: #8b9696; }
.empty-whatsapp-icon { color: #25d366; opacity: .9; }

.conversation-active {
    height: 100%;
    display: grid;
    grid-template-rows: 68px minmax(0, 1fr) auto auto;
}

.conversation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    background: rgba(29, 36, 37, .98);
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.conversation-header .chat-avatar { width: 41px; height: 41px; flex-basis: 41px; }
.active-chat-info { min-width: 0; flex: 1; display: grid; gap: 2px; }
.active-chat-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-chat-info span { color: #9ca3af; font-size: .74rem; }

.conversation-action,
.mobile-chats-back {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    margin: 0;
    background: transparent;
    color: #bdc4c4;
    cursor: pointer;
}
.conversation-action:hover { background: rgba(255,255,255,.07); }
.mobile-chats-back { display: none; font-size: 2rem; }

.message-list {
    min-height: 0;
    overflow-y: auto;
    padding: 22px clamp(18px, 6vw, 80px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

.message-row { display: flex; margin: 3px 0; }
.message-row.incoming { justify-content: flex-start; }
.message-row.outgoing { justify-content: flex-end; }

.message-bubble {
    max-width: min(72%, 620px);
    position: relative;
    padding: 8px 11px 6px;
    border-radius: 9px;
    background: #202829;
    box-shadow: 0 1px 2px rgba(0,0,0,.22);
    color: #f3f4f6;
    font-size: .9rem;
    line-height: 1.36;
    overflow: hidden;
}

.message-row.outgoing .message-bubble { background: #075e4b; }
.message-bubble.has-media { padding: 5px; min-width: 210px; }
.message-bubble.has-media .message-body { padding: 5px 5px 1px; }
.message-body { overflow-wrap: anywhere; }
.message-meta {
    float: right;
    margin: 5px 0 0 10px;
    color: rgba(229,231,235,.65);
    font-size: .62rem;
    line-height: 1;
}
.message-meta i { color: #67d8ff; font-style: normal; }

.message-image,
.message-video {
    display: block;
    width: 100%;
    max-width: 390px;
    max-height: 390px;
    border-radius: 7px;
    object-fit: contain;
    background: rgba(0,0,0,.3);
}
.message-audio { width: min(310px, 100%); height: 46px; display: block; }
.message-document {
    min-width: 230px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border-radius: 7px;
    background: rgba(0,0,0,.17);
    color: white;
    text-decoration: none;
}
.message-document > span:first-child { font-size: 1.6rem; }
.message-document strong,
.message-document small { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-document small { margin-top: 2px; color: #b8c1c1; }
.media-unavailable { padding: 13px; color: #cbd5e1; font-size: .77rem; }

.message-date-divider { display: flex; justify-content: center; margin: 16px 0 11px; }
.message-date-divider span {
    padding: 5px 10px;
    border-radius: 7px;
    background: rgba(30, 40, 41, .92);
    color: #aeb8b8;
    font-size: .67rem;
    text-transform: capitalize;
}

.media-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 9px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: #192021;
    color: #cbd5e1;
    font-size: .78rem;
}
.media-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-preview button { border: 0; background: transparent; color: #f87171; font-size: 1.4rem; cursor: pointer; }

.message-composer {
    min-height: 66px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 15px;
    border-top: 1px solid rgba(255,255,255,.06);
    background: #192021;
}

.message-composer textarea {
    min-height: 43px;
    max-height: 120px;
    flex: 1;
    resize: none;
    margin: 0;
    padding: 11px 15px;
    border: 1px solid transparent;
    border-radius: 22px;
    outline: 0;
    background: rgba(255,255,255,.075);
    color: white;
    font: inherit;
    line-height: 20px;
}
.message-composer textarea:focus { border-color: rgba(37,211,102,.3); }

.composer-icon,
.send-message-btn {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.composer-icon { background: transparent; color: #aeb7b7; }
.composer-icon:hover { background: rgba(255,255,255,.06); }
.send-message-btn { background: #25d366; color: #062f18; }
.send-message-btn:hover { background: #36e276; transform: translateY(-1px); }
.send-message-btn:disabled { opacity: .55; cursor: wait; transform: none; }

.messages-placeholder {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 25px;
    color: #899494;
    text-align: center;
    font-size: .83rem;
}
.messages-placeholder.compact { min-height: 130px; }
.messages-placeholder.error { color: #f87171; }
.mini-loader {
    width: 16px;
    height: 16px;
    display: inline-block;
    border: 2px solid rgba(255,255,255,.17);
    border-top-color: #25d366;
    border-radius: 50%;
    animation: messageSpin .7s linear infinite;
}
@keyframes messageSpin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
    body.messages-mode { padding: 0; }
    body.messages-mode .main-container { height: 100vh; }
    .messages-card { border-radius: 0; border: 0; }
    .messages-topbar { height: 66px; padding: 0 12px; }
    .messages-title h2 { font-size: 1.05rem; }
    .messages-title span { display: none; }
    #messages-client-select { min-width: 145px; max-width: 46vw; font-size: .76rem; }
    .messages-layout { position: relative; display: block; height: calc(100% - 66px); }
    .chat-sidebar { width: 100%; height: 100%; border: 0; }
    .conversation-panel { position: absolute; inset: 0; transform: translateX(100%); transition: transform .22s ease; }
    .chat-sidebar.mobile-conversation-open + .conversation-panel { transform: translateX(0); }
    .mobile-chats-back { display: inline-flex; }
    .message-list { padding: 16px 10px; }
    .message-bubble { max-width: 88%; }
    .message-composer { padding: 8px; gap: 6px; }
    .composer-icon, .send-message-btn { width: 40px; height: 40px; flex-basis: 40px; }
}

/* --- NEW UI ELEMENTS --- */
.logo-area-small {
    text-align: center;
    margin-bottom: 20px;
}

/* Centraliza o texto do card Home */
#home-step {
    text-align: center;
}

.logo-small {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
}

/* Menu Buttons */
.menu-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

#home-step .big-btn {
    width: 100%;
    min-height: 122px;
    padding: 20px 14px;
}

#home-step .big-btn > span {
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#home-step .home-secondary-entry > svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

#home-step .home-secondary-entry .settings-entry-copy {
    display: block;
    flex: 0 0 auto;
    text-align: center;
}

#home-step .home-secondary-entry .settings-entry-copy strong {
    font-size: inherit;
    font-weight: 400;
}

#home-step .home-secondary-entry .settings-entry-copy small,
#home-step .home-secondary-entry .settings-entry-arrow {
    display: none;
}

#home-step .settings-menu-btn > svg {
    color: #d4d4d8;
}

#home-step .calendar-entry > svg {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.16);
}

#home-step .agenda-entry > svg {
    color: #34d399;
    background: rgba(16, 185, 129, 0.16);
}

@media (max-width: 760px) {
    body.home-mode .main-container {
        max-width: 100%;
    }

    .menu-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 440px) {
    .menu-buttons {
        gap: 10px;
    }

    #home-step .big-btn {
        min-height: 108px;
        padding: 16px 10px;
    }
}

.settings-entry-btn {
    margin-top: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.settings-entry-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
}

.settings-entry-copy strong {
    color: var(--text-main);
    font-size: 0.92rem;
}

.settings-entry-copy small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.settings-entry-arrow {
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
}

.calendar-entry svg {
    color: #60a5fa;
}

.agenda-entry svg {
    color: #34d399;
}

.schedule-card {
    padding: 28px;
}

.schedule-panel {
    padding: 20px;
    margin-top: 18px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
}

.ai-scheduling-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 18px 20px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.14), transparent 42%),
        rgba(255, 255, 255, 0.03);
}

.ai-scheduling-copy {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ai-scheduling-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: rgba(139, 92, 246, 0.17);
    color: #c4b5fd;
    font-size: 1.3rem;
}

.ai-scheduling-copy h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.ai-scheduling-copy p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.ai-scheduling-switch {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}

.ai-scheduling-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ai-switch-track {
    position: relative;
    width: 50px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.ai-switch-track span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d4d4d8;
    transition: transform 0.2s ease, background 0.2s ease;
}

.ai-scheduling-switch input:checked + .ai-switch-track {
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.28);
}

.ai-scheduling-switch input:checked + .ai-switch-track span {
    transform: translateX(22px);
    background: #6ee7b7;
}

.ai-scheduling-switch input:focus-visible + .ai-switch-track {
    outline: 2px solid #c4b5fd;
    outline-offset: 3px;
}

.ai-scheduling-switch strong {
    min-width: 74px;
    color: #a3a3a3;
    font-size: 0.82rem;
}

.ai-scheduling-switch strong.enabled {
    color: #6ee7b7;
}

.schedule-list-panel {
    background: rgba(0, 0, 0, 0.16);
}

.batch-schedule-panel {
    border-color: rgba(96, 165, 250, 0.2);
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 36%),
        rgba(255, 255, 255, 0.025);
}

.repeat-shortcuts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.repeat-shortcuts > span {
    margin-right: 2px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.repeat-shortcut,
.weekday-toolbar button {
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.repeat-shortcut:hover,
.weekday-toolbar button:hover {
    border-color: rgba(96, 165, 250, 0.45);
    color: white;
}

.repeat-shortcut.active {
    border-color: rgba(96, 165, 250, 0.6);
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
}

.batch-date-grid,
.batch-time-grid {
    display: grid;
    gap: 12px;
}

.batch-date-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.batch-time-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.batch-date-grid .input-group,
.batch-time-grid .input-group {
    margin-bottom: 14px;
}

.weekday-fieldset {
    min-width: 0;
    padding: 0;
    margin: 2px 0 18px;
    border: 0;
}

.weekday-fieldset legend {
    margin-bottom: 9px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.weekday-toolbar {
    display: flex;
    gap: 7px;
    margin-bottom: 10px;
}

.weekday-picker {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
}

.weekday-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.weekday-picker label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 5px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.weekday-picker label strong {
    display: none;
}

.weekday-picker label:hover {
    border-color: rgba(96, 165, 250, 0.4);
    color: white;
}

.weekday-checkbox:checked + label {
    border-color: #60a5fa;
    background: rgba(59, 130, 246, 0.2);
    color: #dbeafe;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.18);
}

.weekday-checkbox:focus-visible + label {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.batch-action-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.06);
}

.batch-preview {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.batch-preview strong {
    color: #bfdbfe;
    font-size: 1rem;
}

.batch-preview span {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.batch-action-row .btn-primary {
    width: auto;
    min-width: 150px;
    margin: 0;
}

.calendar-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.calendar-professional-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.calendar-professional-grid .input-group {
    min-width: 0;
    margin: 0;
}

.calendar-single-form-grid {
    grid-template-columns: minmax(230px, 1.4fr) minmax(135px, 0.7fr) minmax(115px, 0.6fr) auto;
}

.calendar-professional-grid small,
.professional-select-group small {
    display: block;
    margin-top: 6px;
    color: #93c5fd;
    font-size: 0.75rem;
}

.professional-registry-panel {
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 36%),
        rgba(255, 255, 255, 0.025);
}

.professional-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
}

.professional-form .input-group {
    min-width: 0;
}

.professional-form-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 10px;
}

.professional-form-actions .btn-primary,
.professional-form-actions .btn-secondary {
    width: auto;
    min-width: 170px;
    margin: 0;
}

.professional-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.professional-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    padding: 13px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 13px;
    background: rgba(16, 185, 129, 0.055);
}

.professional-card.inactive {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    opacity: 0.72;
}

.professional-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #2563eb);
    color: white;
    font-weight: 750;
}

.professional-card-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.professional-card-copy strong {
    overflow: hidden;
    color: #f3f4f6;
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.professional-card-copy span {
    color: #93c5fd;
    font-size: 0.76rem;
}

.professional-card-copy small {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.professional-status {
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
}

.professional-status.active {
    background: rgba(16, 185, 129, 0.12);
    color: #86efac;
}

.professional-status.inactive {
    background: rgba(156, 163, 175, 0.12);
    color: #d1d5db;
}

.professional-card-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 8px;
}

.professional-card-actions .btn-secondary,
.professional-card-actions .btn-danger {
    width: auto;
    min-width: 90px;
    padding: 7px 10px;
    margin: 0;
    border-radius: 8px;
    cursor: pointer;
}

.holiday-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.holiday-block-control {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: 8px;
    color: #fecaca;
    background: rgba(248, 113, 113, 0.08);
    white-space: nowrap;
    cursor: pointer;
}

.holiday-block-control input {
    width: 18px;
    height: 18px;
    accent-color: #dc2626;
}

.holiday-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.holiday-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.holiday-item time {
    flex: 0 0 auto;
    color: #fca5a5;
    font-weight: 600;
    text-transform: capitalize;
}

.holiday-item span {
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.calendar-form-grid .input-group {
    margin: 0;
}

.calendar-form-grid .btn-primary {
    width: auto;
    min-width: 160px;
    margin: 0;
}

.schedule-heading-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.schedule-counter {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.28);
    color: #93c5fd !important;
}

.calendar-selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
}

.calendar-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: #e5e7eb;
    cursor: pointer;
}

.calendar-select-all-label input,
.calendar-slot-select input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    padding: 0;
    accent-color: #dc2626;
    cursor: pointer;
}

.calendar-select-all-label input:disabled,
.calendar-slot-select input:disabled {
    cursor: not-allowed;
}

.calendar-selection-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-selection-actions > span {
    min-width: 92px;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: right;
}

.calendar-selection-actions .btn-secondary,
.calendar-selection-actions .btn-danger {
    width: auto;
    margin: 0;
    padding: 8px 11px;
    border-radius: 9px;
}

#calendar-selection-message {
    margin-top: 0;
    margin-bottom: 14px;
}

.schedule-list,
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.schedule-day-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-day-title {
    color: #d4d4d4;
    font-size: 0.83rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: capitalize;
}

.schedule-day-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-slot {
    display: grid;
    grid-template-columns: 28px 80px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.03);
}

.calendar-slot-select {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.calendar-slot.booked {
    background: rgba(251, 191, 36, 0.045);
    border-color: rgba(251, 191, 36, 0.18);
}

.calendar-slot.holiday_blocked {
    background: rgba(239, 68, 68, 0.045);
    border-color: rgba(239, 68, 68, 0.2);
}

.calendar-slot-time {
    font-family: Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 600;
}

.calendar-slot-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.calendar-slot-status small {
    color: var(--text-muted);
}

.calendar-slot-professional {
    color: #e5e7eb;
    font-size: 0.8rem;
    font-weight: 650;
}

.slot-status-badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.slot-status-badge.available {
    color: #86efac;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
}

.slot-status-badge.booked {
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
}

.slot-status-badge.holiday_blocked {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.slot-status-badge.professional_missing {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.calendar-slot .btn-danger,
.appointment-card .btn-danger {
    width: auto;
    margin: 0;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.calendar-slot .btn-danger:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.schedule-message {
    padding: 11px 13px;
    margin-top: 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.schedule-message.info {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.schedule-message.success {
    color: #86efac;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.schedule-message.error {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.schedule-empty {
    padding: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 13px;
    color: var(--text-muted);
    text-align: center;
}

.agenda-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.agenda-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
}

.agenda-form-grid .full {
    grid-column: 1 / -1;
}

.agenda-client-search-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 8px;
}

.agenda-client-search-field input {
    min-width: 0;
}

.agenda-client-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(248, 113, 113, 0.42);
    border-radius: 10px;
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
    cursor: pointer;
}

.agenda-client-search-button:hover {
    background: rgba(248, 113, 113, 0.22);
}

.agenda-form-grid .input-group small {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.client-picker {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 7, 18, 0.78);
    backdrop-filter: blur(8px);
}

.client-picker-card {
    width: min(620px, 100%);
    max-height: min(720px, 88vh);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: #15151b;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.client-picker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.client-picker-header h3 {
    margin: 0 0 4px;
}

.client-picker-header span {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.client-picker-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.client-picker-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.client-picker-option:hover {
    border-color: rgba(248, 113, 113, 0.38);
    background: rgba(248, 113, 113, 0.1);
}

.client-picker-option-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.client-picker-option-main small,
.client-picker-option-detail {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.appointment-card {
    display: grid;
    grid-template-columns: 135px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.03);
}

.appointment-date-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.appointment-date-box strong {
    color: #86efac;
    font-family: Consolas, monospace;
    font-size: 1.25rem;
}

.appointment-date-box span {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: capitalize;
}

.appointment-client {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.appointment-client a {
    color: #93c5fd;
    font-size: 0.88rem;
    text-decoration: none;
}

.appointment-client p {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.appointment-source-ai {
    display: inline-flex;
    margin-left: 7px;
    padding: 3px 7px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
    font-size: 0.68rem;
    font-weight: 600;
    vertical-align: middle;
}

.agenda-calendar-panel {
    overflow: hidden;
    padding: 0;
}

.agenda-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.agenda-calendar-heading h3 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1.12rem;
    text-transform: capitalize;
}

.agenda-calendar-heading span {
    color: var(--text-muted);
    font-size: 0.79rem;
}

.agenda-calendar-navigation {
    display: flex;
    align-items: center;
    gap: 7px;
}

.agenda-calendar-nav,
.agenda-calendar-today {
    height: 38px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.045);
    color: #e5e7eb;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.agenda-calendar-nav {
    width: 38px;
    padding: 0;
    font-size: 1.55rem;
    line-height: 1;
}

.agenda-calendar-today {
    width: auto;
    min-width: 68px;
    padding: 0 14px;
    font-size: 0.8rem;
    font-weight: 600;
}

.agenda-calendar-nav:hover,
.agenda-calendar-today:hover {
    border-color: rgba(96, 165, 250, 0.42);
    background: rgba(59, 130, 246, 0.12);
}

.agenda-calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    min-height: 680px;
}

.agenda-calendar-scroll {
    min-width: 0;
    overflow-x: auto;
    background: rgba(5, 8, 15, 0.3);
}

.agenda-calendar-surface {
    min-width: 720px;
}

.agenda-calendar-weekdays,
.agenda-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.agenda-calendar-weekdays {
    height: 38px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.agenda-calendar-weekdays span {
    display: grid;
    place-items: center;
    color: #9ca3af;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.agenda-calendar-day {
    min-width: 0;
    min-height: 106px;
    padding: 7px 6px 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.012);
}

.agenda-calendar-day:nth-child(7n) {
    border-right: 0;
}

.agenda-calendar-day.other-month {
    background: rgba(0, 0, 0, 0.14);
}

.agenda-calendar-day-number {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    padding: 0;
    margin: 0 0 5px auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #d1d5db;
    font-size: 0.75rem;
    cursor: pointer;
}

.agenda-calendar-day.other-month .agenda-calendar-day-number {
    color: #626975;
}

.agenda-calendar-day.today .agenda-calendar-day-number {
    background: #2563eb;
    color: white;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.agenda-calendar-events {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.agenda-calendar-event {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    width: 100%;
    padding: 5px 6px;
    margin: 0;
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 5px;
    background: rgba(37, 99, 235, 0.19);
    color: #dbeafe;
    text-align: left;
    cursor: pointer;
}

.agenda-calendar-event.ai {
    border-color: rgba(139, 92, 246, 0.34);
    background: rgba(124, 58, 237, 0.2);
    color: #ede9fe;
}

.agenda-calendar-event:hover,
.agenda-calendar-event.selected {
    border-color: rgba(147, 197, 253, 0.8);
    background: rgba(37, 99, 235, 0.38);
}

.agenda-calendar-event span {
    flex: 0 0 auto;
    font-family: Consolas, monospace;
    font-size: 0.65rem;
}

.agenda-calendar-event strong {
    min-width: 0;
    overflow: hidden;
    font-size: 0.68rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-calendar-more {
    width: 100%;
    padding: 2px 5px;
    margin: 0;
    border: 0;
    background: transparent;
    color: #93c5fd;
    font-size: 0.68rem;
    text-align: left;
    cursor: pointer;
}

.agenda-appointment-detail {
    padding: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(0, 0, 0, 0.16);
}

.agenda-detail-empty {
    display: flex;
    height: 100%;
    min-height: 260px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
}

.agenda-detail-icon {
    display: grid;
    width: 46px;
    height: 46px;
    margin-bottom: 4px;
    place-items: center;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    font-size: 1.2rem;
}

.agenda-detail-empty strong {
    color: #d1d5db;
    font-size: 0.9rem;
}

.agenda-detail-empty p {
    max-width: 220px;
    font-size: 0.76rem;
    line-height: 1.45;
}

.agenda-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.agenda-detail-date {
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.4;
    text-transform: capitalize;
}

.agenda-detail-header > strong {
    color: #93c5fd;
    font-family: Consolas, monospace;
    font-size: 1.15rem;
}

.agenda-detail-client {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 18px 0;
}

.agenda-detail-avatar {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4ed8, #7c3aed);
    color: white;
    font-weight: 700;
}

.agenda-detail-client h4 {
    margin: 0 0 4px;
    color: white;
    font-size: 0.92rem;
}

.agenda-detail-client a,
.agenda-detail-client span {
    color: #93c5fd;
    font-size: 0.76rem;
    text-decoration: none;
}

.agenda-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.agenda-detail-badges span {
    padding: 5px 8px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    color: #c4b5fd;
    font-size: 0.66rem;
}

.agenda-detail-notes {
    padding: 13px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
}

.agenda-detail-professional {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px;
    margin-bottom: 12px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.07);
}

.agenda-detail-professional small {
    color: #9ca3af;
    font-size: 0.66rem;
    text-transform: uppercase;
}

.agenda-detail-professional strong {
    color: #dbeafe;
    font-size: 0.88rem;
}

.agenda-detail-professional span {
    color: #93c5fd;
    font-size: 0.76rem;
}

.agenda-detail-notes small {
    display: block;
    margin-bottom: 6px;
    color: #9ca3af;
    font-size: 0.68rem;
    text-transform: uppercase;
}

.agenda-detail-notes p {
    color: #d1d5db;
    font-size: 0.78rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.agenda-appointment-detail .btn-danger {
    width: 100%;
    padding: 10px 13px;
    margin: 0;
    border-radius: 9px;
    cursor: pointer;
}

@media (max-width: 1080px) {
    .agenda-calendar-layout {
        grid-template-columns: 1fr;
    }

    .agenda-appointment-detail {
        min-height: 220px;
        border-top: 1px solid rgba(255, 255, 255, 0.09);
        border-left: 0;
    }
}

@media (max-width: 680px) {
    .agenda-calendar-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-calendar-navigation {
        justify-content: space-between;
    }

    .agenda-calendar-today {
        flex: 1;
    }

    .agenda-calendar-layout {
        min-height: 0;
    }

    .agenda-calendar-day {
        min-height: 96px;
    }

    .holiday-panel-header {
        flex-direction: column;
    }

    .holiday-block-control {
        width: 100%;
        white-space: normal;
    }

    .holiday-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-scheduling-control {
        align-items: flex-start;
        flex-direction: column;
    }

    .ai-scheduling-switch {
        width: 100%;
        justify-content: flex-end;
    }

    .calendar-form-grid,
    .agenda-form-grid,
    .agenda-summary,
    .batch-date-grid,
    .batch-time-grid {
        grid-template-columns: 1fr;
    }

    .calendar-professional-grid,
    .calendar-single-form-grid,
    .professional-form,
    .professional-list {
        grid-template-columns: 1fr;
    }

    .professional-form-actions {
        grid-column: auto;
        flex-direction: column;
    }

    .professional-form-actions .btn-primary,
    .professional-form-actions .btn-secondary {
        width: 100%;
    }

    .calendar-form-grid .btn-primary {
        width: 100%;
    }

    .agenda-form-grid .full {
        grid-column: auto;
    }

    .calendar-slot,
    .appointment-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .calendar-slot .btn-danger,
    .appointment-card .btn-danger {
        width: 100%;
    }

    .calendar-selection-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .calendar-selection-actions {
        flex-wrap: wrap;
    }

    .calendar-selection-actions > span {
        flex: 1 1 100%;
        text-align: left;
    }

    .calendar-selection-actions .btn-secondary,
    .calendar-selection-actions .btn-danger {
        flex: 1;
    }

    .weekday-picker {
        gap: 5px;
    }

    .weekday-picker label span {
        display: none;
    }

    .weekday-picker label strong {
        display: inline;
    }

    .batch-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .batch-action-row .btn-primary {
        width: 100%;
    }
}

.settings-card {
    padding: 28px;
}

.settings-section {
    padding: 22px;
    margin-top: 18px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
}

.company-knowledge-section {
    background:
        radial-gradient(circle at top right, rgba(220, 38, 38, 0.11), transparent 34%),
        rgba(255, 255, 255, 0.025);
}

.settings-section-heading {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.settings-section-heading > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.knowledge-status-pill {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.11);
    color: #86efac !important;
    font-size: 0.75rem !important;
}

.knowledge-status-pill.complete {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe !important;
}

.company-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.company-info-grid .input-group {
    min-width: 0;
    margin: 0;
}

.company-info-grid .input-group.full {
    grid-column: 1 / -1;
}

.company-info-grid textarea {
    min-height: 82px;
    line-height: 1.45;
}

.business-hours-config > select {
    margin-bottom: 12px;
}

.hours-source-panel {
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    background: rgba(0, 0, 0, 0.16);
}

.hours-source-panel > label {
    margin-bottom: 7px;
}

.calendar-source-preview {
    border-color: rgba(96, 165, 250, 0.25);
    background: rgba(59, 130, 246, 0.08);
}

.calendar-source-preview strong {
    display: block;
    margin-bottom: 8px;
    color: #bfdbfe;
    font-size: 0.88rem;
}

.calendar-source-preview p {
    max-height: 170px;
    overflow-y: auto;
    margin-bottom: 8px;
    color: #e5e7eb;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-line;
}

.calendar-source-preview small {
    color: #93c5fd;
    font-size: 0.74rem;
    line-height: 1.4;
}

.deployment-checklist-section {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 38%),
        rgba(255, 255, 255, 0.025);
}

.deployment-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.deployment-checklist-empty {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.deployment-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.14);
}

.deployment-checklist-icon {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 800;
}

.deployment-checklist-item.done .deployment-checklist-icon {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.13);
    color: #86efac;
}

.deployment-checklist-copy strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-main);
    font-size: 0.88rem;
}

.deployment-checklist-copy small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.4;
}

.deployment-template-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.deployment-template-actions .btn-secondary {
    width: auto;
    min-width: 190px;
    margin: 0;
}

.delayed-recovery-section {
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 38%),
        rgba(255, 255, 255, 0.025);
}

.delayed-recovery-switch {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    padding: 9px 12px;
    margin: 0;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.08);
    color: #fde68a;
    font-size: 0.8rem;
    cursor: pointer;
}

.delayed-recovery-switch input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #f59e0b;
}

.delayed-recovery-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr);
    gap: 16px;
    margin-top: 18px;
}

.delayed-recovery-grid .input-group {
    margin: 0;
}

.delayed-recovery-grid small {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.delayed-recovery-warning {
    padding: 11px 13px;
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.14);
    font-size: 0.78rem;
    line-height: 1.45;
}

.delayed-recovery-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.delayed-recovery-actions .btn-primary,
.delayed-recovery-actions .btn-secondary {
    width: auto;
    min-width: 180px;
    margin: 0;
}

.learned-knowledge-editor {
    min-height: 390px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.knowledge-editor-help {
    display: block;
    margin-top: 9px;
    color: var(--text-muted);
    font-size: 0.77rem;
    line-height: 1.45;
}

.knowledge-editor-help code {
    color: #fca5a5;
}

.knowledge-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.knowledge-actions .btn-primary {
    width: auto;
    min-width: 260px;
    margin: 0;
}

.api-settings-section {
    margin-top: 28px;
    background: rgba(0, 0, 0, 0.16);
}

.api-key-current {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.api-key-current > span,
.api-key-form > label {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.api-key-current code {
    color: #86efac;
    font-family: Consolas, monospace;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.api-key-current code.not-configured {
    color: #fcd34d;
}

.api-key-current small,
.api-key-form > small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.api-key-input-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 7px;
}

.api-key-input-row input {
    min-width: 0;
}

.api-key-toggle {
    width: auto;
    min-width: 76px;
    margin: 0;
}

.api-key-message {
    padding: 11px 13px;
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.api-key-message.info {
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.1);
}

.api-key-message.success {
    color: #86efac;
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
}

.api-key-message.error {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

@media (max-width: 720px) {
    .settings-card,
    .settings-section {
        padding: 18px;
    }

    .delayed-recovery-grid {
        grid-template-columns: 1fr;
    }

    .delayed-recovery-switch {
        width: 100%;
    }

    .delayed-recovery-actions .btn-primary,
    .delayed-recovery-actions .btn-secondary {
        width: 100%;
    }

    .company-info-grid {
        grid-template-columns: 1fr;
    }

    .company-info-grid .input-group.full {
        grid-column: auto;
    }

    .deployment-checklist {
        grid-template-columns: 1fr;
    }

    .settings-section-heading {
        flex-direction: column;
    }

    .knowledge-actions .btn-primary {
        width: 100%;
        min-width: 0;
    }

    .learned-knowledge-editor {
        min-height: 320px;
    }
}

.big-btn {
    flex: 1 1 0px;
    /* Force strict equality */
    width: 0;
    /* Ignore content width */
    min-width: 0;
    /* Prevent overflow */
    margin: 0;
    /* Override primary/secondary margins */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    height: 100%;
    /* Ensure full height if container stretches */
}

.big-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Update Primary to match secondary style but with accent color on hover */
.big-btn.btn-primary {
    /* Remove distinct background to match others */
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--glass-border);
}

.big-btn.btn-primary:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(100, 108, 255, 0.2);
    background: rgba(100, 108, 255, 0.05);
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--text-color);
}

/* Keep the icon circle highlighted for primary, or make it uniform? 
   User said "fora do padrao", implying they want uniformity.
   Let's keep the circle colored to distinguish intended action but remove the button BG.
*/
.big-btn.btn-primary .icon-circle {
    background: var(--primary-color);
    color: white;
}

/* Manage Numbers Header */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.btn-icon-small {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Whitelist Section */
.whitelist-section {
    margin-top: 10px;
}

#numbers-step {
    padding: 28px;
}

#numbers-step .whitelist-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

#numbers-step .whitelist-panel {
    display: none;
}

.dashboard-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.analytics-panel {
    min-width: 0;
}

.manual-client-form {
    margin: 18px 0;
    padding: 18px;
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 16px;
    background: rgba(248, 113, 113, 0.055);
}

.manual-client-form-header {
    margin-bottom: 14px;
}

.manual-client-form-header h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.manual-client-form-header span {
    color: var(--text-muted);
    font-size: 0.83rem;
}

.manual-client-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
}

.manual-client-grid .full {
    grid-column: 1 / -1;
}

.manual-client-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.manual-client-actions .schedule-message {
    flex: 1;
    margin: 0;
}

.admin-commercial-card {
    width: 100%;
    padding: 28px;
}

.admin-commercial-card > .dashboard-panel + .dashboard-panel {
    margin-top: 18px;
}

.system-users-panel {
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.1), transparent 36%),
        rgba(255, 255, 255, 0.03);
}

.compact-heading {
    margin-top: 18px;
}

.admin-commercial-card .manual-client-form {
    margin-bottom: 0;
}

.admin-commercial-card .manual-client-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-commercial-card .manual-client-actions button {
    width: auto;
    min-width: 210px;
    margin: 0;
}

.business-account-list {
    max-height: 460px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.system-user-list,
.whatsapp-account-list {
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.business-account-card,
.system-user-card {
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.12), transparent 34%),
        rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.business-account-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.business-account-main strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
}

.business-account-main span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.business-status {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 6px 10px;
    color: #bfdbfe;
    border: 1px solid rgba(96, 165, 250, 0.35);
    background: rgba(59, 130, 246, 0.12);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.business-status.disabled,
.business-status.suspended,
.business-status.cancelled {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(127, 29, 29, 0.22);
}

.account-tenant-label {
    display: block;
    margin-top: -6px;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.business-account-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
}

.business-account-grid div {
    min-width: 0;
}

.business-account-grid label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.business-account-grid span {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
    line-height: 1.4;
}

.business-account-grid .full {
    grid-column: 1 / -1;
}

.business-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.business-account-actions button {
    flex: 1 1 150px;
    margin: 0;
}

.whitelist-panel {
    position: sticky;
    top: 24px;
}

.section-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.section-heading h3 {
    margin: 0;
    font-size: 1rem;
}

.section-heading span {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.client-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.summary-card {
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.summary-card.primary {
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.12);
}

.summary-card.success {
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.14);
}

.summary-card.warning {
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.16);
}

.summary-card.neutral {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.summary-value {
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.filter-shell {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 16px;
}

.filter-shell-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.filter-shell-header strong {
    font-size: 0.98rem;
}

.filter-shell-header span {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.client-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.client-filters input,
.client-filters button,
.client-filters select {
    width: 100%;
}

.client-filters button {
    margin: 0;
}

.client-registry-list {
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.client-card {
    background:
        radial-gradient(circle at top right, rgba(248, 113, 113, 0.12), transparent 34%),
        rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.client-card-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-card-header strong {
    font-size: 1rem;
}

.client-card-header span {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.9rem;
}

.client-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.client-badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.client-badge.complete {
    color: #86efac;
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.14);
}

.client-badge.pending {
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.12);
}

.client-badge.info {
    color: #fda4af;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.14);
}

.client-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.client-card-grid div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-card-grid div.full {
    grid-column: 1 / -1;
}

.client-card-grid label {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.client-card-grid span {
    font-size: 0.92rem;
    line-height: 1.4;
}

.client-observation-input {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.92rem;
}

.client-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.client-card-actions button {
    flex: 1 1 150px;
    margin: 0;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.45);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.26);
}

@media (max-width: 520px) {
    .admin-commercial-card {
        padding: 18px;
    }

    .admin-commercial-card .manual-client-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-commercial-card .manual-client-actions button {
        width: 100%;
        min-width: 0;
    }

    .business-account-main {
        flex-direction: column;
    }

    .business-account-grid {
        grid-template-columns: 1fr;
    }

    .business-account-grid .full {
        grid-column: auto;
    }

    .business-account-actions {
        flex-direction: column;
    }

    .holiday-panel-header {
        flex-direction: column;
    }

    .holiday-block-control {
        width: 100%;
        white-space: normal;
    }

    .holiday-list {
        grid-template-columns: 1fr;
    }
    .manual-client-grid {
        grid-template-columns: 1fr;
    }

    .manual-client-grid .full {
        grid-column: auto;
    }

    .manual-client-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .client-filters {
        grid-template-columns: 1fr;
    }

    .client-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-summary,
    .client-card-grid {
        grid-template-columns: 1fr;
    }

    .client-card-actions {
        flex-direction: column;
    }
}

@media (max-width: 980px) {
    body.analytics-mode .main-container {
        max-width: 100%;
    }

    body.commercial-admin-mode .main-container {
        max-width: 100%;
    }

    .business-account-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #numbers-step .whitelist-section {
        grid-template-columns: 1fr;
    }

    .whitelist-panel {
        position: static;
    }

    .client-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.whitelist-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whitelist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1rem;
}

.btn-delete {
    background: none;
    border: none;
    color: #ef4444;
    /* red */
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.add-number-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.add-number-group input {
    flex: 1;
}

.btn-icon {
    width: 46px;
    height: 46px;
    /* Match input height roughly */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon.highlight {
    background: var(--primary-color);
    border: none;
}

.btn-icon.highlight:hover {
    background: #535bf2;
    /* lighter shade matching primary logic */
    transform: scale(1.05);
}

.empty-msg {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Action Buttons Group */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.action-buttons button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
    /* Override generic margin */
    padding: 12px;
}

.action-buttons svg {
    min-width: 20px;
}
