/* ===================================================
   SISTEMA DE OFICINA MECÂNICA - CSS MODERNO
   Design Clean & Responsivo
   =================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ===== SIDEBAR MODERNO ===== */
.sidebar-modern {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--white);
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-modern .sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-modern .sidebar-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    border: 2px solid var(--primary);
}

.sidebar-modern .sidebar-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
}

.sidebar-modern .sidebar-header small {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.sidebar-modern .sidebar-header .badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.sidebar-modern .nav-menu {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.sidebar-modern .nav-menu li {
    margin: 2px 0.5rem;
}

.sidebar-modern .nav-menu li a {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    color: var(--gray-300);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
}

.sidebar-modern .nav-menu li a:hover,
.sidebar-modern .nav-menu li a.active {
    background: rgba(37, 99, 235, 0.2);
    color: var(--white);
}

.sidebar-modern .nav-menu li a i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-modern .nav-section {
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    font-weight: 700;
}

/* ===== CONTENT AREA ===== */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: var(--transition);
}

/* ===== TOP BAR ===== */
.topbar {
    background: var(--white);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--gray-200);
}

.topbar .topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar .topbar-left h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    display: none;
}

.btn-toggle-sidebar:hover {
    background: var(--gray-100);
}

/* ===== CONTENT WRAPPER ===== */
.content-wrapper {
    padding: 1.5rem;
}

/* ===== CARDS ===== */
.card-modern {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card-modern:hover {
    box-shadow: var(--shadow-md);
}

.card-modern .card-header-modern {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-modern .card-header-modern h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-modern .card-body-modern {
    padding: 1.5rem;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.bg-primary { background: var(--primary-light); color: var(--primary); }
.stat-card .stat-icon.bg-success { background: var(--success-light); color: var(--success); }
.stat-card .stat-icon.bg-warning { background: var(--warning-light); color: var(--warning); }
.stat-card .stat-icon.bg-danger { background: var(--danger-light); color: var(--danger); }
.stat-card .stat-icon.bg-info { background: var(--info-light); color: var(--info); }

.stat-card .stat-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.stat-card .stat-info p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ===== TABLES ===== */
.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern thead th {
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
    text-align: left;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
    color: var(--gray-700);
    vertical-align: middle;
}

.table-modern tbody tr:hover {
    background: var(--gray-50);
}

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

/* ===== BUTTONS ===== */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

.btn-modern:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }

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

.btn-success-modern { background: var(--success); color: var(--white); }
.btn-success-modern:hover { background: #059669; color: var(--white); }

.btn-warning-modern { background: var(--warning); color: var(--white); }
.btn-warning-modern:hover { background: #d97706; color: var(--white); }

.btn-danger-modern { background: var(--danger); color: var(--white); }
.btn-danger-modern:hover { background: #dc2626; color: var(--white); }

.btn-outline-modern {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline-modern:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-sm-modern {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg-modern {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ===== FORMS ===== */
.form-modern .form-group {
    margin-bottom: 1rem;
}

.form-modern label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.form-modern .form-control,
.form-modern select,
.form-modern textarea {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-modern .form-control:focus,
.form-modern select:focus,
.form-modern textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #155e75; }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }

/* ===== PHOTO GALLERY ===== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.photo-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: var(--transition);
}

.photo-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item .photo-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.photo-item:hover .photo-delete {
    opacity: 1;
}

.photo-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gray-50);
}

.photo-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.photo-upload-area i {
    font-size: 2rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.photo-upload-area p {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin: 0;
}

/* ===== CHART CONTAINER ===== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--primary-dark) 100%);
    padding: 1rem;
}

.login-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-box .logo-area {
    text-align: center;
    margin-bottom: 2rem;
}

.login-box .logo-area img {
    width: 120px;
    margin-bottom: 1rem;
}

.login-box .logo-area h3 {
    color: var(--gray-800);
    font-weight: 700;
    margin: 0 0 0.25rem;
    font-size: 1.3rem;
}

.login-box .logo-area p {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin: 0;
}

/* ===== PAYMENT CARDS ===== */
.plan-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-200);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.plan-card:hover,
.plan-card.featured {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.plan-card.featured {
    position: relative;
}

.plan-card.featured::before {
    content: 'Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-card h4 {
    font-size: 1.1rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.plan-card .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.plan-card .price small {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 400;
}

.plan-card .features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
}

.plan-card .features li {
    padding: 0.35rem 0;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.plan-card .features li i {
    color: var(--success);
    margin-right: 0.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar-modern {
        transform: translateX(-100%);
    }
    
    .sidebar-modern.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .btn-toggle-sidebar {
        display: block;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-info h3 {
        font-size: 1.2rem;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .topbar {
        padding: 0.5rem 1rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 1.5rem;
    }
    
    .table-modern {
        font-size: 0.75rem;
    }
    
    .table-modern thead th,
    .table-modern tbody td {
        padding: 0.5rem;
    }
}

/* ===== OVERLAY SIDEBAR MOBILE ===== */
.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-overlay.active {
    display: block;
}

/* ===== MODAL MODERNO ===== */
.modal-modern .modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-modern .modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
}

.modal-modern .modal-body {
    padding: 1.5rem;
}

.modal-modern .modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

/* ===== ALERTS ===== */
.alert-modern {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success-modern { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger-modern { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning-modern { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info-modern { background: var(--info-light); color: #155e75; border: 1px solid #67e8f9; }

/* ===== STATUS INDICATORS ===== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--gray-400); }
.status-dot.blocked { background: var(--danger); }
.status-dot.pending { background: var(--warning); }

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    border: none;
}

/* ===== PROGRESS BAR ===== */
.progress-modern {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-modern .progress-bar-modern {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.85rem;
}
