/* Main container styles */
.admin-panel-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 0 1.25rem;
}

/* Header container with logo and user menu */
.app-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    margin-top: -1.2rem;
    position: relative;
    padding: 0 1.25rem;
}

/* Logo container - centered at the top */
.app-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    box-sizing: border-box;
}

.app-logo {
    width: 20rem;
    display: block;
}

/* Tab navigation styles */
.admin-nav-tabs {
    border-bottom: none;
}
.admin-nav-tabs .lm-TabBar,
.admin-nav-tabs .p-TabBar {
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Hide tab content during transitions to prevent ghost state */
.admin-nav-tabs .p-TabBar-content > .p-TabBar-content > .p-Widget.tab-resetting {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transition: none !important;
}

/* Hide all tab content immediately when transitioning */
.admin-nav-tabs.tab-transitioning .p-TabBar-content > .p-TabBar-content > .p-Widget {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Ensure Output widgets in tabs can be hidden */
.admin-nav-tabs .p-TabBar-content .widget-output {
    transition: opacity 0.05s;
}
.admin-nav-tabs .lm-TabBar-tab::before,
.admin-nav-tabs .p-TabBar-tab::before {
    background: transparent !important;
}
.admin-nav-tabs .lm-TabBar-tab.lm-mod-current::before,
.admin-nav-tabs .p-TabBar-tab.p-mod-current::before {
    background: #125530 !important;
}
.admin-nav-tabs .lm-TabBar-tab,
.admin-nav-tabs .p-TabBar-tab {
    border-bottom: 0.125rem solid transparent;
    color: #666;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.admin-nav-tabs .lm-TabBar-tab:hover,
.admin-nav-tabs .p-TabBar-tab:hover {
    color: #125530;
}
.admin-nav-tabs .lm-TabBar-tab.lm-mod-current,
.admin-nav-tabs .p-TabBar-tab.p-mod-current {
    border-bottom: 0.125rem solid #125530;
    color: #125530;
    font-weight: 600;
}

/* Section headers */
.section-header {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 0.125rem solid #125530;
}

/* Content containers */
.content-container {
    padding: 1.25rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    margin: 0.625rem 0;
    width: 100%;
    box-sizing: border-box;
}

/* Override default ipywidgets overflow to prevent unwanted scrollbars */
.admin-panel-container .widget-box,
.admin-panel-container .widget-vbox,
.admin-panel-container .widget-hbox {
    overflow: visible !important;
}


/* Buttons */
.btn-primary {
    background-color: #437b56;
    color: white;
    border: solid 1px rgb(54, 98, 69, .5);
    padding: 0.5rem 1rem;
    display: inline-block;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 500;
    line-height: normal;
    height: 100%;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: white;
    color: #437b56;
    border: solid 1px rgb(54, 98, 69, .5);
    box-shadow: none !important;
    transform: translateY(-3px);
}

.btn-primary:active, .btn-primary:focus {
    outline: none !important;
    background-color: white;
    border: solid 1px rgb(54, 98, 69, .5);
    color: #437b56;
    box-shadow: none !important;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: solid 1px rgb(146, 11, 25, .5);
    padding: 0.5rem 1rem;
    display: inline-block;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 500;
    line-height: normal;
    height: 100%;
    transition: all 0.2s;
}

.btn-danger:hover {
    box-shadow: none !important;
    transform: translateY(-3px);
    border: solid 1px rgb(146, 11, 25, .5);
    background-color: white;
    color: #dc3545;
}
.btn-danger:active, .btn-danger:focus {
    outline: none !important;
    background-color: white;
    color: #dc3545;
    border: solid 1px rgb(146, 11, 25, .5);
    box-shadow: none !important;
}

.btn-secondary {
    background-color: #888e94;
    color: white;
    border: solid 1px rgb(108, 117, 125, .5);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 500;
    line-height: normal;
    height: 100%;
    transition: all 0.2s;
}

.btn-secondary:hover {
    box-shadow: none !important;
    transform: translateY(-3px);
    background-color: white;
    border: solid 1px rgb(108, 117, 125, .5);
    color: #6c757d;
}

.btn-secondary:active, .btn-secondary:focus {
    outline: none !important;
    background-color: white;
    border: solid 1px rgb(108, 117, 125, .5);
    color: #6c757d;
    box-shadow: none !important;
}
/* Tenant selector */
.tenant-selector {
    width: 100%;
    max-width: 25rem;
}

.tenant-selector-row {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem;
}

.tenant-selector-label {
    font-weight: 600;
    font-size: 1.0625rem;
    color: #2d2d2d;
    margin: 0;
}

.tenant-selector .widget-dropdown,
.tenant-selector select {
    width: 100%;
    font-size: 1rem;
    border-radius: 0.5rem;
}

.tenant-selector .widget-dropdown:hover,
.tenant-selector select:hover {
    cursor: pointer;
}

.tenant-selector .widget-dropdown:focus,
.tenant-selector select:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #bdbdbd !important;
}

/* Create user button trigger */
.create-user-button-container {
    display: flex;
    justify-content: center;
    padding: 0 0 0.75rem 0;
    width: 100%;
}

/* User creation form */
.user-form-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    padding: 0.625rem 0;
    box-sizing: border-box;
}

.user-form-card {
    width: 100%;
    max-width: 28.75rem;
    padding: 1.5rem;
    border: 0.0625rem solid #bbb;
    border-radius: 0.5rem;
    background: #fff;
    gap: 1rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.user-form-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #2d2d2d;
    text-align: center;
}

.user-form-field {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.user-form-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
}

.user-form-label {
    font-weight: 600;
    font-size: 1rem;
    color: #2d2d2d;
    margin: 0;
    min-width: 3rem;
    flex-shrink: 0;
    flex-basis: 3rem;
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
}

/* Special styling for "Alterar senha?" label to show full text */
.change-password-label {
    min-width: auto !important;
    flex-basis: auto !important;
    white-space: nowrap;
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
}

/* Reduce gap between email field and checkbox field */
.change-password-checkbox-field {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Password field container - reserve space when hidden */
.password-field-container {
    min-height: 3rem; /* Reserve space for the password row */
    transition: opacity 0.2s ease;
    overflow: hidden; /* Prevent content from showing when hidden */
}

/* When hidden, use opacity to hide but keep space reserved */
.password-field-container.hidden,
.password-field-container[style*="visibility: hidden"] {
    opacity: 0 !important;
    pointer-events: none !important;
}

.password-field-container:not(.hidden):not([style*="visibility: hidden"]) {
    opacity: 1 !important;
}

.user-form-card .widget-label {
    font-weight: 500;
    color: #555;
}

.user-form-card .widget-text,
.user-form-card .widget-password {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
    width: 0; /* Force flex to control width */
}

.user-form-card > .widget-text,
.user-form-card > .widget-password,
.user-form-card > .widget-html,
.user-form-card > .widget-hbox {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.user-form-card .widget-hbox {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.user-form-card .widget-box,
.user-form-card .widget-vbox {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.user-form-field.widget-vbox {
    display: flex !important;
}

.user-form-card .widget-html {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.user-form-card .widget-text input,
.user-form-card .widget-password input {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    border: 0.0625rem solid #d6d6d6;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.user-form-card .widget-text input:focus,
.user-form-card .widget-password input:focus {
    outline: none;
    border-color: #437b56;
    box-shadow: 0 0 0 0.125rem rgba(41, 121, 255, 0.2);
}

.user-form-input > input {
    border-radius: 1rem;
}

/* Email validation styles */
.user-form-input.input-invalid > input {
    border-color: #c62828;
    background-color: #ffebee;
}

.user-form-input.input-invalid > input:focus {
    border-color: #c62828;
    box-shadow: 0 0 0 0.125rem rgba(198, 40, 40, 0.2);
}

/* Email error message - appears below input row without affecting input size */
/* Always reserve space to prevent layout shift */
.user-form-field .email-error-message {
    display: block !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    min-height: 1.75rem; /* Reserve space for error message */
    margin-top: 0.375rem;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    padding-left: calc(3rem + 0.375rem); /* Match label width + gap */
    padding-right: 0;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    box-sizing: border-box;
    transition: opacity 0.2s ease;
    overflow: hidden;
    clear: both;
}

.user-form-field .widget-html.email-error-message {
    display: block !important;
}

.email-error-message.email-error-hidden {
    opacity: 0;
    /* Keep min-height so space is always reserved - prevents layout shift */
    visibility: hidden;
}

.email-error-text {
    color: #c62828;
    margin: 0;
    padding: 0;
}

/* Password field styles */
.password-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.password-display {
    flex: 1;
    min-width: 0;
}

.password-display input {
    background-color: #f5f5f5;
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 0.1rem;
    cursor: default;
    text-align: center;
}

.password-regenerate-button {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    width: 12rem;
}

.user-form-message {
    min-height: 1.25rem;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    width: 100%;
    box-sizing: border-box;
}

.user-form-message .status-info {
    color: #0c7cd5;
}

.user-form-message .status-error {
    color: #c62828;
}

.user-form-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

/* Reports back button */
.reports-back-button {
    width: 12rem;
    height: 100%;
    margin: 0.625rem 1rem;
    border-radius: 1rem;
    font-size: 0.86rem;
    padding: 0.5rem 1rem;
}

/* Report form specific styles */
/* Wider form card for report creation */
.report-form-card {
    max-width: 50rem !important; /* Wider than user form (28.75rem) */
}

/* Labels that don't get cut off */
.report-form-label {
    min-width: auto !important;
    flex-basis: auto !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding-right: 0.75rem; /* Add some space between label and input */
}

/* Consistent input widths for all input types */
.report-form-input {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 0 !important; /* Force flex to control width */
    box-sizing: border-box !important;
    max-width: 100% !important;
}

/* Ensure all widget containers have consistent width in report form rows */
.report-form-card .user-form-row .widget-text,
.report-form-card .user-form-row .widget-textarea,
.report-form-card .user-form-row .widget-dropdown {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 0 !important; /* Force flex to control width */
    box-sizing: border-box !important;
    max-width: 100% !important;
}

/* Override any existing width settings on widget containers */
.report-form-card .user-form-row .widget-text[class*="report-form-input"],
.report-form-card .user-form-row .widget-textarea[class*="report-form-input"],
.report-form-card .user-form-row .widget-dropdown[class*="report-form-input"] {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Force all inputs in report form rows to have the same flex behavior */
.report-form-card .user-form-row > .widget-text,
.report-form-card .user-form-row > .widget-textarea,
.report-form-card .user-form-row > .widget-dropdown {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure text inputs use consistent width */
.report-form-input input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure textarea uses consistent width and styling */
.report-form-input textarea,
.report-form-input .widget-textarea textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.5rem 0.75rem !important;
    border: 0.0625rem solid #d6d6d6 !important;
    border-radius: 1rem !important;
    font-size: 0.875rem !important;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.report-form-input textarea:focus,
.report-form-input .widget-textarea textarea:focus {
    outline: none !important;
    border-color: #437b56 !important;
    box-shadow: 0 0 0 0.125rem rgba(41, 121, 255, 0.2) !important;
}

/* Ensure dropdown uses consistent width and styling */
.report-form-input select,
.report-form-input .widget-dropdown select,
.report-form-input .widget-dropdown > select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border: 0.0625rem solid #d6d6d6 !important;
    border-radius: 1rem !important;
    font-size: 0.875rem !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.5 !important;
    height: auto !important;
    vertical-align: middle !important;
}

.report-form-input select:focus,
.report-form-input .widget-dropdown select:focus,
.report-form-input .widget-dropdown > select:focus {
    outline: none !important;
    border-color: #437b56 !important;
    box-shadow: 0 0 0 0.125rem rgba(41, 121, 255, 0.2) !important;
}

/* Ensure dropdown widget itself has consistent width */
.report-form-card .widget-dropdown {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
}

/* Ensure dropdown widget container aligns content vertically */
.report-form-card .widget-dropdown,
.user-form-card .widget-dropdown {
    display: flex !important;
    align-items: center !important;
}

.report-form-card .widget-dropdown select,
.user-form-card .widget-dropdown select,
.report-form-card .widget-dropdown > select,
.user-form-card .widget-dropdown > select {
    line-height: 1.5 !important;
    height: auto !important;
    vertical-align: middle !important;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
    padding-left: 0.8rem !important;
}

/* Ensure checkbox widgets are vertically centered */
.user-form-row .widget-checkbox {
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
}

/* Invalid Report ID styling */
.report-form-input.input-invalid textarea,
.report-form-input.input-invalid select,
.report-form-input.input-invalid input {
    border-color: #c62828 !important;
    background-color: #ffebee !important;
}

.report-form-input.input-invalid textarea:focus,
.report-form-input.input-invalid select:focus,
.report-form-input.input-invalid input:focus {
    border-color: #c62828 !important;
    box-shadow: 0 0 0 0.125rem rgba(198, 40, 40, 0.2) !important;
}

/* Error message with bullet list */
.user-form-message .status-error {
    background-color: #ffebee;
    border: 0.0625rem solid #c62828;
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
}

.user-form-message .status-error p {
    margin: 0 0 0.5rem 0;
    color: #c62828;
    font-weight: 600;
}

.user-form-message .status-error ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
    list-style-type: disc;
    color: #c62828;
}

.user-form-message .status-error li {
    margin: 0.25rem 0;
    color: #c62828;
}

/* User access list styling for report form */
.user-access-list-container {
    margin-top: 0.5rem;
    padding: 0 1rem;
    background-color: #f9f9f9;
    border: 0.0625rem solid #e0e0e0;
    border-radius: 0.5rem;
    height: 15rem !important; /* Fixed height */
    max-height: 15rem !important; /* Fixed max height */
    min-height: 15rem !important; /* Minimum height when visible */
    overflow-y: auto !important; /* Vertical scrollbar when content overflows */
    overflow-x: hidden !important; /* Prevent horizontal scroll */
    box-sizing: border-box !important;
    flex-shrink: 0 !important; /* Prevent shrinking */
    flex-grow: 0 !important; /* Prevent growing */
}

/* Ensure the VBox inside respects the overflow */
.user-access-list-container.widget-vbox {
    height: 15rem !important;
    max-height: 15rem !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Ensure child elements don't break out */
.user-access-list-container > * {
    flex-shrink: 0;
    min-width: 0;
}

/* Hide the container when not needed */
.user-access-list-container.hidden,
.user-access-list-container[style*="display: none"],
.user-access-list-container[style*="visibility: hidden"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.user-access-row {
    padding: 0.5rem 0;
    border-bottom: 0.0625rem solid #e8e8e8;
}

.user-access-row:last-child {
    border-bottom: none;
}

.user-access-checkbox {
    width: 100%;
}

.user-access-checkbox .widget-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-access-checkbox label {
    margin: 0;
    font-weight: 400;
    color: #2d2d2d;
    cursor: pointer;
}

/* "Todos" checkbox styling - bold text */
.select-all-checkbox label {
    font-weight: 700 !important; /* Bold text */
    color: #2d2d2d;
}

.select-all-row {
    border-bottom: 0.125rem solid #c0c0c0 !important; /* Thicker border to separate "Todos" */
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
}

/* Checkbox checked state - background color */
input[type="checkbox"]:checked {
    background-color: #437b56 !important;
    border-color: #437b56 !important;
}

/* Ensure checkbox background color is applied */
.widget-checkbox input[type="checkbox"]:checked,
.user-access-checkbox input[type="checkbox"]:checked,
.select-all-checkbox input[type="checkbox"]:checked,
.change-password-checkbox input[type="checkbox"]:checked {
    background-color: #437b56 !important;
    border-color: #437b56 !important;
    accent-color: #437b56 !important;
}


/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0.9375rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.data-table th {
    background-color: #437b56;
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-right: 0.0625rem solid #2f5a3d;
    border-top: 0.0625rem solid #2f5a3d;
}

.data-table th:first-child {
    border-left: 0.0625rem solid #2f5a3d;
}

.data-table th:last-child {
    border-right: 0.0625rem solid #2f5a3d;
}

.data-table thead tr:first-child th:first-child {
    border-top-left-radius: 0.5rem;
}

.data-table thead tr:first-child th:last-child {
    border-top-right-radius: 0.5rem;
}

.data-table tr {
    height: 3rem;
    min-height: 3rem;
    max-height: 3rem;
}

.data-table td {
    height: 3rem;
    min-height: 3rem;
    max-height: 3rem;
    padding: 0.625rem 0.75rem;
    border-bottom: 0.0625rem solid #ddd;
    border-right: 0.0625rem solid #e0e0e0;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    box-sizing: border-box;
}

.data-table td:first-child {
    border-left: 0.0625rem solid #e0e0e0;
}

.data-table td:last-child {
    border-right: 0.0625rem solid #e0e0e0;
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

/* Action buttons container in table cells */
.data-table .action-buttons-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    height: 100%;
    max-height: 3rem;
    box-sizing: border-box;
}

/* Icon buttons in tables */
.data-table .btn-icon {
    background-color: transparent;
    border: 0.0625rem solid #ddd;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    box-sizing: border-box;
    flex-shrink: 0;
}

.data-table .btn-icon:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

/* Coluna de ordem: a posição fica ENTRE as setas, porque é o que elas mexem.
   Note que o <td> em si NÃO é flex — .action-buttons-cell é, e dois <td> flex
   na mesma linha se empilham e esticam a altura. Aqui o flex é no <span>. */
.data-table .order-col {
    width: 8rem;
    text-align: center;
    white-space: nowrap;
}

.data-table .order-controls {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
}

.data-table .order-controls form {
    display: inline;
    margin: 0;
}

.data-table .order-position {
    min-width: 1.25rem;
    font-variant-numeric: tabular-nums;
    color: #555;
}

/* Setas de ordenação nas pontas da lista (↑ no primeiro, ↓ no último). */
.data-table .btn-icon:disabled,
.data-table .btn-icon:disabled:hover {
    color: #c4c4c4;
    border-color: #e4e4e4;
    background-color: transparent;
    cursor: default;
}

.data-table .btn-icon-delete {
    color: #dc3545;
    border-color: #dc3545;
}

.data-table .btn-icon-delete:hover {
    background-color: #dc3545;
    color: white;
}

.data-table .btn-icon-view {
    color: #437b56;
    border-color: #437b56;
}

.data-table .btn-icon-view:hover {
    background-color: #437b56;
    color: white;
}

.data-table .btn-icon-edit {
    color: #007bff;
    border-color: #007bff;
}

.data-table .btn-icon-edit:hover {
    background-color: #007bff;
    color: white;
}

.data-table .btn-icon-grant {
    color: #28a745;
    border-color: #28a745;
}

.data-table .btn-icon-grant:hover {
    background-color: #28a745;
    color: white;
}

.data-table .btn-icon-revoke {
    color: #dc3545;
    border-color: #dc3545;
}

.data-table .btn-icon-revoke:hover {
    background-color: #dc3545;
    color: white;
}

.data-table .btn-icon-order {
    color: #17a2b8;
    border-color: #17a2b8;
}

.data-table .btn-icon-order:hover {
    background-color: #17a2b8;
    color: white;
}

/* SVG icons in buttons */
.data-table .btn-icon svg {
    display: block;
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.reports-table-container {
    width: 100%;
}

.reports-table-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0 0 0.9375rem;
    color: #2d2d2d;
}

.reports-table-title strong {
    font-weight: 600 !important;
}

.reports-table-title__tenant {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.9375rem;
    color: #2d2d2d;
}

.reports-tenant {
    font-size: 1.3rem;
    font-weight: 600;
    color: #125530;
    margin: 1rem .5rem;
}


.status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 0.0625rem solid #f5c6cb;
    padding: 0.3rem 0.8rem;
}

.status-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 0.0625rem solid #bee5eb;
    padding: 0.3rem 0.8rem;
}


/* Prevent scrolling when modal is open */
body.modal-open,
html.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000 !important;
    justify-content: center;
    align-items: center;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 31.25rem;
    width: 90%;
    box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.modal-header {
    margin-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.modal-body {
    margin-bottom: 1.5rem;
    color: #666;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-footer button {
    min-width: 5rem;
}

/* Utility helpers */
.hidden-widget {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.is-hidden {
    display: none !important;
}

.modal-warning-text {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.modal-content .modal-input-field {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    border: 0.0625rem solid #d6d6d6;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    box-sizing: border-box;
}

.modal-content .modal-input-field:focus {
    outline: none;
    border-color: #437b56;
    box-shadow: 0 0 0 0.125rem rgba(41, 121, 255, 0.2);
}

/* Bold text in modal messages - override any conflicting styles */
.modal-bold-text {
    font-weight: bold !important;
}

/* User Info Component - positioned top right, fixed on scroll */
.user-info-container {
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 1000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* User button styling - dark olive green with rounded corners (pill shape) */
.user-info-button {
    background-color: #437b56 !important;
    color: white !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 9999px !important; /* Pill shape */
    border: solid 1px rgb(54, 98, 69, .5) !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    box-shadow: none !important;
    white-space: nowrap !important;
    height: auto !important;
    min-width: auto !important;
}

.user-info-button:hover,
.user-info-button:active,
.user-info-button:focus {
    outline: none !important;
    background-color: white !important;
    border: solid 1px rgb(54, 98, 69, .5) !important;
    color: #437b56 !important;
}

/* Style button text and icon */
.user-info-button .widget-button {
    color: white !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

/* Add spacing between icon and text */
.user-info-button .fa,
.user-info-button .jp-icon,
.user-info-button i[class*="fa-"],
.user-info-button svg {
    margin-right: 0.5rem !important;
}

/* Dropdown menu styling */
.user-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 0.5rem !important;
    background: white !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    min-width: 150px !important;
    overflow: hidden !important;
    z-index: 1001 !important;
}

/* Logout button styling */
.logout-button {
    background-color: transparent !important;
    color: #ff6b35 !important;
    padding: 0.75rem 1rem !important;
    border: 1px solid #ddd !important;
    border-radius: 1rem !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    text-align: left !important;
    width: 100% !important;
    font-size: 0.875rem !important;
}

.logout-button:hover,
.logout-button:active,
.logout-button:focus {
    outline: none !important;
    background-color: #e9ecef !important;
    color: #ff6b35 !important;
    box-shadow: none !important;
}

.logout-button .widget-button {
    color: #ff6b35 !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

/* Dropdown menu styling */
.user-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 0.5rem !important;
    background: white !important;
    border-radius: 1rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    z-index: 1000 !important;
    min-width: 120px !important;
    overflow: hidden !important;
}

/* Logout option styling */
.logout-option {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.75rem 1rem !important;
    cursor: pointer !important;
    color: #dc3545 !important;
    transition: background-color 0.2s !important;
    font-weight: 500 !important;
}

.logout-option:hover {
    background-color: #f8f9fa !important;
}

.logout-option:active {
    background-color: #e9ecef !important;
}

/* Hidden logout trigger */
.logout-trigger-input {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    visibility: hidden !important;
}


/* Login form styles - exclusive classes for login form */

.login-form-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    padding: 0.625rem 0;
    box-sizing: border-box;
}

.login-form-card {
    width: 100%;
    max-width: 28.75rem;
    padding: 2rem 1.5rem;
    border: 0.0625rem solid #bbb;
    border-radius: 0.5rem;
    background: #fff;
    gap: 1rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.login-form-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #2d2d2d;
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-form-field {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin-bottom: 1rem;
}

.login-form-field:last-of-type {
    margin-bottom: 0;
}

.login-form-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
}

.login-form-label {
    font-weight: 600;
    font-size: 1rem;
    color: #2d2d2d;
    margin: 0;
    min-width: 5rem;
    flex-shrink: 0;
    flex-basis: 5rem;
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
}

.login-form-input {
    flex: 1;
}

.login-form-input input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 0.0625rem solid #bbb;
    border-radius: 0.5rem;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
}

.login-form-input input:focus {
    outline: none;
    border-color: #437b56;
    box-shadow: 0 0 0 0.125rem rgba(67, 123, 86, 0.1);
}

.login-form-message {
    min-height: 2.5rem;
    display: flex;
    align-items: flex-start;
    width: 100%;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.login-form-message p {
    margin: 0;
    padding: 0.375rem 0.75rem;
    line-height: 1.4;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0.3rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.login-form-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0.5rem;
}


/* --- Flask UI additions --- */
body { margin: 0; background: #fff; }
.page { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        padding: 0 1.25rem 3rem; max-width: 70rem; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: center; position: relative;
          padding: 1.5rem 0 0.5rem; }
.topbar .app-logo { width: 14rem; }
.user-menu { position: absolute; right: 0; top: 1.5rem; font-size: 0.9rem; color: #555; }
.user-menu a { color: #437b56; text-decoration: none; margin-left: 0.75rem; font-weight: 600; }
.user-menu a:hover { text-decoration: underline; }
.nav-tabs { display: flex; gap: 0.5rem; border-bottom: 2px solid #e0e0e0; margin: 1rem 0 1.5rem; }
.nav-tabs a { padding: 0.6rem 1.1rem; text-decoration: none; color: #666; font-weight: 500;
              border-bottom: 2px solid transparent; margin-bottom: -2px; }
.nav-tabs a:hover { color: #125530; }
.nav-tabs a.active { color: #125530; font-weight: 600; border-bottom-color: #125530; }
.toolbar { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
a.btn-primary, a.btn-secondary, a.btn-danger { text-decoration: none; }
.flash-container { position: sticky; top: 0.5rem; z-index: 100; display: flex;
                    flex-direction: column; gap: 0.5rem; margin: 0.75rem 0; }
.flash { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem;
         border-radius: 0.5rem; box-shadow: 0 2px 10px rgba(0,0,0,0.12);
         font-weight: 500; transition: opacity 0.4s, transform 0.4s; }
.flash-success { background: #e6f4ea; color: #1e6b3a; border: 1px solid #b6dcc2; }
.flash-error { background: #fdecea; color: #b71c1c; border: 1px solid #f5c2c0; }
.flash-icon { font-size: 1.1rem; }
.flash-text { flex: 1; }
.flash-close { background: none; border: none; font-size: 1.2rem; line-height: 1;
               cursor: pointer; color: inherit; opacity: 0.6; padding: 0 0.2rem; }
.flash-close:hover { opacity: 1; }
.flash-fade-out { opacity: 0; transform: translateY(-0.5rem); }
.form-card { background: #f8f9fa; padding: 1.5rem; border-radius: 0.5rem; max-width: 32rem; }
.form-card h3 { margin-top: 0; color: #333; }
.form-field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.form-field label { font-weight: 600; color: #444; }
.form-field input[type=text], .form-field input[type=password], .form-field textarea, .form-field select {
    padding: 0.5rem 0.6rem; border: 1px solid #ccc; border-radius: 0.4rem; font-size: 0.95rem; }
.form-field.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.login-wrapper { display: flex; justify-content: center; margin-top: 3rem; }
.login-card { background: #f8f9fa; padding: 2rem; border-radius: 0.75rem; width: 22rem;
              box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.login-card h2 { margin-top: 0; text-align: center; color: #333; }
.muted { color: #777; }

/* ==========================================================================
   Layout v2 — menu lateral, animações e os componentes da seção Agente.
   2026-08-26.

   Carregado POR ÚLTIMO (ver _CSS_FILES em webapp/__init__.py), então o que
   estiver aqui vence o que veio antes. Foi feito assim de propósito: o
   layout antigo (duas fileiras de abas no topo) continua definido lá, e
   apagá-lo de dentro daquela string gigante era mais arriscado do que
   sobrescrever aqui.

   ⚠️ CSS é concatenado UMA VEZ no create_app(). Mexeu aqui, reinicie o
   serviço — recarregar a página mostra o estilo velho.
   ========================================================================== */

:root {
    --verde: #125530;
    --verde-claro: #437b56;
    --barra: #14231a;
    --barra-hover: #1e3527;
    --barra-texto: #c7d4cb;
    --borda: #e4e6e5;
    --transicao: 140ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------- estrutura */

body { margin: 0; background: #f6f7f7; }

/* .page virou o container flex do app inteiro. O max-width e o padding
   antigos saem daqui e passam para .conteudo. */
.page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0;
    max-width: none;
    margin: 0;
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.barra-lateral {
    width: 15rem;
    flex: 0 0 15rem;
    background: var(--barra);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.barra-topo { padding: 1.5rem 1.25rem 1rem; }
.barra-topo .app-logo { width: 100%; max-width: 10rem; }

.barra-lateral nav { flex: 1; overflow-y: auto; padding: 0.5rem 0.75rem; }

.grupo-titulo {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6f8578;
    padding: 1rem 0.75rem 0.35rem;
    font-weight: 700;
}

.barra-lateral nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.15rem;
    color: var(--barra-texto);
    text-decoration: none;
    border-radius: 0.4rem;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
    transition: background var(--transicao), color var(--transicao),
                border-color var(--transicao), transform var(--transicao);
}
.barra-lateral nav a:hover {
    background: var(--barra-hover);
    color: #fff;
    transform: translateX(2px);
}
.barra-lateral nav a.ativo {
    background: var(--barra-hover);
    color: #fff;
    font-weight: 600;
    border-left-color: #4ea36c;
}

.barra-rodape {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid #24382c;
    font-size: 0.85rem;
    color: var(--barra-texto);
}
.barra-rodape a { color: #7fc094; text-decoration: none; font-weight: 600; }
.barra-rodape a:hover { text-decoration: underline; }

.conteudo {
    flex: 1;
    min-width: 0;
    /* Sem teto de largura: o painel é feito de TABELAS largas, e limitar a
       78rem deixava um terço da tela em branco num monitor comum enquanto a
       tabela de solicitações rolava na horizontal. Texto corrido pediria um
       teto; tabela pede espaço. */
    max-width: none;
    padding: 1.5rem 1.75rem 3rem;
    animation: entrar 220ms ease-out;
}

@keyframes entrar {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* Telas estreitas: a barra vira uma faixa em cima. */
@media (max-width: 60rem) {
    .page { flex-direction: column; }
    .barra-lateral {
        width: auto; flex: none; height: auto; position: static;
        flex-direction: row; align-items: center; flex-wrap: wrap;
    }
    .barra-topo { padding: 0.75rem 1rem; }
    .barra-topo .app-logo { max-width: 7rem; }
    .barra-lateral nav { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem; }
    .grupo-titulo { display: none; }
    .barra-lateral nav a { border-left: none; border-bottom: 3px solid transparent; }
    .barra-lateral nav a.ativo { border-left-color: transparent; border-bottom-color: #4ea36c; }
    .barra-rodape { border-top: none; margin-left: auto; }
    .conteudo { padding: 1.25rem 1rem 3rem; }
}

/* -------------------------------------------------------------- animações */

.btn-primary, .btn-secondary, .btn-danger,
a.btn-primary, a.btn-secondary, a.btn-danger {
    transition: background var(--transicao), color var(--transicao),
                box-shadow var(--transicao), transform var(--transicao);
}
.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover,
a.btn-primary:hover, a.btn-secondary:hover, a.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.btn-primary:active, .btn-secondary:active, .btn-danger:active {
    transform: translateY(0);
    box-shadow: none;
}

.data-table tbody tr { transition: background var(--transicao); }
.data-table tbody tr:hover { background: #f2f6f3; }

input[type=text], input[type=number], input[type=password],
input[type=date], textarea, select {
    transition: border-color var(--transicao), box-shadow var(--transicao);
}
input[type=text]:focus, input[type=number]:focus, input[type=password]:focus,
input[type=date]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--verde-claro);
    box-shadow: 0 0 0 3px rgba(67, 123, 86, 0.15);
}

.content-container {
    animation: entrar 220ms ease-out;
    transition: box-shadow var(--transicao);
}

/* Quem pediu menos movimento no sistema não leva movimento nenhum. Sem
   isto, "animação" vira sintoma para quem tem sensibilidade a movimento. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .barra-lateral nav a:hover,
    .btn-primary:hover, .btn-secondary:hover, .btn-danger:hover { transform: none; }
}

/* ------------------------------------------------------------ componentes */

.pill {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    border-radius: 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.pill-on  { background: #e6f4ea; color: #1e6b3a; border: 1px solid #b6dcc2; }
.pill-off { background: #f1f1f1; color: #767676; border: 1px solid #dcdcdc; }

.tag {
    display: inline-block;
    padding: 0.08rem 0.45rem;
    margin: 0.1rem 0.15rem 0.1rem 0;
    background: #eef2ef;
    border: 1px solid #dbe4dd;
    border-radius: 0.3rem;
    font-size: 0.78rem;
    color: #3c5a48;
    white-space: nowrap;
}

.btn-mini { padding: 0.25rem 0.6rem !important; font-size: 0.82rem !important; }

/* GRADE, não flex-wrap. Com flex, quando o quarto cartão não cabia na
   linha ele descia sozinho e o `flex-grow` o esticava para a largura
   inteira -- uma faixa vazia gigante no meio da ficha. Na grade os
   cartões continuam do mesmo tamanho quando quebram de linha. */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0 0.5rem;
}
.card {
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: 0.6rem;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    transition: box-shadow var(--transicao), transform var(--transicao);
}
.card:hover { box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07); transform: translateY(-2px); }

/* --------------------------------------------------- densidade vertical
   O painel é ferramenta de trabalho: cabe mais coisa na tela sem rolar.
   Os títulos do tema antigo vinham com margens de texto de artigo. */
.section-header { margin: 1.25rem 0 0.5rem; }
h2.section-header { font-size: 1.35rem; }
h3.section-header { font-size: 1.05rem; }
.toolbar { margin-bottom: 0.35rem; }
.content-container { padding: 0.85rem 1rem; margin-bottom: 0.75rem; }
.data-table th, .data-table td { padding: 0.45rem 0.6rem; }
.conteudo > p.muted { margin: 0.35rem 0 0.75rem; }
.form-group { margin-bottom: 0.85rem; }
.card-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #8a8a8a; font-weight: 700; }
.card-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: #2c2c2c; }
.card-ok  { color: #2f5a3d; }
.card-bad { color: #b71c1c; }
.card .muted { font-size: 0.82rem; }

.grade-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    gap: 0.15rem 0.5rem;
    margin: 0.25rem 0;
}
.grade-checks.grade-larga { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }

.check-linha {
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
    font-weight: normal !important;
    padding: 0.25rem 0.35rem;
    border-radius: 0.3rem;
    cursor: pointer;
    transition: background var(--transicao);
}
.check-linha:hover { background: #eef2ef; }
.check-linha input { margin: 0; cursor: pointer; }

.linha-form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }

.linha-inativa td { opacity: 0.55; }

.content-container {
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: 0.6rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

/* ------------------------------------------------------------------ login */

.login-wrapper { display: flex; justify-content: center; align-items: center;
                 min-height: 100vh; margin: 0; padding: 1rem; }
.login-card {
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: 0.75rem;
    padding: 2rem;
    width: 22rem;
    max-width: 100%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
    animation: entrar 260ms ease-out;
}
.login-logo { width: 11rem; margin: 0 auto 0.35rem; display: block; }
.login-sub { color: #7a8a80; font-weight: 600; margin: 0 0 1.25rem; font-size: 0.95rem; }

.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: #fff;
    border: 1px solid #d0d5d2;
    border-radius: 0.5rem;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background var(--transicao), box-shadow var(--transicao),
                transform var(--transicao);
}
.btn-google:hover { background: #f7f9f8; box-shadow: 0 2px 8px rgba(0,0,0,0.10);
                    transform: translateY(-1px); }
.btn-google:active { transform: translateY(0); box-shadow: none; }

.login-nota { color: #8a8a8a; font-size: 0.8rem; margin: 0.6rem 0 0; }

.login-ou {
    display: flex; align-items: center; gap: 0.75rem;
    margin: 1.1rem 0 0.9rem; color: #a5aaa7; font-size: 0.8rem;
}
.login-ou::before, .login-ou::after {
    content: ''; flex: 1; height: 1px; background: var(--borda);
}

.login-card .form-field { text-align: left; }

/* -------------------------------------------------------------- conversas */

.lista-conversas { display: flex; flex-direction: column; gap: 0.4rem; }

.conversa-item {
    display: flex; gap: 0.75rem; align-items: flex-start;
    padding: 0.7rem 0.9rem;
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: 0.6rem;
    text-decoration: none;
    color: inherit;
    transition: background var(--transicao), box-shadow var(--transicao),
                transform var(--transicao);
}
.conversa-item:hover {
    background: #f7faf8;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.conversa-avatar {
    flex: 0 0 2.4rem; height: 2.4rem;
    border-radius: 50%;
    background: var(--verde-claro);
    color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.conversa-corpo { flex: 1; min-width: 0; }
.conversa-topo { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.conversa-hora { margin-left: auto; color: #8a8a8a; font-size: 0.82rem; white-space: nowrap; }
.conversa-previa {
    margin: 0.15rem 0;
    /* Uma linha só: a lista é para bater o olho, não para ler a conversa. */
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quem-bot     { color: var(--verde-claro); font-weight: 600; }
.quem-cliente { color: #7a5c1f; font-weight: 600; }
.conversa-rodape { font-size: 0.8rem; }

/* ------------------------------------------------------- a conversa em si */

.conversa-janela {
    display: flex; flex-direction: column; gap: 0.35rem;
    background: #f0f2f0;
    border: 1px solid var(--borda);
    border-radius: 0.6rem;
    padding: 1rem;
}

.dia-separador { display: flex; align-items: center; gap: 0.75rem; margin: 0.6rem 0 0.2rem; }
.dia-separador::before, .dia-separador::after { content: ''; flex: 1; height: 1px; background: #dcdfdc; }
.dia-separador span { font-size: 0.78rem; color: #8a8a8a; font-weight: 600; }

.balao-linha { display: flex; }
.balao-linha.do-cliente { justify-content: flex-start; }
.balao-linha.do-bot     { justify-content: flex-end; }

.balao {
    max-width: min(46rem, 78%);
    padding: 0.5rem 0.7rem 0.35rem;
    border-radius: 0.7rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    animation: entrar 200ms ease-out;
}
/* Cliente à esquerda em branco, bot à direita em verde -- a mesma convenção
   do próprio WhatsApp, para quem olha não precisar aprender outra. */
.do-cliente .balao { background: #fff;    border-top-left-radius: 0.2rem; }
.do-bot     .balao { background: #dcf2e3; border-top-right-radius: 0.2rem; }

.balao-tipo  { font-size: 0.72rem; color: #7a8a80; font-weight: 700; margin-bottom: 0.15rem; }
.balao-texto { white-space: pre-wrap; word-break: break-word; line-height: 1.35; }
.balao-hora  { font-size: 0.72rem; color: #8a8a8a; text-align: right; margin-top: 0.1rem; }

/* ---------------------------------------------------------------- custos */

.ativo-periodo { background: var(--verde) !important; color: #fff !important;
                 border-color: var(--verde) !important; }

/* Gráfico de barras sem biblioteca. O painel não tem uma única dependência
   de CDN, e não vale criar a primeira por causa de um gráfico de 30 barras.
   ⚠️ As colunas têm LARGURA MÁXIMA. Sem ela, com um único dia de dados a
   coluna esticava para a tela inteira e o gráfico virava um retângulo verde
   sem significado -- foi o que apareceu no primeiro dia de uso. */
.grafico-dias {
    display: flex; align-items: flex-end; gap: 4px;
    height: 8rem; padding: 0.75rem 1rem 0.5rem;
    background: #fff; border: 1px solid var(--borda); border-radius: 0.6rem;
    overflow-x: auto;
}
.coluna-dia {
    flex: 1 1 1.6rem;
    min-width: 1.4rem;
    max-width: 3rem;
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
    height: 100%;
}
.coluna-dia .barra {
    width: 100%; min-height: 3px;
    background: var(--verde-claro); border-radius: 3px 3px 0 0;
    transition: background var(--transicao);
}
/* Dia sem consumo continua aparecendo, como um traço. Sumir daria a impressão
   de que o dia não existiu, quando o que houve foi ninguém usar o bot. */
.coluna-dia.vazio .barra { background: #e0e4e1; }
.coluna-dia:hover .barra { background: var(--verde); }
/* Só o número do dia: "26/08" não cabe em 1,6rem e a versão girada se
   sobrepunha com a vizinha. A data inteira fica no tooltip. */
.rotulo-dia { font-size: 0.65rem; color: #9a9a9a; margin-top: 0.3rem; white-space: nowrap; }
.grafico-vazio { padding: 1.25rem; color: #8a8a8a; text-align: center;
                 background: #fff; border: 1px solid var(--borda);
                 border-radius: 0.6rem; font-size: 0.9rem; }

.bloqueados { margin-top: 0.5rem; }
.bloqueados summary { cursor: pointer; color: #8a8a8a; font-size: 0.85rem;
                      padding: 0.35rem 0; user-select: none; }
.bloqueados summary:hover { color: var(--verde-claro); }
