:root {
    /* ---- Brand: International Orange ---- */
    --orange-50: #fef5ee;
    --orange-100: #fde9d7;
    --orange-200: #fbcead;
    --orange-300: #f8ac79;
    --orange-400: #f48043;
    --orange-500: #f05614;
    --orange-600: #e24414;
    --orange-700: #bb3213;
    --orange-800: #952817;
    --orange-900: #782416;
    --orange-950: #410f09;

    /* ---- Neutrals (warm) ---- */
    --neutral-0: #ffffff;
    --neutral-50: #fafaf9;
    --neutral-100: #f5f5f4;
    --neutral-150: #eeeeec;
    --neutral-200: #e7e5e4;
    --neutral-300: #d6d3d1;
    --neutral-400: #a8a29e;
    --neutral-500: #78716c;
    --neutral-600: #57534e;
    --neutral-700: #44403c;
    --neutral-800: #292524;
    --neutral-900: #1c1917;

    /* ---- Semantic ---- */
    --success-500: #16a34a;
    --success-bg: #dcfce7;
    --danger-500: #ef4444;
    --danger-bg: #fee2e2;
    --warning-500: #f59e0b;
    --warning-bg: #fef3c7;
    --info-500: #3b82f6;
    --info-bg: #dbeafe;

    /* ---- Surfaces ---- */
    --bg-body: #f7f6f4;
    --bg-sidebar: var(--neutral-0);
    --bg-card: var(--neutral-0);
    --bg-input: var(--neutral-100);
    --bg-muted: var(--neutral-50);

    /* ---- Text ---- */
    --text-primary: var(--neutral-900);
    --text-secondary: var(--neutral-500);
    --text-tertiary: var(--neutral-400);

    /* ---- Accents (used everywhere instead of hardcoded) ---- */
    --primary-color: var(--orange-500);
    --primary-hover: var(--orange-600);
    --primary-soft: rgba(240, 86, 20, 0.08);
    --primary-ring: rgba(240, 86, 20, 0.18);
    --danger-color: var(--danger-500);

    --border-color: var(--neutral-200);
    --border-strong: var(--neutral-300);

    /* ---- Shadows (layered, subtle) ---- */
    --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05), 0 1px 3px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 6px -2px rgba(28, 25, 23, 0.05), 0 2px 4px -2px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 12px 24px -6px rgba(28, 25, 23, 0.08), 0 4px 8px -4px rgba(28, 25, 23, 0.06);
    --shadow-xl: 0 24px 48px -12px rgba(28, 25, 23, 0.14);
    --shadow-brand: 0 6px 16px -4px rgba(240, 86, 20, 0.28);

    /* ---- Radii ---- */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* ---- Motion ---- */
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --duration: 180ms;

    /* ---- Layout ---- */
    --sidebar-width: 252px;
    --content-max: 1080px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 0.95rem;
    line-height: 1.5;
}

::selection {
    background-color: var(--primary-soft);
    color: var(--orange-900);
}

/* Light Orange Button (chip action) */
.btn-light-orange {
    background-color: var(--orange-500);
    color: #fff;
    border: none;
    padding: 11px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-xs);
}

