/* ============================================================
   GestaoServicos - Estilos Customizados
   ============================================================ */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #343A40;
    --sidebar-hover: rgba(255,255,255,0.1);
    --sidebar-category: #F5C01D;
    --primary-color: #343A40;
    --accent-color: #495057;
}

/* ---- Layout ---- */

#app-wrapper {
    min-height: 100vh;
}

#main-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

/* ---- Sidebar ---- */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    background: var(--sidebar-bg) !important;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar .sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    margin: 0.1rem 0.5rem;
    transition: background 0.2s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--sidebar-hover);
}

.sidebar .nav-link.active {
    background: var(--accent-color);
    font-weight: 600;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* Categorias colapsáveis */
.sidebar-category-toggle {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    color: var(--sidebar-category) !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 0.5rem 1rem !important;
    margin: 0.3rem 0.5rem 0 !important;
    cursor: pointer;
    text-decoration: none !important;
}

.sidebar-category-toggle:hover {
    background: var(--sidebar-hover) !important;
}

.sidebar-chevron {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.sidebar-category-toggle[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(180deg);
}

/* Submenu indentado */
.sidebar-submenu .nav-link {
    padding-left: 2.2rem !important;
    font-size: 0.83rem;
}

.sidebar-header {
    border-color: rgba(255,255,255,0.15) !important;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

/* ---- Cards de Dashboard ---- */

.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ---- Tabela ---- */

.table-container {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-container .table {
    margin-bottom: 0;
}

.table-container .table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #495057;
    white-space: nowrap;
}

/* ---- Status Badges ---- */

.badge-novo { background-color: #2196f3; }
.badge-em-atendimento { background-color: #ff9800; }
.badge-aguardando-mecanico { background-color: #9c27b0; }
.badge-aguardando-pecas { background-color: #f44336; }
.badge-concluido { background-color: #4caf50; }
.badge-cancelado { background-color: #9e9e9e; }

/* ---- Formulários ---- */

.form-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1.5rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
}

.form-control[readonly],
.form-control[disabled],
.form-control:disabled,
.form-select[disabled],
.form-select:disabled {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
    border-color: #ced4da !important;
}

.form-check-input[disabled],
.form-check-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Auth Pages ---- */

.auth-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e8eaf6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ---- Responsivo ---- */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    #main-content {
        margin-left: 0;
    }
}

/* ---- Print ---- */

@media print {
    .sidebar, header, footer, .no-print {
        display: none !important;
    }

    #main-content {
        margin-left: 0;
    }
}

/* ---- Utilitários ---- */

.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
