/* ════════════════════════════════════════════════
   GESTÃO DE REPARAÇÕES — App CSS
   ════════════════════════════════════════════════ */

/* ── Reset / Base ───────────────────────────────── */
html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    background: #f0f2f5;
    color: #212529;
}

/* ── Layout ─────────────────────────────────────── */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }
    .sidebar {
        width: 240px;
        height: 100vh;
        position: sticky;
        top: 0;
        flex-shrink: 0;
        overflow-y: auto;
    }
}

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
    background: #1e2a3a;
    color: #fff;
}

.top-row.navbar-dark {
    background: #172031 !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.01em;
}

.nav-scrollable {
    padding: 0.5rem 0.75rem 1rem;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    color: rgba(255,255,255,0.65) !important;
    border-radius: 6px;
    padding: 7px 10px !important;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
}

.nav-link.active {
    color: #fff !important;
    background: #0d6efd;
    font-weight: 600;
}

.sidebar hr {
    border-color: rgba(255,255,255,0.1);
    margin: 0.5rem 0;
}

/* ── Main content ───────────────────────────────── */
main {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
}

.top-row {
    height: 3.25rem;
    background: #fff;
    border-bottom: 1px solid #e0e4ea;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.content {
    padding: 1.5rem;
    flex: 1;
}

/* ── Login / Logout (barra superior) ──────────────────── */
.auth-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.auth-user {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    background: #f0f2f5;
    border-radius: 20px;
    padding: 0.3rem 0.75rem 0.3rem 0.5rem;
}

.auth-user i {
    font-size: 1.05rem;
    color: #6c757d;
}

.btn-auth {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-auth:active {
    transform: scale(0.97);
}

.btn-auth-logout {
    color: #b02a37;
    background: #fdecea;
    border-color: #f5c2c7;
}

.btn-auth-logout:hover {
    background: #f8d7da;
    color: #842029;
    border-color: #f1aeb5;
}

.btn-auth-login {
    color: #0d6efd;
    background: #e7f1ff;
    border-color: #b6d4fe;
}

.btn-auth-login:hover {
    background: #cfe2ff;
    color: #0a58ca;
    border-color: #9ec5fe;
}

@media (max-width: 640.98px) {
    .auth-user { display: none !important; }
}

.login-required-card {
    max-width: 380px;
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    padding: 2.5rem 2rem;
}

/* ── Cards ──────────────────────────────────────── */
.card {
    border: 1px solid #e0e4ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.card-body {
    padding: 1rem;
}

/* ── Formulário ─────────────────────────────────── */
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control, .form-select {
    font-size: 0.875rem;
    border-color: #ced4da;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.form-control-sm, .form-select-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* ── Tabelas ─────────────────────────────────────── */
.table {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #6c757d;
    border-bottom-width: 1px;
    white-space: nowrap;
    padding: 0.5rem 0.6rem;
}

.table td {
    padding: 0.45rem 0.6rem;
    vertical-align: middle;
}

.table-dark th {
    color: rgba(255,255,255,0.85) !important;
    background: #2c3e50;
}

.table-hover > tbody > tr:hover > td {
    background-color: rgba(13, 110, 253, 0.05);
}

/* ── Badges ─────────────────────────────────────── */
.badge {
    font-size: 0.7rem;
    padding: 0.3em 0.55em;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ── Botões ─────────────────────────────────────── */
.btn {
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
}

.btn-lg {
    font-size: 1rem;
    padding: 0.5rem 1.25rem;
}

/* ── Dashboard stats cards ───────────────────────── */
.card.text-bg-primary,
.card.text-bg-success,
.card.text-bg-warning,
.card.text-bg-info,
.card.text-bg-secondary,
.card.text-bg-dark {
    border: none;
    border-radius: 10px;
}

/* ── Alerts ─────────────────────────────────────── */
.alert {
    border-radius: 8px;
    font-size: 0.875rem;
}

/* ── Blazor error UI ────────────────────────────── */
#blazor-error-ui {
    background: #fff3cd;
    border-top: 1px solid #ffc107;
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.875rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── Navbar toggler (mobile) ────────────────────── */
.navbar-toggler {
    display: none;
    white-space: nowrap;
}

@media (max-width: 640.98px) {
    .navbar-toggler { display: inline-flex; align-items: center; }
    .nav-scrollable { display: none; }
    .nav-scrollable.open { display: block; }
    .content { padding: 1rem; }
}

/* ── Folha de Obra — barra sticky ──────────────────── */
.folha-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 2px solid #e0e4ea;
    padding: 0.55rem 0.75rem;
    margin: -1.5rem -1.5rem 1rem -1.5rem;  /* sangrar até às bordas do .content */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.folha-toolbar h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e2a3a;
}

.dropdown-blazor {
    position: relative;
}

.dropdown-blazor .dropdown-menu {
    margin-top: 0.35rem;
}

/* ── Scrollbar subtil ───────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c9d6; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9aa5b4; }

.cliente-sugestoes {
    z-index: 1050;
    max-height: 16rem;
    overflow-y: auto;
}