.btn-light-orange:hover {
    background-color: var(--orange-600);
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

.btn-light-orange:active {
    transform: translateY(0);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.nav-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.logout-btn:hover {
    color: var(--danger-color) !important;
    background-color: var(--danger-bg);
}

.logout-btn:hover svg {
    stroke: var(--danger-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 10px 28px;
}

.logo img {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: var(--shadow-xs);
}

.logo span {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.4px;
    color: var(--text-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--neutral-600);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--duration) var(--ease);
    font-weight: 500;
    font-size: 0.92rem;
    position: relative;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: var(--neutral-100);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: var(--primary-soft);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-link.active svg {
    stroke: var(--primary-color);
}

.nav-link .icon {
    font-size: 1rem;
}

/* ---- Main Content ---- */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px 48px;
    max-width: calc(var(--content-max) + 96px);
    width: 100%;
}

.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ---- Cards ---- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    color: var(--neutral-700);
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.form-row {
    display: flex;
    gap: 12px;
}

input,
select,
textarea,
button {
    font-family: inherit;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="password"],
select {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    font-size: 0.95rem;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

input::placeholder,
textarea::placeholder {
    color: var(--neutral-400);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0);
    cursor: pointer;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2378716c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ---- Buttons ---- */
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.2;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-ring), var(--shadow-brand);
}

.btn-secondary,
.btn-template,
.file-upload-btn {
    background-color: var(--neutral-0);
    color: var(--neutral-700) !important;
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-xs);
}

.file-upload-btn .upload-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    font-size: 0.95rem;
}

.file-upload-btn .upload-icon-svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.file-upload-btn .upload-text {
    line-height: 1;
}

.btn-secondary:hover,
.btn-template:hover,
.file-upload-btn:hover {
    background-color: var(--neutral-50);
    border-color: var(--border-strong);
    color: var(--text-primary) !important;
}

/* File Name Box */
.file-name {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    background-color: var(--bg-input);
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--danger-bg);
    color: var(--danger-color);
}

/* Agendamento - Messages Area */
.messages-area {
    background-color: var(--bg-input);
    border-radius: 12px;
    padding: 20px;
    min-height: 100px;
}

/* Light Orange Button styles moved to top with variables */

/* Ajuste de altura igual para todos os botões da toolbar */
.control-row button,
.control-row .file-upload-btn {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.actions-group,
.actions-row,
.media-row,
.upload-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-group .file-upload-btn {
    width: 180px;
    justify-content: flex-start;
}

.message-controls .media-stack .upload-group {
    display: grid;
    grid-template-columns: 180px 190px 190px;
    column-gap: 10px;
    align-items: center;
}

.message-controls .media-stack .upload-group .file-upload-btn,
.message-controls .media-stack .upload-group .file-name,
.message-controls .media-stack .upload-group .btn-light-orange {
    width: 100%;
    margin: 0;
}

.message-controls {
    margin-top: 20px;
    padding-top: 0;
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-controls .control-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin: 0;
    min-height: 42px;
}

.message-controls .control-row > * {
    margin: 0;
}

.message-controls .media-stack {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message-controls .media-stack .media-row,
.message-controls .media-stack .document-row {
    margin: 0;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.msg-card {
    background-color: var(--bg-card);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
}

.msg-card p {
    flex: 1;
}

.msg-card img {
    max-height: 80px;
    border-radius: 4px;
}

/* File Upload rules moved to bottom */

input[type="file"] {
    display: none;
}

#file-name-display {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Contatos - Grid */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.contact-card {
    background-color: var(--bg-card);
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border-color);
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-xs);
}

.contact-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.3px;
    flex-shrink: 0;
    box-shadow: var(--shadow-brand);
}

.contact-card .info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.contact-card .info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.contact-card .btn-delete {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
}

.contact-card .btn-delete:hover {
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 25, 23, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 24px;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.modal-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--duration) var(--ease);
}

.btn-text:hover {
    color: var(--text-primary);
    background-color: var(--neutral-100);
}

/* Agendamentos List */
.fancy-list {
    list-style: none;
}

.schedule-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--primary-soft);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1px;
    margin-bottom: 8px;
    border: 1px solid rgba(240, 86, 20, 0.18);
}

.schedule-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.btn-edit-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all var(--duration) var(--ease);
}

.btn-edit-outline:hover {
    background-color: var(--primary-soft);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-delete-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all var(--duration) var(--ease);
}

