/* === ZapNegócios Dashboard === */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* === CSS Variables === */
:root {
    --color-primary: #00a884;
    --color-primary-dark: #008f6f;
    --color-primary-light: #e6f9f3;
    --color-primary-glow: rgba(0, 168, 132, 0.15);
    --color-pending: #ef4444;
    --color-in-progress: #f59e0b;
    --color-resolved: #22c55e;
    --color-bg: #f0f2f5;
    --color-surface: #ffffff;
    --color-text: #111b21;
    --color-text-secondary: #667781;
    --color-border: #e9edef;
    --color-hover: #f5f6f6;
    --color-danger: #dc2626;
    --color-info: #3b82f6;
    --color-accent: #6366f1;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);
    --transition: 0.2s ease;
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font: var(--font-body);
}

/* === Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    height: 100%;
}

/* === Loading Screen === */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: var(--color-text-secondary);
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === Error UI === */
#blazor-error-ui {
    background: var(--color-danger);
    color: white;
    padding: 8px 16px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    display: none;
    z-index: 9999;
}

#blazor-error-ui .reload {
    color: white;
    font-weight: 600;
}

/* === Typography === */
h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }

/* === Forms === */
input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition);
    outline: none;
}

input:focus, select:focus {
    border-color: var(--color-primary);
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
    min-height: 44px;
    min-width: 44px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

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

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
    min-width: 32px;
}

.btn-icon {
    padding: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    min-width: 32px;
    transition: background var(--transition);
}

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

/* === Utility === */
.text-muted { color: var(--color-text-secondary); }
.text-sm { font-size: 12px; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.valid-feedback { color: var(--color-resolved); font-size: 12px; }
.invalid-feedback { color: var(--color-danger); font-size: 12px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Shared Admin Styles === */
.admin-page {
    padding: 32px;
    max-width: 1100px;
}

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

.admin-page-header h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}

.admin-message {
    background: var(--color-surface);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 16px;
    color: var(--color-text);
    font-size: 0.9rem;
}

.admin-message-error {
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.admin-table-wrap {
    overflow-x: auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 16px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.admin-table tbody tr {
    transition: background 0.15s;
}

.admin-table tbody tr:hover {
    background: var(--color-hover);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-active { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.badge-info { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.badge-inactive { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

.admin-form-section {
    margin-top: 24px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--color-border);
}

.admin-form-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 16px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-form-row label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.admin-form-row input {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 8px 12px;
    color: var(--color-text);
    font-size: 0.9rem;
}

.admin-form-row input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.admin-form-row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

@media (max-width: 768px) {
    .admin-page {
        padding: 20px 16px;
    }

    .admin-page-header {
        flex-direction: column;
    }
}
