/**
 * Estilos Principais AMSHub
 * CSS base do sistema
 * Paleta: #001738 (azul escuro), #00b4f6 (azul brilhante), #d4d4d5 (cinza médio), #f1f0f0 (cinza claro), #305371 (azul cinza)
 */

/* ===== DESIGN TOKENS (prioridade visual unificada) ===== */
:root {
  --color-primary:       #001738;
  --color-primary-hover: #00b4f6;
  --color-secondary:     #305371;
  --color-accent:        #00b4f6;
  --color-success:       #10b981;
  --color-success-bg:    #d1fae5;
  --color-warning:       #f59e0b;
  --color-warning-bg:    #fef3c7;
  --color-danger:        #ef4444;
  --color-danger-bg:     #fee2e2;
  --color-white:         #ffffff;
  --color-bg:            #f1f5f9;
  --color-bg-card:       #ffffff;
  --color-border:        #e2e8f0;
  --color-border-light:  #f1f5f9;
  --color-text:          #1e293b;
  --color-text-secondary:#64748b;
  --color-text-muted:    #94a3b8;
  --font-family:         'Roboto', 'Segoe UI', sans-serif;
  --font-size-xs:        11px;
  --font-size-sm:        12px;
  --font-size-base:      14px;
  --font-size-lg:        16px;
  --font-size-xl:        18px;
  --font-weight-normal:  400;
  --font-weight-medium:  500;
  --font-weight-semibold:600;
  --font-weight-bold:    700;
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;
  --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0,23,56,0.08);
  --shadow-md: 0 4px 16px rgba(0,23,56,0.10);
  --shadow-lg: 0 8px 32px rgba(0,23,56,0.14);
  --transition: 0.18s ease;
  /* Legado — mantém módulos que usam --ams-* */
  --ams-blue-dark: var(--color-primary);
  --ams-blue-bright: var(--color-accent);
  --ams-blue: var(--color-accent);
  --ams-gray-medium: #d4d4d5;
  --ams-gray-light: #f1f0f0;
  --ams-blue-gray: var(--color-secondary);
  --ams-success: var(--color-success);
  --ams-warning: var(--color-warning);
  --ams-danger: var(--color-danger);
  --ams-info: var(--color-accent);
}