.btn-delete-outline:hover {
    background-color: var(--danger-bg);
    border-color: var(--danger-500);
    color: var(--danger-500);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 0;
    font-style: italic;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Section Titles */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1px;
    border: 1px solid transparent;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.status-success {
    background-color: var(--success-bg);
    color: var(--success-500);
    border-color: rgba(22, 163, 74, 0.18);
}

.status-error {
    background-color: var(--danger-bg);
    color: var(--danger-500);
    border-color: rgba(239, 68, 68, 0.18);
}

/* History Item */
.schedule-item.history-item {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 16px 4px;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    transition: background-color var(--duration) var(--ease);
    opacity: 1;
}

.schedule-item.history-item:hover {
    background-color: var(--neutral-50);
}

.schedule-item.history-item:last-child {
    border-bottom: none;
}

.schedule-item.history-item .schedule-time {
    margin: 0;
    flex-shrink: 0;
}

.schedule-item.history-item .schedule-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.schedule-item.history-item .schedule-info h3 {
    font-size: 0.98rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.schedule-item.history-item .schedule-details {
    color: var(--text-secondary);
    font-size: 0.84rem;
    margin: 0;
    line-height: 1.3;
}

.schedule-item.history-item .status-badge {
    flex-shrink: 0;
    margin-left: auto;
}

@media (max-width: 640px) {
    .schedule-item.history-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .schedule-item.history-item .schedule-info {
        flex: 1 1 100%;
        order: 2;
    }

    .schedule-item.history-item .status-badge {
        margin-left: 0;
        order: 3;
    }
}

/* Templates List & Items */
.templates-list {
    max-height: 300px;
    overflow-y: auto;
}

.template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background-color: var(--neutral-50);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    border: 1px solid var(--border-color);
}

.template-item:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-soft);
    transform: translateY(-1px);
}

.template-info h4 {
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.template-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Textarea */
textarea {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    resize: vertical;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

textarea:hover {
    border-color: var(--border-strong);
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

/* ========================== */
/* Agendamentos - Visualização Expandida */
/* ========================== */

.schedule-item {
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: background-color var(--duration) var(--ease);
}

.schedule-item.expanded {
    background-color: var(--primary-soft);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(240, 86, 20, 0.18);
    margin-bottom: 12px;
}

.schedule-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color var(--duration) var(--ease);
    border-radius: var(--radius-lg);
    gap: 16px;
}

.schedule-header:hover {
    background-color: var(--neutral-50);
}

.schedule-info h3 {
    font-size: 1rem;
    margin: 8px 0 4px;
}

.schedule-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-expand {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--duration) var(--ease);
}

.btn-expand:hover {
    background-color: var(--neutral-50);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* Área de mensagens expandida */
.schedule-messages {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 20px;
}

.schedule-messages.show {
    max-height: 1500px;
    padding: 0 20px 20px;
    transition: max-height 0.5s ease-in, padding 0.3s ease-in;
}

.messages-container {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Items de mensagem na visualização */
.schedule-msg-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.schedule-msg-item .msg-index {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 24px;
}

.schedule-msg-item .msg-type {
    font-size: 1.1rem;
}

.schedule-msg-item .msg-content {
    flex: 1;
    word-break: break-word;
    line-height: 1.5;
}

.schedule-msg-item.img-msg {
    flex-direction: row;
    align-items: center;
}

.schedule-msg-img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s;
}

.schedule-msg-img:hover {
    transform: scale(1.02);
}

.schedule-msg-img.img-error {
    max-width: none;
    max-height: none;
    border: 2px dashed var(--danger-color);
    padding: 20px;
    background: rgba(255, 71, 87, 0.05);
    color: var(--danger-color);
    font-size: 0.9rem;
}

/* Texto mutado */
.text-muted {
    color: var(--text-secondary);
    font-style: italic;
}

/* ========================== */
/* Sistema de Notificação de Erros */
/* ========================== */

/* Banner de erros (fixo no topo) */
#error-container {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 999;
}

.error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--danger-500);
    color: var(--neutral-0);
    box-shadow: var(--shadow-md);
}

