/* ==========================================================================
   WASHGO — PLATFORM DESIGN TOKENS (SaaS BACKOFFICE)
   Tema: Identidade WashGo, moderno, universal e minimalista
   ========================================================================== */

:root {
    /* Superfícies & Backgrounds */
    --p-bg: #f8fafc;
    --p-surface: #ffffff;
    --p-surface-subtle: #f1f5f9;
    --p-surface-hover: #f8fafc;
    --p-surface-active: #e2e8f0;

    /* Bordas & Divisores */
    --p-border: #e2e8f0;
    --p-border-subtle: #f1f5f9;
    --p-border-focus: #1266f1;

    /* Cores de Texto */
    --p-text-primary: #08203d;
    --p-text-secondary: #64748b;
    --p-text-muted: #94a3b8;
    --p-text-on-dark: #f8fafc;

    /* Ações & Destaques Primários */
    --p-primary: #1266f1;
    --p-primary-hover: #0758dd;
    --p-primary-active: #064ac0;
    --p-primary-soft: #e7f1ff;
    --p-on-primary: #ffffff;

    /* Cores Semânticas do Sistema */
    --p-success: #10b981;
    --p-success-bg: #ecfdf5;
    --p-success-border: #a7f3d0;
    --p-success-text: #065f46;

    --p-danger: #ef4444;
    --p-danger-bg: #fef2f2;
    --p-danger-border: #fecaca;
    --p-danger-text: #991b1b;

    --p-warning: #f59e0b;
    --p-warning-bg: #fffbeb;
    --p-warning-border: #fde68a;
    --p-warning-text: #92400e;

    --p-info: #3b82f6;
    --p-info-bg: #eff6ff;
    --p-info-border: #bfdbfe;
    --p-info-text: #1e40af;

    /* Raios de Borda (Estilo Crisp / Minimalista & Quadrado) */
    --p-radius-xs: 2px;
    --p-radius-sm: 4px;
    --p-radius-md: 6px;
    --p-radius-lg: 8px;
    --p-radius-xl: 10px;
    --p-radius-pill: 9999px;

    /* Sombras Elevadas */
    --p-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --p-shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --p-shadow-card-hover: 0 4px 12px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --p-shadow-dropdown: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   ELEMENTOS DE FORMULÁRIO PADRONIZADOS (SaaS DASHBOARD)
   ========================================================================== */

.platform-input,
input[type="text"],
input[type="tel"],
input[type="date"],
input[type="search"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    display: block;
    box-sizing: border-box !important;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-md);
    padding: 9px 13px;
    font-size: 13.5px;
    background-color: var(--p-surface);
    color: var(--p-text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 40px;
}

.platform-input:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--p-primary) !important;
    box-shadow: 0 0 0 3px rgba(18, 102, 241, 0.12) !important;
}

.platform-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--p-text-muted);
}

/* Checkbox estilizado e minimalista */
input[type="checkbox"] {
    accent-color: var(--p-primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-radius: 4px;
}

/* Botões Primários e Secundários da Plataforma */
.p-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--p-primary);
    color: var(--p-on-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--p-radius-md);
    border: 1px solid transparent;
    transition: background-color 0.15s ease, transform 0.05s ease;
    cursor: pointer;
}

.p-btn-primary:hover {
    background-color: var(--p-primary-hover);
}

.p-btn-primary:active {
    background-color: var(--p-primary-active);
    transform: scale(0.99);
}

.p-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--p-surface);
    color: var(--p-text-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--p-radius-md);
    border: 1px solid var(--p-border);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.p-btn-secondary:hover {
    background-color: var(--p-surface-subtle);
    border-color: var(--p-border);
}

/* Navegação ativa do dashboard com a identidade WashGo. */
.dashboard-shell .bg-surface-container.text-primary {
    background-color: var(--p-primary-soft) !important;
}

.dashboard-shell nav a.bg-surface-container.text-primary i {
    color: var(--p-primary);
}

/* Badges neutras do SaaS */
.p-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--p-radius-pill);
    font-size: 11px;
    font-weight: 600;
}

.p-badge-neutral {
    background-color: var(--p-surface-subtle);
    color: var(--p-text-secondary);
    border: 1px solid var(--p-border);
}

.p-badge-success {
    background-color: var(--p-success-bg);
    color: var(--p-success-text);
    border: 1px solid var(--p-success-border);
}

.p-badge-danger {
    background-color: var(--p-danger-bg);
    color: var(--p-danger-text);
    border: 1px solid var(--p-danger-border);
}

/* ==========================================================================
   MODAIS & OVERLAYS GLOBAIS (FIX DEFINITIVO PARA IPAD, SAFARI E NAVBAR)
   ========================================================================== */

.p-modal-root {
    position: relative;
    z-index: 99999 !important;
}

.p-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background-color: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 99998 !important;
}

.p-modal-wrapper {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
}

.p-modal-card {
    position: relative !important;
    z-index: 100000 !important;
    pointer-events: auto !important;
    max-height: calc(100vh - 2rem) !important;
    max-height: calc(100dvh - 2rem) !important;
}
