/* ================================================================
   VRGestao - Sistema de Design (CSS puro, independente do Tailwind)
   ================================================================ */

/* Base */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* ---------- Page header ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
}
.page-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}
.breadcrumb {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.breadcrumb a {
    color: #4f46e5;
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #d1d5db; }

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 20px;
    margin-bottom: 20px;
}
.card-flush { padding: 0; }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.card-body { padding: 20px; }
.card-footer {
    padding: 14px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

/* ---------- Section titles ---------- */
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,0.3); }
.btn-sm { padding: 5px 10px; font-size: 0.8125rem; }
.btn-lg { padding: 10px 20px; font-size: 0.9375rem; }

.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }

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

.btn-outline { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-outline:hover { background: #f9fafb; border-color: #9ca3af; }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-ghost { background: transparent; color: #4f46e5; }
.btn-ghost:hover { background: #eef2ff; }

.btn-link { background: transparent; color: #4f46e5; padding: 0; border: none; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.form-label-required::after { content: " *"; color: #dc2626; }

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-input:disabled, .form-select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}
.form-textarea { min-height: 80px; resize: vertical; }

.form-help { font-size: 0.75rem; color: #6b7280; margin-top: 4px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 700px) {
    .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-full { grid-column: 1 / -1; }

.form-section {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}
.form-section:last-of-type { border-bottom: none; }

/* Checkbox custom */
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.form-check input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #4f46e5;
    cursor: pointer;
}
.form-check-label { font-size: 0.875rem; color: #374151; }

/* ---------- Tables ---------- */
.table-wrapper { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table thead { background: #f9fafb; }
.table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
    vertical-align: middle;
}
.table tbody tr { transition: background-color 0.1s; }
.table tbody tr:hover { background: #fafafa; }
.table tbody tr:last-child td { border-bottom: none; }
.table-compact td { padding: 8px 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-nowrap { white-space: nowrap; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #a16207; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-neutral { background: #f3f4f6; color: #374151; }
.badge-primary { background: #eef2ff; color: #4338ca; }

/* ---------- Empty states ---------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state-icon {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}
.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.empty-state-desc {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.875rem;
    line-height: 1.4;
}
.alert-error   { background: #fee2e2; border-left: 4px solid #dc2626; color: #991b1b; }
.alert-success { background: #dcfce7; border-left: 4px solid #16a34a; color: #166534; }
.alert-info    { background: #dbeafe; border-left: 4px solid #2563eb; color: #1e40af; }
.alert-warning { background: #fef3c7; border-left: 4px solid #d97706; color: #92400e; }
.alert-title { font-weight: 700; margin-bottom: 2px; }

/* ---------- Utility (mínimos necessários) ---------- */
.flex-row { display: flex; gap: 10px; align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: 10px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 20px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
    border: none;
}

/* ---------- Sidebar / Layout principal ---------- */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.15s, color 0.15s;
}
.sidebar-link:hover { background: #374151; color: #fff; }
.sidebar-link.active { background: #4f46e5; color: #fff; font-weight: 600; }
.sidebar-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
}
.sidebar-submenu a {
    display: block;
    padding: 8px 24px 8px 56px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.8125rem;
    transition: background-color 0.15s, color 0.15s;
}
.sidebar-submenu a:hover { background: #374151; color: #fff; }

/* ---------- Auth pages (login, senha) ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    padding: 16px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    padding: 36px 32px;
}
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}
.auth-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}
.auth-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 24px;
}

/* ---------- Responsive helpers ---------- */
@media (max-width: 640px) {
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header .btn { width: 100%; }
    .card { padding: 16px; }
    .card-body { padding: 16px; }
    .table th, .table td { padding: 8px 10px; }
}

/* ---------- Accordion sidebar (arrow animation) ---------- */
.submenu-arrow { transition: transform 0.2s ease; }
.rotate-180 { transform: rotate(180deg); }