/* ===== BRAND UTILITY CLASSES ===== */
.bg-ams-dark    { background-color: var(--ams-blue-dark, #001738) !important; }
.bg-ams-blue    { background-color: var(--ams-blue-bright, #00b4f6) !important; }
.bg-ams-gray    { background-color: var(--ams-gray-medium, #d4d4d5) !important; }
.bg-ams-light   { background-color: var(--ams-gray-light, #f1f0f0) !important; }
.bg-ams-bluegray{ background-color: var(--ams-blue-gray, #305371) !important; }
.text-ams-dark  { color: var(--ams-blue-dark, #001738) !important; }
.text-ams-blue  { color: var(--ams-blue-bright, #00b4f6) !important; }
.text-ams-gray  { color: var(--ams-blue-gray, #305371) !important; }
.border-ams     { border-color: var(--ams-gray-medium, #d4d4d5) !important; }

/* Brand gradient backgrounds */
.bg-ams-gradient { background: linear-gradient(135deg, var(--ams-blue-dark) 0%, var(--ams-blue-gray) 100%) !important; }
.bg-ams-gradient-bright { background: linear-gradient(135deg, var(--ams-blue-bright) 0%, #0096d1 100%) !important; }

/* Brand buttons */
.btn-ams-primary {
    background: var(--ams-blue-bright, #00b4f6);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ams-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-ams-dark {
    background: var(--ams-blue-dark, #001738);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ams-dark:hover { background: var(--ams-blue-gray, #305371); }

/* Brand cards */
.card-ams {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 23, 56, 0.08);
    border: 1px solid var(--ams-gray-light, #f1f0f0);
}

/* Module page headers */
.module-header h1,
.module-header h2 {
    color: var(--ams-blue-dark, #001738);
}

/* Standardize all module KPI cards */
.kpi-card {
    padding: 18px;
    border-radius: 12px;
    color: white;
}
.kpi-card .kpi-label { font-size: 13px; opacity: 0.85; }
.kpi-card .kpi-value { font-size: 28px; font-weight: 700; margin-top: 4px; }

/* Ensure OS cards always have dark readable text */
.os-card {
    color: #1e293b;
}
.os-card select, .os-card option {
    color: #374151;
}

/* Admin tab active state brand color */
.admin-tab.active,
.admin-tab[data-active="true"] {
    background: var(--ams-blue-bright, #00b4f6) !important;
    color: white !important;
}

/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
}

/* ===== UTILITÁRIOS ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-1 {
    flex: 1;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

/* ===== SISTEMA PRINCIPAL ===== */
.system-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--color-bg);
}

.main-header {
    background: linear-gradient(135deg, #001738 0%, #305371 100%);
    color: white;
    padding: 0 24px;
    box-shadow: 0 4px 16px rgba(0, 23, 56, 0.15);
    z-index: 1000;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.main-nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

.nav-btn.active {
    background: rgba(0, 180, 246, 0.2);
    color: #00b4f6;
    border: 1px solid rgba(0, 180, 246, 0.3);
}

.nav-btn i {
    font-size: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

/* ===== NOTIFICAÇÕES ===== */
.notifications-container {
    position: relative;
}

.notification-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 23, 56, 0.15);
    border: 1px solid #e2e8f0;
    z-index: 1000;
    margin-top: 8px;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.notifications-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #001738;
    margin: 0;
}

.mark-all-read {
    background: none;
    border: none;
    color: #00b4f6;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mark-all-read:hover {
    background: rgba(0, 180, 246, 0.1);
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: rgba(0, 180, 246, 0.05);
    border-left: 3px solid #00b4f6;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notification-icon.info {
    background: #e0f2fe;
    color: #0369a1;
}

.notification-icon.success {
    background: #d1fae5;
    color: #059669;
}

.notification-icon.warning {
    background: #fef3c7;
    color: #d97706;
}

.notification-icon.error {
    background: #fee2e2;
    color: #dc2626;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #001738;
    margin: 0 0 4px 0;
}

.notification-message {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 4px 0;
}

.notification-time {
    font-size: 11px;
    color: #94a3b8;
}

.notification-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.notifications-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.notifications-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ===== MENU DO USUÁRIO ===== */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 23, 56, 0.15);
    border: 1px solid #e2e8f0;
    z-index: 1000;
    margin-top: 8px;
    overflow: hidden;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #001738;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.user-menu-item:hover {
    background: #f8fafc;
    color: #00b4f6;
}

.user-menu-item i {
    width: 16px;
    text-align: center;
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 4px 0;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow: hidden;
}

.screen-header {
    margin-bottom: 24px;
    flex-shrink: 0;
}

.screen-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #001738;
    margin: 0 0 8px 0;
}

.screen-header p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* ===== BOTÕES (padrão único + tokens) ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 9px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    border: none;
    white-space: nowrap;
    transition: background var(--transition), box-shadow var(--transition), transform 0.1s;
    text-decoration: none;
    text-align: center;
    justify-content: center;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--color-primary);
    color: white;
}
.btn-primary:hover {
    background: var(--color-accent);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--color-text);
    border: 1.5px solid var(--color-border);
}
.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-success {
    background: var(--color-success);
    color: white;
}
.btn-success:hover {
    background: #059669;
}

.btn-info {
    background: var(--color-accent);
    color: white;
}
.btn-info:hover {
    filter: brightness(1.05);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: var(--color-warning);
    color: white;
}
.btn-warning:hover {
    background: #d97706;
}

.btn-sm { padding: 6px 14px; font-size: var(--font-size-sm); }
.btn-lg { padding: 12px 28px; font-size: 15px; }

.btn-icon {
    padding: 7px;
    width: 34px;
    height: 34px;
    justify-content: center;
}

.btn-action {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-action:hover { opacity: 0.8; }
.btn-action-view   { background: #e0f4fd; color: #0090c5; }
.btn-action-edit   { background: var(--color-warning-bg); color: #d97706; }
.btn-action-delete { background: var(--color-danger-bg); color: var(--color-danger); }
.btn-action-check  { background: var(--color-success-bg); color: #065f46; }

/* ===== FORMULÁRIOS ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #001738;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #00b4f6;
    box-shadow: 0 0 0 3px rgba(0, 180, 246, 0.1);
    outline: none;
}

.form-group.required label::after {
    content: ' *';
    color: #ef4444;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* ===== MODAIS (padrão .modal-overlay / .modal-box) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 23, 56, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-box {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.modal-box-lg { max-width: 760px; }
.modal-box-sm { max-width: 420px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}
.modal-header h2 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.modal-header h2 i { color: var(--color-accent); }
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { background: var(--color-border); }
.modal-body { padding: var(--space-6); flex: 1; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    position: sticky;
    bottom: 0;
}

/* ===== FORMULÁRIO — classes explícitas (.form-label / .form-input) ===== */
.form-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 180, 246, 0.12);
}
.form-input::placeholder { color: var(--color-text-muted); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }

/* ===== TABELAS ===== */
.table-wrapper { overflow-x: auto; }
.ams-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-base);
}
.ams-table thead tr {
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
}
.ams-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.ams-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
    vertical-align: middle;
}
.ams-table tbody tr:hover { background: #f8fafc; }
.ams-table .td-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}
.badge-success { background: var(--color-success-bg); color: #065f46; }
.badge-warning { background: var(--color-warning-bg); color: #92400e; }
.badge-danger  { background: var(--color-danger-bg);  color: #991b1b; }
.badge-info    { background: #e0f4fd; color: #0090c5; }
.badge-neutral { background: var(--color-bg); color: var(--color-text-secondary); }
.badge-pj      { background: #e0f4fd; color: #0090c5; }
.badge-pf      { background: var(--color-success-bg); color: #047857; }

/* ===== BUSCA DE CLIENTES (dropdown único) ===== */
.client-search { position: relative; }
.client-search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}
.client-search-input:focus {
    border-color: var(--color-accent);
    outline: none;
}
.client-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}
.client-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
}
.client-search-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition);
}
.client-search-item:hover { background: var(--color-bg); }
.client-search-name {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}
.client-search-doc {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: 2px;
}
.client-search-add {
    padding: 10px 14px;
    cursor: pointer;
    border-top: 2px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-accent);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.client-search-add:hover { background: #e0f4fd; }

/* ===== DRAG AND DROP (Comercial / Legalização) ===== */
.os-card[draggable="true"] { cursor: grab; }
.os-card.dragging {
    opacity: 0.4;
    transform: rotate(1deg);
    box-shadow: var(--shadow-lg);
}
.pipeline-column.drag-over {
    background: #e0f4fd !important;
    border: 2px dashed var(--color-accent) !important;
    border-radius: var(--radius-lg);
}
.drag-placeholder {
    height: 80px;
    background: #f0f9ff;
    border: 2px dashed #bae6fd;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

/* ===== CHECKBOX ===== */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #001738;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00b4f6;
}

/* ===== ESTADOS DE CARREGAMENTO ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 23, 56, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 48px;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    font-size: 18px;
    font-weight: 600;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1200px) {
    .main-nav {
        gap: 4px;
    }
    
    .nav-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .nav-btn span {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0 16px;
        flex-wrap: wrap;
    }
    
    .header-left {
        gap: 16px;
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .main-nav {
        display: flex;
        width: 100%;
        justify-content: center;
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .nav-btn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 60px;
    }
    
    .nav-btn i {
        font-size: 13px;
    }
    
    .screen {
        padding: 16px;
        margin-top: 80px;
    }
    
    .screen-header h1 {
        font-size: 24px;
    }
    
    .screen-header h2 {
        font-size: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    /* Responsividade para módulos em tablet */
    .pipeline-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .pipeline-column {
        width: 100%;
        min-height: 200px;
    }
    
    .usuarios-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .modal-content {
        width: 90%;
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 0 12px;
        flex-wrap: wrap;
    }
    
    .header-left {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .main-nav {
        display: flex;
        width: 100%;
        justify-content: space-between;
        gap: 2px;
    }
    
    .nav-btn {
        flex: 1;
        max-width: 50px;
        padding: 6px 4px;
        font-size: 10px;
    }
    
    .nav-btn i {
        font-size: 12px;
    }
    
    .screen {
        padding: 8px;
        margin-top: 60px;
    }
    
    .screen-header h1 {
        font-size: 18px;
    }
    
    .screen-header h2 {
        font-size: 16px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Responsividade para módulos */
    .comercial-content,
    .usuarios-content,
    .dashboard-content {
        padding: 8px;
    }
    
    .pipeline-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .pipeline-column {
        width: 100%;
        min-height: 150px;
    }
    
    .demanda-card {
        padding: 8px;
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .usuarios-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .usuario-card {
        padding: 8px;
        font-size: 11px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5px auto;
        padding: 12px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        font-size: 11px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 13px;
        padding: 6px;
    }
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.slide-in-up {
    animation: slideInUp 0.3s ease-out;
}

.slide-in-down {
    animation: slideInDown 0.3s ease-out;
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00b4f6 0%, #305371 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #305371 0%, #001738 100%);
}

/* ===== TOOLTIPS ===== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #001738;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
}

/* ===== ESTADOS ESPECIAIS ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.empty-content i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-content h3 {
    font-size: 18px;
    margin: 0 0 8px 0;
    color: #001738;
}

.empty-content p {
    font-size: 14px;
    margin: 0;
}

/* ===== MELHORIAS DE ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== IMPRESSÃO ===== */
@media print {
    .main-header,
    .notifications-container,
    .user-menu,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .screen {
        padding: 0;
    }
}

/* CORREÇÕES DE VISIBILIDADE - CRÍTICO */
.screen {
    display: none !important;
    flex-direction: column !important;
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: auto !important;
}

.screen:not(.hidden) {
    display: flex !important;
}

/* Garantir que conteúdo dos módulos seja visível */
.comercial-content,
.usuarios-content,
.dashboard-content,
.legalizacao-content,
.gerencia-content,
.ceo-content,
.financeiro-content,
.clientes-content,
.contratos-content,
.certificados-content {
    display: block !important;
    width: 100% !important;
    min-height: 400px !important;
    padding: 20px !important;
}

/* Corrigir menu de usuário */
.user-dropdown {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    z-index: 9999 !important;
}

.user-menu:hover .user-dropdown {
    display: block !important;
}

/* Pipeline deve ser visível */
.pipeline-container {
    display: flex !important;
    min-height: 500px !important;
    overflow-x: auto !important;
}

.pipeline-column {
    min-width: 280px !important;
    display: flex !important;
    flex-direction: column !important;
}

.pipeline-card {
    display: block !important;
    margin-bottom: 16px !important;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
    pointer-events: none;
}

.notification-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: white;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 23, 56, 0.18);
    border-left: 4px solid #00b4f6;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
}

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

.notification-toast.toast-success { border-left-color: #28a745; }
.notification-toast.toast-warning { border-left-color: #ffc107; }
.notification-toast.toast-error,
.notification-toast.toast-danger { border-left-color: #dc3545; }
.notification-toast.toast-system { border-left-color: #6366f1; }
.notification-toast.toast-financial { border-left-color: #f59e0b; }
.notification-toast.toast-contract { border-left-color: #00b4f6; }
.notification-toast.toast-certificate { border-left-color: #8b5cf6; }
.notification-toast.toast-os { border-left-color: #10b981; }

.toast-emoji {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #001738;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s;
}
.toast-close:hover {
    background: #f1f5f9;
    color: #475569;
}

/* ===== AUDITORIA PANEL ===== */
.auditoria-overlay {
    position: fixed;
    top: 0;
    right: -440px;
    width: 440px;
    height: 100vh;
    background: white;
    box-shadow: -8px 0 32px rgba(0, 23, 56, 0.15);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.auditoria-overlay.open {
    right: 0;
}

.auditoria-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #001738, #305371);
    color: white;
}

.auditoria-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.auditoria-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.auditoria-close:hover {
    background: rgba(255,255,255,0.3);
}

.auditoria-filters {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.auditoria-filters select,
.auditoria-filters input {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    flex: 1;
    background: white;
    color: #001738;
}

.auditoria-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 24px;
}

.auditoria-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}

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

.auditoria-item-emoji {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1.3;
}

.auditoria-item-body {
    flex: 1;
    min-width: 0;
}

.auditoria-item-action {
    font-weight: 600;
    color: #001738;
    margin-bottom: 2px;
}

.auditoria-item-detail {
    color: #64748b;
    word-break: break-word;
    line-height: 1.4;
}

.auditoria-item-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 11px;
}

.auditoria-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.auditoria-stats {
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 11px;
    color: #64748b;
}

.auditoria-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.auditoria-stat strong {
    color: #001738;
}

@media (max-width: 480px) {
    .toast-container {
        right: 12px;
        left: 12px;
        max-width: none;
    }
    .auditoria-overlay {
        width: 100vw;
        right: -100vw;
    }
}

/* ===== MÓDULOS — ESTILOS GLOBAIS CONSISTENTES ===== */

/* Container padrão de módulo */
.modulo-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Header de módulo padronizado */
.modulo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.modulo-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #001738;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modulo-header h2 span {
    font-size: 28px;
    line-height: 1;
}

.modulo-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* KPI Grid padrão */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card-mini {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 23, 56, 0.06);
    border: 1px solid #f1f5f9;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 23, 56, 0.1);
}

.kpi-card-mini .kpi-emoji {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.kpi-card-mini .kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: #001738;
    margin-bottom: 4px;
    line-height: 1.1;
}

.kpi-card-mini .kpi-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Filtros padrão */
.filtros-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 23, 56, 0.04);
    border: 1px solid #f1f5f9;
    margin-bottom: 20px;
}

.filtros-bar input,
.filtros-bar select {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #001738;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filtros-bar input:focus,
.filtros-bar select:focus {
    border-color: #00b4f6;
    box-shadow: 0 0 0 3px rgba(0, 180, 246, 0.1);
    outline: none;
    background: white;
}

.filtros-bar input[type="search"] {
    min-width: 220px;
}

/* Tabela padrão */
.tabela-modulo {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 23, 56, 0.06);
    border: 1px solid #f1f5f9;
    border-collapse: collapse;
}

.tabela-modulo thead {
    background: linear-gradient(135deg, #001738, #305371);
    color: white;
}

.tabela-modulo thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tabela-modulo tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.tabela-modulo tbody tr:hover {
    background: #f8fafc;
}

.tabela-modulo tbody tr:last-child {
    border-bottom: none;
}

.tabela-modulo tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: #334155;
    vertical-align: middle;
}

/* Badges/Tags */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-ativo, .badge-success { background: #d1fae5; color: #059669; }
.badge-pendente, .badge-warning { background: #fef3c7; color: #d97706; }
.badge-vencido, .badge-danger { background: #fee2e2; color: #dc2626; }
.badge-cancelado { background: #f1f5f9; color: #64748b; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-renovado { background: #ede9fe; color: #7c3aed; }

/* Card lista (usado em módulos de lista) */
.card-lista {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 23, 56, 0.06);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}

.card-lista:hover {
    box-shadow: 0 4px 20px rgba(0, 23, 56, 0.1);
}

.card-lista-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.card-lista-body {
    padding: 16px 20px;
}

.card-lista-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

/* Alertas inline */
.alerta-modulo {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.alerta-modulo.alerta-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alerta-modulo.alerta-danger {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alerta-modulo.alerta-info {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #075985;
}

.alerta-modulo.alerta-success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

/* Separador visual */
.modulo-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
    margin: 24px 0;
}

/* Grid de cards (2, 3, ou 4 colunas) */
.cards-grid {
    display: grid;
    gap: 16px;
}

.cards-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cards-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cards-grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Tabela responsiva — wrapper horizontal scroll */
.tabela-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

/* Progresso visual */
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-fill.yellow { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill.red { background: linear-gradient(90deg, #ef4444, #f87171); }
.progress-fill.blue { background: linear-gradient(90deg, #00b4f6, #38bdf8); }

/* Ações de linha (botões pequenos em tabelas/cards) */
.acoes-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-acao {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: #475569;
}

.btn-acao:hover {
    background: #e2e8f0;
    color: #001738;
}

.btn-acao.acao-editar { color: #0369a1; }
.btn-acao.acao-editar:hover { background: #e0f2fe; }
.btn-acao.acao-excluir { color: #dc2626; }
.btn-acao.acao-excluir:hover { background: #fee2e2; }
.btn-acao.acao-ver { color: #059669; }
.btn-acao.acao-ver:hover { background: #d1fae5; }

/* Responsivo para módulos */
@media (max-width: 768px) {
    .modulo-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .kpi-card-mini {
        padding: 14px;
    }
    
    .kpi-card-mini .kpi-value {
        font-size: 22px;
    }
    
    .filtros-bar {
        flex-direction: column;
    }
    
    .filtros-bar input[type="search"] {
        min-width: 100%;
    }
    
    .tabela-modulo thead th,
    .tabela-modulo tbody td {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .cards-grid-2,
    .cards-grid-3,
    .cards-grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .kpi-card-mini {
        padding: 12px;
    }
    
    .kpi-card-mini .kpi-value {
        font-size: 18px;
    }
    
    .kpi-card-mini .kpi-label {
        font-size: 10px;
    }
    
    .modulo-header h2 {
        font-size: 18px;
    }
    
    .card-lista-header,
    .card-lista-body,
    .card-lista-footer {
        padding: 12px 14px;
    }
}

/* ===== VALIDAÇÃO DE FORMULÁRIOS ===== */
.campo-invalido {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    animation: shake 0.4s ease;
}

.campo-invalido:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-4px); }
    40%      { transform: translateX(4px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}

/* ===== RESPONSIVO PARA MÓDULOS INLINE-STYLED ===== */
/* Garante que modais e elementos com inline styles quebrem corretamente no mobile */
@media (max-width: 768px) {
    /* Modais inline */
    [id^="modal-"] > div,
    [id^="Modal"] > div,
    .modal-overlay > div {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
        max-height: 90vh !important;
    }

    /* E-mail preview modal */
    #email-preview-modal > div {
        width: 98% !important;
        max-width: 98% !important;
    }

    /* Filtro de relatórios - empilhar em mobile */
    #relatoriosContent [style*="display: flex"][style*="flex-wrap: wrap"] {
        flex-direction: column;
        align-items: stretch !important;
    }

    /* Botões de ação dos cards inline */
    [style*="display: flex"][style*="gap: 0.5rem"] button {
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
    }

    /* Grids inline de KPIs/cards — forçar empilhamento */
    [style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
    }

    /* Forçar largura total em containers internos */
    [style*="max-width:550px"],
    [style*="max-width: 550px"],
    [style*="max-width:600px"],
    [style*="max-width: 600px"] {
        max-width: 95% !important;
    }

    /* Scrollbar horizontal nas tabelas se necessário */
    .module-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    /* Grids inline — 1 coluna total */
    [style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* Botões inline — full width */
    [style*="display: flex"][style*="gap: 8px"] {
        flex-direction: column;
    }

    [style*="display: flex"][style*="gap: 8px"] button {
        width: 100% !important;
    }

    /* Header do relatorio e certificados */
    [style*="justify-content: space-between"][style*="flex-wrap: wrap"] {
        flex-direction: column;
        gap: 8px;
    }

    /* Formulários inline dentro de modais */
    [id^="modal-"] form [style*="grid-template-columns"],
    [id^="Modal"] form [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Reduzir padding em telas pequenas */
    [style*="padding: 2rem"],
    [style*="padding:2rem"] {
        padding: 1rem !important;
    }

    [style*="padding: 1.5rem"],
    [style*="padding:1.5rem"] {
        padding: 0.75rem !important;
    }
}
/* ── Modal footer padrão ──────────────────────────────── */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}