.error-icon {
    font-size: 1.5rem;
}

.error-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.error-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.error-count {
    font-size: 0.85rem;
    opacity: 0.9;
}

.btn-view-errors {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.btn-view-errors:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-close-banner {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
    transition: 0.2s;
}

.btn-close-banner:hover {
    opacity: 1;
}

/* Modal de erros */
.errors-modal-content {
    max-width: 600px;
    width: 90%;
}

.errors-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

.error-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--danger-color);
}

.error-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.error-message {
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-word;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    color: var(--neutral-0);
    font-weight: 500;
    font-size: 0.92rem;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    opacity: 0;
    transform: translateY(12px);
    transition: all var(--duration) var(--ease);
    border: 1px solid transparent;
    max-width: 420px;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    background: var(--danger-500);
    border-color: rgba(239, 68, 68, 0.5);
}

.toast-success {
    background: var(--success-500);
    border-color: rgba(22, 163, 74, 0.5);
}

.toast-info {
    background: var(--neutral-900);
    border-color: var(--neutral-700);
}

/* Date and time pickers */
.date-time-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 12px;
    align-items: stretch;
}

.picker-shell-date {
    min-width: 0;
}

.picker-shell-time {
    min-width: 0;
}

.picker-shell {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 14px;
    min-height: 58px;
    transition: all var(--duration) var(--ease);
    cursor: pointer;
}

.picker-shell:hover {
    border-color: var(--border-strong);
}

.picker-shell:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.picker-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1rem;
    background: var(--primary-soft);
    flex-shrink: 0;
}

.picker-copy {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.picker-copy small {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

#schedule-date,
#schedule-time {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1b2430;
    box-shadow: none;
    width: 100%;
    min-width: 0;
}

#schedule-date:focus,
#schedule-time:focus {
    outline: none;
    box-shadow: none;
}

.air-datepicker {
    font-family: 'Inter', sans-serif;
    border: 1px solid #d6d6d6;
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(24, 38, 56, 0.18);
    overflow: visible;
}

.air-datepicker:before {
    content: "";
    position: absolute;
    top: -8px;
    left: 120px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-left: 1px solid #d6d6d6;
    border-top: 1px solid #d6d6d6;
    transform: rotate(45deg);
}

.air-datepicker-nav {
    border-bottom: none;
    padding: 10px 14px 2px;
    min-height: 40px;
}

.air-datepicker-nav--title {
    font-size: 0;
    font-weight: 700;
    color: #1f2937;
}

.air-datepicker-nav--title i {
    font-style: normal;
    font-size: 2rem;
    font-weight: 800;
}

.air-datepicker-nav--action path {
    stroke: #1f2937;
    stroke-width: 2px;
}

.air-datepicker-body--day-name {
    color: #f28a25;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.air-datepicker-cell.-day- {
    font-weight: 500;
    color: #7f8792;
    border-radius: 50%;
}

.air-datepicker-cell.-other-month- {
    color: #c6cbd3;
}

.air-datepicker-cell.-focus- {
    background: #e8f2ff;
    color: #1a202c;
}

.air-datepicker-cell.-current- {
    color: #2f8de5;
    background: transparent;
}

.air-datepicker-cell.-selected-,
.air-datepicker-cell.-selected-.-focus- {
    background-color: #2b8ef3;
    color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(43, 142, 243, 0.35);
}

.air-datepicker-cell.-in-range- {
    background: rgba(43, 142, 243, 0.12);
}

.air-datepicker-buttons {
    border-top: 1px solid #eceff3;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
}

.air-datepicker-button {
    height: auto;
    border-radius: 0;
    border: none;
    color: #2f8de5;
    background: transparent;
    font-weight: 600;
    padding: 2px 0;
}

.air-datepicker-button:hover {
    background: transparent;
    color: #1268bf;
}

