/* =====================================================
   GLOBAL SANTOS - VISUAL CLEAN E SIMPLIFICADO
   ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #0B2A5B;
    --primary-light: #164A9C;
    --secondary: #3B82F6;
    --secondary-light: #EFF6FF;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --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;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
    --sidebar-width: 230px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    z-index: 1000;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
    text-align: center;
}

.sidebar-brand img { max-width: 150px; }

.sidebar-menu { padding: 15px; flex: 1; }

.sidebar-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; text-decoration: none;
    color: var(--gray-600); font-size: 14px; font-weight: 500;
    border-radius: 8px; margin-bottom: 4px; transition: 0.2s;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: var(--primary); color: white;
}

.sidebar-user {
    padding: 15px; border-top: 1px solid var(--gray-200);
    font-size: 13px; display: flex; align-items: center; gap: 10px;
}

/* ===== CABEÇALHO ===== */
.app-header {
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 0; left: var(--sidebar-width); right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; z-index: 900;
}

.app-header h2 { font-size: 18px; color: var(--primary); }

.app-header .user-box { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ===== CONTEÚDO ===== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 80px 20px 30px;
    width: calc(100% - var(--sidebar-width));
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--gray-100);
    width: 100%;
    box-sizing: border-box;
}

.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px; flex-wrap: wrap; gap: 10px;
}

.card-header h3 { font-size: 16px; color: var(--gray-800); }

/* ===== GRID DE ORDENS (CARDS) ===== */
.ordens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.os-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 15px;
    display: flex; flex-direction: column; gap: 10px;
    transition: 0.2s;
}

.os-card:hover { border-color: var(--secondary); box-shadow: var(--shadow-lg); }

.os-card .os-header {
    display: flex; justify-content: space-between; align-items: center;
}

.os-card .os-number { font-size: 12px; font-weight: 700; color: var(--primary); }

.os-card .os-title { font-size: 14px; font-weight: 600; color: var(--gray-800); margin-top: 5px; }

.os-card .os-meta {
    display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--gray-500);
}

.os-card .os-meta span { background: var(--gray-100); padding: 2px 8px; border-radius: 12px; }

.os-card .btn-atender {
    background: var(--primary); color: white; border: none;
    padding: 8px; border-radius: 6px; font-size: 13px; font-weight: 600;
    cursor: pointer; text-align: center; text-decoration: none;
    margin-top: 5px; transition: 0.2s;
}

.os-card .btn-atender:hover { background: var(--primary-light); }

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border: none; border-radius: 6px;
    font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none;
    transition: 0.2s; font-family: inherit;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { opacity: 0.9; }

.btn-secondary { background: var(--secondary-light); color: var(--primary); }
.btn-secondary:hover { background: #DBEAFE; }

.btn-success { background: #10B981; color: white; }
.btn-success:hover { opacity: 0.9; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

.btn-lg { padding: 10px 24px; font-size: 16px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== STATUS BADGE ===== */
.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}
.status-badge.ativo { background: #D1FAE5; color: #065F46; }
.status-badge.inativo { background: #FEE2E2; color: #991B1B; }

/* ===== TABELA ===== */
.table-wrapper { overflow-x: auto; }
.table-wrapper table { width: 100%; border-collapse: collapse; }
.table-wrapper th, .table-wrapper td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}
.table-wrapper th {
    background: var(--gray-100);
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
}

/* ===== FORM ===== */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-600); margin-bottom: 5px; }

.form-control {
    width: 100%; padding: 10px; border: 1px solid var(--gray-300);
    border-radius: 6px; font-size: 14px; font-family: inherit;
    box-sizing: border-box;
}

.form-control:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px var(--secondary-light); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.label-required { color: var(--danger); }

/* ===== LOGIN (TELA TODA) ===== */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #0B2A5B 0%, #164A9C 100%);
    padding: 20px;
}

.login-card {
    background: white; border-radius: var(--radius-lg); padding: 40px;
    max-width: 400px; width: 100%; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.login-logo { text-align: center; margin-bottom: 25px; }
.login-logo img { max-width: 200px; }

.login-error { background: #FEE2E2; color: #991B1B; padding: 10px; border-radius: 6px; margin-bottom: 15px; font-size: 13px; text-align: center; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 250px; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 70px 15px 20px; width: 100%; }
    .app-header { left: 0; }
    .form-row { grid-template-columns: 1fr; }
}