/* Sistema-P — Estilos Globais (compatível com Tailwind CDN) */

body {
    background-color: rgb(239, 239, 239) !important;
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background-color: #fff;
    color: #111827;
}

.input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px #3b82f6;
}

.input.uppercase {
    text-transform: uppercase;
}

.input[readonly], .input:read-only {
    background-color: #f9fafb;
    cursor: default;
}

.btn-primary {
    background-color: #2563eb;
    color: #fff;
    font-weight: 600;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    font-weight: 500;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: #fef2f2;
    color: #dc2626;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background-color: #fee2e2;
}

.btn-edit {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.btn-edit:hover {
    background-color: #dbeafe;
}

.btn-view {
    background-color: #f0fdf4;
    color: #16a34a;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.btn-view:hover {
    background-color: #dcfce7;
}

.btn-warning {
    background-color: #fffbeb;
    color: #d97706;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.btn-warning:hover {
    background-color: #fef3c7;
}

.action-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.action-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.action-card:active {
    transform: translateY(0);
}

.card-stat {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    padding: 1rem;
    text-align: center;
    transition: box-shadow 0.2s;
}

.card-stat:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07);
}

.rounded-xl, .rounded-2xl, .modal-content {
    border-radius: 0.5rem !important;
}

.tab-btn {
    color: #6b7280;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem 0.5rem 0 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.15s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #374151;
    background-color: #f3f4f6;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
    background-color: #eff6ff;
}

.modal.hidden {
    display: none !important;
}

.modal {
    animation: fadeIn 0.15s ease;
}

.modal-content {
    animation: slideUp 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

.bar-chart {
    height: 0.5rem;
    background-color: #3b82f6;
    border-radius: 9999px;
    transition: width 0.6s ease;
    min-width: 2px;
}

/* Spinner inline */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip badge de visibilidade */
.badge-restrito {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #fff7ed;
    color: #c2410c;
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-publico {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f0fdf4;
    color: #16a34a;
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 0.375rem;
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* Busca dropdown */
#atd-cliente-results button:hover {
    background-color: #eff6ff;
}

/* Toast de alerta */
#alert, #alert-box {
    transition: opacity 0.3s;
}

/* Responsive mobile modal */
@media (max-width: 640px) {
    .modal-content {
        border-radius: 1rem 1rem 0 0;
        max-height: 95vh;
        align-self: flex-end;
    }

    .modal {
        align-items: flex-end;
    }
}

/* Tabela hover */
tbody tr:hover {
    background-color: #f8fafc;
}

/* Utilitário para texto elipsis em tabelas */
.truncate-cell {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
