/* ============================================
   CORONA-STYLE TEMPLATE - Sistema de OS
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1e293b;
    --light: #f8fafc;
    --sidebar-width: 250px;
    --topbar-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
    color: #334155;
    font-size: 14px;
}

/* ============================================
   SIDEBAR
   ============================================ */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-nav {
    list-style: none;
    padding: 15px 0;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

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

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

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

.sidebar-nav .nav-item {
    margin: 2px 10px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 24px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

#sidebarToggle {
    font-size: 1.5rem;
    color: var(--secondary);
}

.content-wrapper {
    padding: 25px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
    padding: 18px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stat-card {
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    right: 15px;
    top: 15px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.stat-card.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.stat-card.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-card.info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.stat-card.dark {
    background: linear-gradient(135deg, #475569, #334155);
}

/* ============================================
   TABLES
   ============================================ */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-width: 1px;
    padding: 12px 15px;
    background: #f8fafc;
}

.table td {
    padding: 15px;
    vertical-align: middle;
    border-color: #e2e8f0;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

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

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

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
}

/* ============================================
   FILA DE OS
   ============================================ */
.fila-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.fila-item:hover {
    background: #f8fafc;
}

.fila-item:last-child {
    border-bottom: none;
}

.fila-item.urgente {
    border-left-color: var(--danger);
    background: #fef2f2;
}

.fila-item.urgente:hover {
    background: #fee2e2;
}

.drag-handle {
    cursor: grab;
    color: #cbd5e1;
    transition: color 0.2s;
}

.drag-handle:hover {
    color: var(--primary);
}

.sortable-ghost {
    opacity: 0.4;
    background: #e2e8f0;
}

.sortable-chosen {
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================
   FORMS
   ============================================ */
.form-control,
.form-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    padding: 10px 14px;
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 18px 20px;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 15px 20px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
}

/* ============================================
   CHARTS
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
}

/* ============================================
   LANCAMENTO DE HORAS
   ============================================ */
.horas-list {
    max-height: 300px;
    overflow-y: auto;
}

.hora-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.hora-item:last-child {
    margin-bottom: 0;
}

.hora-item .hora-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hora-item .hora-data {
    font-weight: 600;
    color: var(--dark);
}

.hora-item .hora-valor {
    background: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.hora-item .hora-descricao {
    color: #64748b;
    font-size: 0.85rem;
}

.total-horas {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
}

.total-horas .valor {
    font-size: 2rem;
    font-weight: 700;
}

/* ============================================
   RELATÓRIOS
   ============================================ */
.report-filters {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.report-card {
    text-align: center;
    padding: 30px 20px;
}

.report-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
}

.report-card .icon.primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.report-card .icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.report-card .icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.report-card .icon.info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
    }

    .sidebar.active {
        margin-left: 0;
    }

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

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 15px;
    }

    .table-responsive {
        font-size: 0.85rem;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar.active+.sidebar-overlay {
    display: block;
}

@media (min-width: 993px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.bg-primary-soft {
    background: rgba(99, 102, 241, 0.1);
}

.bg-success-soft {
    background: rgba(34, 197, 94, 0.1);
}

.bg-danger-soft {
    background: rgba(239, 68, 68, 0.1);
}

.bg-warning-soft {
    background: rgba(245, 158, 11, 0.1);
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}