@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca;
    --secondary-color: #1e293b; /* Slate 800 */
    --background-color: #f8fafc; /* Slate 50 */
    --surface-color: #ffffff;
    --text-color: #334155; /* Slate 700 */
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --sidebar-width: 260px;
    --header-height: 60px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary-color);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    border-left: 4px solid var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: #cbd5e1;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

.top-header {
    height: var(--header-height);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.container {
    padding: 20px;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Cards & Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.card-icon {
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.8;
    align-self: flex-end;
    margin-top: -40px;
}

/* Tables */
.table-container {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr:hover {
    background-color: #f8fafc;
}

/* Forms */
.form-card {
    background: var(--surface-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: var(--secondary-color); color: #fff; }
.btn-secondary:hover { background: #0f172a; }

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

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

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

.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-color); }
.btn-outline:hover { background: #f1f5f9; }

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

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-received { background: #e2e8f0; color: #475569; } /* cinza */
.badge-diagnosing { background: #dbeafe; color: #1d4ed8; } /* azul */
.badge-waiting-budget { background: #fef3c7; color: #b45309; } /* amarelo */
.badge-budget-approved { background: #d1fae5; color: #047857; } /* verde */
.badge-budget-rejected { background: #fee2e2; color: #b91c1c; } /* vermelho */
.badge-in-repair { background: #f3e8ff; color: #7e22ce; } /* roxo */
.badge-waiting-parts { background: #ffedd5; color: #c2410c; } /* laranja */
.badge-ready { background: #dcfce3; color: #15803d; } /* verde */
.badge-delivered { background: #94a3b8; color: #1e293b; } /* cinza escuro */
.badge-cancelled { background: #991b1b; color: #fecaca; } /* vermelho escuro */

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }

/* Login */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    width: 100%;
}
.login-card {
    background: var(--surface-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
}
.login-header {
    text-align: center;
    margin-bottom: 30px;
}
.login-header h1 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
}
.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Utilities */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .menu-toggle {
        display: block;
    }
}