.air-datepicker--time {
    border-top: 1px solid #eceff3;
    padding: 8px 10px;
}

.air-datepicker-time--current {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.air-datepicker.-only-timepicker- {
    width: 228px;
}

/* Material-like custom time picker (light theme) */
.time-picker-modal {
    z-index: 1200;
}

.time-picker-card {
    width: 420px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border-radius: 28px;
    padding: 22px;
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.24);
}

.time-picker-title {
    margin: 0 0 14px 0;
    font-size: 1.05rem;
    color: #111111;
    font-weight: 600;
}

.time-picker-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.tp-chip {
    border: 1px solid #e6e6e6;
    background: #f4f4f5;
    color: #111111;
    border-radius: 12px;
    min-width: 88px;
    height: 72px;
    font-size: 2.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.tp-chip.tp-chip-active {
    background: #f48043;
    border-color: #f48043;
    color: #ffffff;
}

.tp-separator {
    font-size: 2rem;
    color: #212121;
    font-weight: 700;
    line-height: 1;
}

.time-picker-dial {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    border-radius: 50%;
    background: #f2f2f3;
    position: relative;
}

.tp-hand-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.tp-hand-line {
    stroke: #f48043;
    stroke-width: 3;
}

.tp-hand-dot {
    fill: #f48043;
}

.tp-hand-center {
    fill: #f48043;
}

.tp-clock-labels {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.tp-label {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #111111;
    font-size: 1.05rem;
    cursor: pointer;
}

.tp-label.tp-label-inner {
    font-size: 0.95rem;
    color: #3a3a3a;
}

.tp-label.tp-label-selected {
    background: #f48043;
    color: #ffffff;
    font-weight: 700;
}

.time-picker-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.time-picker-actions .btn-text {
    color: #111111;
    font-weight: 600;
}

.time-picker-actions .tp-confirm {
    color: #f05614;
}

/* Material-like custom date picker (light theme) */
.date-picker-modal {
    z-index: 1200;
}

.date-picker-card {
    width: 420px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.24);
    overflow: hidden;
}

.date-picker-head {
    padding: 22px;
    border-bottom: 1px solid #ececec;
}

.date-picker-title {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    color: #1f1f1f;
    font-weight: 600;
}

.date-picker-current-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.date-picker-current {
    font-size: 2.05rem;
    font-weight: 500;
    color: #111111;
    line-height: 1.1;
}

.date-picker-edit {
    border: none;
    background: transparent;
    color: #313131;
    font-size: 1.25rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.date-picker-edit:hover {
    background: #f6f6f7;
}

.date-picker-inline {
    padding: 12px 16px 6px;
}

.date-picker-inline .air-datepicker {
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.date-picker-inline .air-datepicker:before {
    display: none;
}

.date-picker-inline .air-datepicker-nav {
    padding: 2px 0 8px;
    border-bottom: none;
}

.date-picker-inline .air-datepicker-nav--title {
    font-size: 1.35rem;
    color: #1f1f1f;
}

.date-picker-inline .air-datepicker-nav--title i {
    font-size: 1.35rem;
    font-style: normal;
    font-weight: 600;
}

.date-picker-inline .air-datepicker-nav--action {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.date-picker-inline .air-datepicker-nav--action:hover {
    background: #f4f4f6;
}

.date-picker-inline .air-datepicker-body--day-name {
    color: #242424;
    font-size: 0.82rem;
}

.date-picker-inline .air-datepicker-body--day-names {
    display: grid;
    grid-template-columns: repeat(7, 40px);
    justify-content: space-between;
}

.date-picker-inline .air-datepicker-body--cells.-days- {
    display: grid;
    grid-template-columns: repeat(7, 40px);
    justify-content: space-between;
    row-gap: 6px;
}

.date-picker-inline .air-datepicker-body--day-name,
.date-picker-inline .air-datepicker-cell.-day- {
    width: 40px;
    max-width: 40px;
    height: 40px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
}

.date-picker-inline .air-datepicker-cell.-day- {
    color: #1e1e1e;
    border-radius: 50%;
}

.date-picker-inline .air-datepicker-cell.-other-month- {
    color: #b9bcc4;
}

.date-picker-inline .air-datepicker-cell.-focus- {
    background: #f9ede7;
    color: #111111;
}

.date-picker-inline .air-datepicker-cell.-current- {
    color: #d05719;
    border: 1px solid #f48043;
}

.date-picker-inline .air-datepicker-cell.-selected-,
.date-picker-inline .air-datepicker-cell.-selected-.-focus- {
    background: #f48043;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(240, 86, 20, 0.24);
}

.date-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 22px 18px;
}

.date-picker-actions .btn-text {
    color: #2b2b2b;
    font-weight: 600;
}

.date-picker-actions .tp-confirm {
    color: #f05614;
}

@media (max-width: 860px) {
    .date-time-grid {
        grid-template-columns: 1fr;
    }

    #schedule-date,
    #schedule-time {
        font-size: 0.95rem;
    }

    .time-picker-card {
        width: 100%;
        border-radius: 22px;
        padding: 18px;
    }

    .tp-chip {
        min-width: 74px;
        height: 60px;
        font-size: 1.9rem;
    }

    .date-picker-card {
        width: 100%;
        border-radius: 22px;
    }

    .date-picker-current {
        font-size: 1.6rem;
    }
}

.msg-card.doc-msg {
    align-items: center;
}

.msg-card.doc-msg a {
    color: var(--orange-700);
    font-weight: 600;
    text-decoration: none;
}

.msg-card.doc-msg a:hover {
    text-decoration: underline;
}

.schedule-doc-link {
    color: var(--orange-700);
    font-weight: 600;
    text-decoration: none;
}

/* Drag & Drop */
.msg-card {
    cursor: grab;
}
.msg-card.dragging {
    opacity: 0.4;
    cursor: grabbing;
}
.msg-card.drag-over {
    border: 2px dashed var(--primary-color);
    background-color: var(--bg-input);
}
.drag-handle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

/* Textarea na área de mensagens */
.message-controls textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.schedule-doc-link:hover {
    text-decoration: underline;
}

/* ==================== */
/* Login Page           */
/* ==================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(1200px 600px at 90% -10%, rgba(240, 86, 20, 0.12), transparent 60%),
        radial-gradient(800px 400px at -10% 110%, rgba(240, 86, 20, 0.08), transparent 60%),
        var(--bg-body);
}

.login-shell {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.login-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: 36px 32px 32px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.4s var(--ease);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-brand);
    object-fit: cover;
}

.login-header h1 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin: 0;
}

.login-header p {
    color: var(--text-secondary);
    margin-top: 6px;
    font-size: 0.92rem;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form input {
    padding: 12px 14px;
    font-size: 0.95rem;
}

.login-submit {
    width: 100%;
    padding: 13px 22px;
    margin-top: 8px;
    font-size: 0.95rem;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger-500);
    padding: 11px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.88rem;
    font-weight: 500;
}

.login-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.login-footer {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    letter-spacing: 0.1px;
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 22px 24px;
    }

    .login-header img {
        width: 56px;
        height: 56px;
    }

    .login-header h1 {
        font-size: 1.35rem;
    }
}

/* ==================== */
/* Generic Responsive   */
/* ==================== */
@media (max-width: 860px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        overflow-x: auto;
    }

    .logo {
        margin: 0 8px 0 4px;
    }

    .nav-links {
        flex-direction: row;
        flex: 1;
    }

    .nav-footer {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        border-left: 1px solid var(--border-color);
        padding-left: 12px;
    }

    .app-container {
        flex-direction: column;
    }

    .content {
        margin-left: 0;
        padding: 24px 20px;
    }

    #error-container {
        left: 0;
    }
}
