﻿/**
 * =========================================
 * css/style.css - ServiControl
 * Estilos globais do sistema
 * Variáveis CSS, temas de cores, sidebar,
 * cards, notificações, chat, responsivo
 * Criado por Isac Gomes
 * =========================================
 */

/* ====== CSS VARIABLES & COLOR THEMES ====== */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 85px;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-rgb: 79, 70, 229;
    --primary-gradient: linear-gradient(135deg, #4f46e5, #7c3aed);
    --bg-light: #f3f4f6;
    --bg-card: #ffffff;
    --bg-body: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --card-shadow-hover: 0 10px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
    --sidebar-bg: #111827;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-sm: 0.5rem;
}

/* ====== DYNAMIC COLOR THEMES ====== */
body[data-cor-tema="indigo"]  { --primary-color:#4f46e5; --primary-hover:#4338ca; --primary-rgb:79,70,229;  --primary-gradient:linear-gradient(135deg,#4f46e5,#7c3aed); --sidebar-bg:linear-gradient(180deg,#1e1b4b 0%,#312e81 100%); }
body[data-cor-tema="blue"]    { --primary-color:#2563eb; --primary-hover:#1d4ed8; --primary-rgb:37,99,235;  --primary-gradient:linear-gradient(135deg,#2563eb,#3b82f6); --sidebar-bg:linear-gradient(180deg,#172554 0%,#1e3a8a 100%); }
body[data-cor-tema="emerald"] { --primary-color:#059669; --primary-hover:#047857; --primary-rgb:5,150,105;  --primary-gradient:linear-gradient(135deg,#059669,#10b981); --sidebar-bg:linear-gradient(180deg,#0f1f2e 0%,#134e4a 50%,#1a3a4a 100%); }
body[data-cor-tema="rose"]    { --primary-color:#e11d48; --primary-hover:#be123c; --primary-rgb:225,29,72;  --primary-gradient:linear-gradient(135deg,#e11d48,#f43f5e); --sidebar-bg:linear-gradient(180deg,#1a1025 0%,#3b1c3a 50%,#2d1528 100%); }
body[data-cor-tema="amber"]   { --primary-color:#d97706; --primary-hover:#b45309; --primary-rgb:217,119,6;  --primary-gradient:linear-gradient(135deg,#d97706,#f59e0b); --sidebar-bg:linear-gradient(180deg,#1c1510 0%,#3d2b1a 50%,#2a1f14 100%); }
body[data-cor-tema="violet"]  { --primary-color:#7c3aed; --primary-hover:#6d28d9; --primary-rgb:124,58,237; --primary-gradient:linear-gradient(135deg,#7c3aed,#8b5cf6); --sidebar-bg:linear-gradient(180deg,#2e1065 0%,#4c1d95 100%); }
body[data-cor-tema="cyan"]    { --primary-color:#0891b2; --primary-hover:#0e7490; --primary-rgb:8,145,178;  --primary-gradient:linear-gradient(135deg,#0891b2,#06b6d4); --sidebar-bg:linear-gradient(180deg,#083344 0%,#155e75 100%); }
body[data-cor-tema="slate"]   { --primary-color:#475569; --primary-hover:#334155; --primary-rgb:71,85,105;  --primary-gradient:linear-gradient(135deg,#475569,#64748b); --sidebar-bg:linear-gradient(180deg,#0f172a 0%,#1e293b 100%); }

/* ====== DARK MODE ====== */
[data-bs-theme="dark"] {
    --bg-light: #0f172a;
    --bg-card: #1e293b;
    --bg-body: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --card-shadow-hover: 0 10px 25px -5px rgb(0 0 0 / 0.4);
    --sidebar-bg: #0c1222;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .bg-light { background-color: var(--bg-body) !important; color: var(--text-primary); }

[data-bs-theme="dark"] .card { background-color: var(--bg-card) !important; border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .card-header { background-color: var(--bg-card) !important; border-bottom-color: var(--border-color) !important; color: var(--text-primary) !important; }

[data-bs-theme="dark"] .table { color: var(--text-primary); --bs-table-bg: transparent; --bs-table-hover-bg: rgba(255,255,255,0.03); }
[data-bs-theme="dark"] .table thead { border-bottom-color: var(--border-color); }
[data-bs-theme="dark"] .table td, [data-bs-theme="dark"] .table th { border-bottom-color: var(--border-color); }

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select { background-color: #0f172a; border-color: var(--border-color); color: var(--text-primary); }
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus { background-color: #0f172a; border-color: var(--primary-color); color: var(--text-primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15); }
[data-bs-theme="dark"] .input-group-text { background-color: #1e293b; border-color: var(--border-color); color: var(--text-secondary); }

[data-bs-theme="dark"] .btn-light { background-color: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .btn-outline-secondary { color: #94a3b8; border-color: #334155; }
[data-bs-theme="dark"] .btn-outline-secondary:hover { background-color: #334155; color: #f1f5f9; }

[data-bs-theme="dark"] .alert-danger  { background:rgba(220,38,38,0.15); border-color:rgba(220,38,38,0.3); color:#fca5a5; }
[data-bs-theme="dark"] .alert-success { background:rgba(34,197,94,0.15); border-color:rgba(34,197,94,0.3); color:#86efac; }
[data-bs-theme="dark"] .alert-info    { background:rgba(14,165,233,0.15); border-color:rgba(14,165,233,0.3); color:#7dd3fc; }
[data-bs-theme="dark"] .alert-warning { background:rgba(234,179,8,0.15); border-color:rgba(234,179,8,0.3); color:#fde047; }

[data-bs-theme="dark"] .mobile-nav { background-color: #1e293b; border-bottom-color: var(--border-color); }
[data-bs-theme="dark"] .sc-mobile-toggle { color: #f1f5f9; }
[data-bs-theme="dark"] .sc-mobile-toggle:hover { color: #fff; background-color: rgba(255,255,255,0.1); }
[data-bs-theme="dark"] .sc-mobile-title { color: #f1f5f9; }
[data-bs-theme="dark"] .bg-white { background-color: var(--bg-card) !important; }
[data-bs-theme="dark"] .modal-content { background-color: var(--bg-card); border-color: var(--border-color); color: var(--text-primary); }
[data-bs-theme="dark"] .modal-header { border-bottom-color: var(--border-color); }
[data-bs-theme="dark"] .modal-footer { border-top-color: var(--border-color); }
[data-bs-theme="dark"] .table-light { --bs-table-bg: rgba(255,255,255,0.03); color: var(--text-primary); }
[data-bs-theme="dark"] .sc-notif-dropdown { background-color: #1e293b; border-color: var(--border-color); }
[data-bs-theme="dark"] .notification-item:hover { background-color: rgba(255,255,255,0.04); }
[data-bs-theme="dark"] .sc-notif-header { border-bottom-color: var(--border-color); }
[data-bs-theme="dark"] .login-card { background-color: var(--bg-card) !important; border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .login-body { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
[data-bs-theme="dark"] .sc-color-option { background: #0f172a; border-color: var(--border-color); }
[data-bs-theme="dark"] .sc-color-option span { color: var(--text-secondary); }
[data-bs-theme="dark"] .sc-footer { background-color: var(--bg-card); border-top-color: var(--border-color); color: var(--text-secondary); }
[data-bs-theme="dark"] .text-dark { color: var(--text-primary) !important; }
[data-bs-theme="dark"] .chat-box { background: #0f172a; border-color: var(--border-color); }
[data-bs-theme="dark"] .chat-msg { background: var(--bg-card); border-color: var(--border-color); }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }
[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: #1e293b; }
[data-bs-theme="dark"] code { background: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .table-dark { background-color: var(--bg-card) !important; color: var(--text-primary); --bs-table-bg: var(--bg-card); }
[data-bs-theme="dark"] .card-footer { background-color: var(--bg-card) !important; border-top-color: var(--border-color) !important; }
[data-bs-theme="dark"] .bg-dark { background-color: var(--bg-card) !important; }
[data-bs-theme="dark"] .list-group-item { background-color: var(--bg-card); border-color: var(--border-color); color: var(--text-primary); }
[data-bs-theme="dark"] .accordion-item { background-color: var(--bg-card); border-color: var(--border-color); }
[data-bs-theme="dark"] .accordion-button { background-color: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); }
[data-bs-theme="dark"] .accordion-button:not(.collapsed) { background-color: rgba(var(--primary-rgb), 0.1); color: var(--text-primary); }
[data-bs-theme="dark"] .accordion-body { background-color: var(--bg-card); color: var(--text-primary); }
[data-bs-theme="dark"] .kanban-col { background: var(--bg-card) !important; border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .kanban-card { background: var(--bg-body) !important; border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important; }
[data-bs-theme="dark"] .legenda-mapa { background: var(--bg-card) !important; border-color: var(--border-color) !important; color: var(--text-primary); }
[data-bs-theme="dark"] .leaflet-popup-content-wrapper { background: var(--bg-card); color: var(--text-primary); }
[data-bs-theme="dark"] .leaflet-popup-tip { background: var(--bg-card); }
[data-bs-theme="dark"] .border-bottom { border-color: var(--border-color) !important; }
[data-bs-theme="dark"] .border { border-color: var(--border-color) !important; }

/* ====== UTILITY CLASSES ====== */
.sc-text-xs { font-size: 0.65rem; }
.sc-text-sm { font-size: 0.75rem; }
.sc-text-subtitle { font-size: 0.88rem; }

/* ====== BODY ====== */
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ====== ANIMATIONS ====== */
@keyframes fadeInUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideInLeft { from { opacity:0; transform:translateX(-20px); } to { opacity:1; transform:translateX(0); } }
@keyframes notifPulse { 0%,100% { box-shadow:0 0 0 0 rgba(var(--primary-rgb),0.3); } 50% { box-shadow:0 0 0 8px rgba(var(--primary-rgb),0); } }
@keyframes highlightFade { 0% { background-color:rgba(var(--primary-rgb),0.15); } 100% { background-color:transparent; } }
@keyframes shimmer { 0% { background-position:-200% 0; } 100% { background-position:200% 0; } }

.sc-animate-in { animation: fadeInUp 0.5s ease-out; }

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ====== SIDEBAR ====== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    background: var(--sidebar-bg);
    color: #9ca3af;
    transition: var(--transition);
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

.sidebar.collapsed, body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }

.sidebar.collapsed .nav-link span, .sidebar.collapsed h4 span,
.sidebar.collapsed .user-info-text, .sidebar.collapsed hr,
body.sidebar-collapsed .sidebar .nav-link span, body.sidebar-collapsed .sidebar h4 span,
body.sidebar-collapsed .sidebar .user-info-text, body.sidebar-collapsed .sidebar hr { display: none; }

.sidebar.collapsed .nav-link, body.sidebar-collapsed .sidebar .nav-link { justify-content:center; padding:0.8rem 0; margin:0.3rem 0; }
.sidebar.collapsed .nav-link i, body.sidebar-collapsed .sidebar .nav-link i { margin-right:0; font-size:1.4rem; }
.sidebar.collapsed .d-flex.justify-content-between, body.sidebar-collapsed .sidebar .d-flex.justify-content-between { justify-content:center !important; }
.sidebar.collapsed .user-profile-box, body.sidebar-collapsed .sidebar .user-profile-box { padding:0 !important; }
.sidebar.collapsed .badge, body.sidebar-collapsed .sidebar .badge { display:none; }

.sidebar .nav-link {
    color: #9ca3af;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
    margin: 0.3rem 0.7rem;
    white-space: nowrap;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0; top: 0; height: 100%; width: 3px;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.sidebar .nav-link:hover::before, .sidebar .nav-link.active::before { transform: scaleY(1); }

.sidebar .nav-link i {
    font-size: 1.2rem;
    margin-right: 1rem;
    min-width: 1.5rem;
    text-align: center;
    transition: var(--transition-fast);
}

.sidebar .nav-link:hover, .sidebar .nav-link.active { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar .nav-link:hover i { color: var(--primary-color); transform: scale(1.1); }

.profile-pic {
    width: 60px; height: 60px;
    object-fit: cover;
    transition: var(--transition);
    border: 2px solid rgba(255,255,255,0.1);
}
.profile-pic:hover { border-color: var(--primary-color); transform: scale(1.05); }

.sidebar.collapsed .profile-pic, body.sidebar-collapsed .sidebar .profile-pic { width:45px !important; height:45px !important; margin-bottom:0 !important; }

/* ====== MAIN CONTENT ====== */
.main-content {
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
}

body.sidebar-collapsed .main-content, .sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* ====== MOBILE ====== */
@media (max-width: 768px) {
    .sidebar { left: -100%; }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    .sidebar.mobile-show { left: 0; width: 280px; }
    .mobile-nav { display: flex !important; }
    .sc-stat-card { padding: 1.2rem !important; min-height: auto !important; }
    .sc-stat-card .sc-stat-number { font-size: 1.4rem !important; }
    .sc-notif-dropdown { width: 300px; right: -10px; }
}

/* ====== TOPBAR ====== */
.sc-topbar { position: relative; z-index: 100; }

/* ====== NOTIFICATIONS ====== */
.sc-notif-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}
.sc-notif-btn:hover { background:var(--primary-color); color:#fff; border-color:var(--primary-color); transform:scale(1.05); }
.sc-notif-btn:active { transform: scale(0.95); }
.sc-notif-btn.has-notifications { animation: notifPulse 2s infinite; }

.sc-notif-badge {
    position: absolute; top:-4px; right:-4px;
    background: #ef4444; color: #fff;
    font-size: 0.65rem; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-body);
}

.sc-notif-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 380px; max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px -10px rgba(0,0,0,0.15);
    z-index: 1050;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}
.sc-notif-dropdown.show { opacity:1; visibility:visible; transform:translateY(0); }

.sc-notif-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.sc-notif-header .btn-link { font-size:0.78rem; text-decoration:none; color:var(--primary-color); padding:0; transition:var(--transition-fast); }
.sc-notif-header .btn-link:hover { opacity: 0.8; }

.sc-notif-list { max-height: 400px; overflow-y: auto; }

.notification-item {
    display: flex; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer; transition: var(--transition-fast);
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background-color: rgba(var(--primary-rgb),0.04); padding-left: 20px; }

.notification-icon-wrap {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 0.85rem;
    transition: var(--transition-fast);
}
.notification-item:hover .notification-icon-wrap { background:var(--primary-color); color:#fff; transform:scale(1.1); }

.notification-body { flex:1; min-width:0; }
.notification-text {
    margin:0; font-size:0.82rem; color:var(--text-primary); line-height:1.4;
    display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.notification-time { font-size: 0.72rem; color: var(--text-muted); }
.notification-empty { text-align:center; padding:40px 20px; color:var(--text-muted); }
.notification-empty i { font-size:2rem; margin-bottom:8px; display:block; }
.notification-empty p { margin:0; font-size:0.85rem; }

/* ====== TOAST ====== */
.sc-toast {
    position: fixed; top:20px; right:20px; z-index:9999;
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px -10px rgba(0,0,0,0.2);
    max-width: 400px;
    opacity: 0; transform: translateX(100%);
    transition: var(--transition);
}
.sc-toast.show { opacity:1; transform:translateX(0); }

.sc-toast-icon {
    width:36px; height:36px; border-radius:50%;
    background:rgba(var(--primary-rgb),0.1); color:var(--primary-color);
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.sc-toast-body strong { display:block; font-size:0.85rem; margin-bottom:2px; color:var(--text-primary); }
.sc-toast-body p { margin:0; font-size:0.8rem; color:var(--text-secondary); line-height:1.4; }
.sc-toast-close {
    background:none; border:none; font-size:1.2rem;
    color:var(--text-muted); cursor:pointer; padding:0; line-height:1;
    transition: var(--transition-fast);
}
.sc-toast-close:hover { color:var(--text-primary); transform:scale(1.2); }

/* ====== CARDS - UNIFIED ====== */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    transition: var(--transition);
    overflow: hidden;
}
.card:hover { box-shadow: var(--card-shadow-hover); }

.card-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600; padding: 1rem 1.25rem;
    color: var(--text-primary); font-size: 0.92rem;
}
.card-body { padding: 1.25rem; }

/* ====== STAT CARDS - UNIFORM SIZE ====== */
.sc-stat-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    border: none;
    transition: var(--transition);
    min-height: 120px;
    display: flex; flex-direction: column; justify-content: center;
}
.sc-stat-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px -8px rgba(0,0,0,0.2); }
.sc-stat-card:active { transform: translateY(-2px); }

.sc-stat-card .sc-stat-icon {
    width:48px; height:48px; border-radius:12px;
    display:flex; align-items:center; justify-content:center;
    font-size:1.2rem; background:rgba(255,255,255,0.2); color:#fff;
    transition: var(--transition-fast);
}
.sc-stat-card:hover .sc-stat-icon { transform: rotate(10deg) scale(1.1); }

.sc-stat-card h6 { font-size:0.75rem; text-transform:uppercase; letter-spacing:0.5px; opacity:0.85; margin-bottom:4px; }
.sc-stat-card .sc-stat-number { font-size:1.8rem; font-weight:800; line-height:1.1; transition:var(--transition-fast); }

.sc-stat-card::after {
    content:''; position:absolute; top:-20px; right:-20px;
    width:80px; height:80px; border-radius:50%;
    background:rgba(255,255,255,0.08); transition:var(--transition);
}
.sc-stat-card:hover::after { transform: scale(1.5); }

.sc-stat-card.bg-gradient-primary   { background: var(--primary-gradient); color:#fff; }
.sc-stat-card.bg-gradient-warning   { background: linear-gradient(135deg,#f59e0b,#d97706); color:#fff; }
.sc-stat-card.bg-gradient-info      { background: linear-gradient(135deg,#06b6d4,#0284c7); color:#fff; }
.sc-stat-card.bg-gradient-success   { background: linear-gradient(135deg,#10b981,#059669); color:#fff; }
.sc-stat-card.bg-gradient-danger    { background: linear-gradient(135deg,#ef4444,#dc2626); color:#fff; }
.sc-stat-card.bg-gradient-secondary { background: linear-gradient(135deg,#6b7280,#4b5563); color:#fff; }

/* ====== TABLES - UNIFIED ====== */
.table { font-size: 0.88rem; }
.table thead th { font-size:0.75rem; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-muted); font-weight:600; border-bottom-width:1px; padding:0.85rem 1rem; }
.table tbody td { padding:0.85rem 1rem; vertical-align:middle; }
.table-hover tbody tr { transition: var(--transition-fast); }
.table-hover tbody tr:hover { background-color: rgba(var(--primary-rgb),0.03); }

/* ====== BADGES - UNIFIED ====== */
.badge { padding:0.45em 0.85em; font-weight:500; font-size:0.75rem; border-radius:6px; transition:var(--transition-fast); }

/* ====== PAGINATION ====== */
.pagination { gap: 4px; }
.page-link {
    border-radius: 0.5rem !important;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
    transition: var(--transition);
}
.page-link:hover { background: rgba(var(--primary-rgb), 0.08); color: var(--primary-color); border-color: var(--primary-color); transform: translateY(-1px); }
.page-item.active .page-link { background: var(--primary-color); border-color: var(--primary-color); color: #fff; box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3); }
.page-item.disabled .page-link { opacity: 0.4; pointer-events: none; }
[data-bs-theme="dark"] .page-link { background: var(--bg-card); border-color: var(--border-color); color: var(--text-primary); }
[data-bs-theme="dark"] .page-link:hover { background: rgba(var(--primary-rgb), 0.15); }

/* ====== BUTTONS - UNIFIED ====== */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content:''; position:absolute; top:50%; left:50%;
    width:0; height:0; background:rgba(255,255,255,0.2);
    border-radius:50%; transform:translate(-50%,-50%);
    transition: width 0.4s ease, height 0.4s ease;
}
.btn:active::after { width:300px; height:300px; }

.btn-primary { background: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover { background:var(--primary-hover); border-color:var(--primary-hover); transform:translateY(-1px); box-shadow:0 4px 12px rgba(var(--primary-rgb),0.3); }
.btn-primary:active { transform:translateY(0); box-shadow:none; }

.btn-outline-primary { color:var(--primary-color); border-color:var(--primary-color); }
.btn-outline-primary:hover { background:var(--primary-color); border-color:var(--primary-color); color:#fff; transform:translateY(-1px); box-shadow:0 4px 12px rgba(var(--primary-rgb),0.25); }

.btn-success:hover   { transform:translateY(-1px); box-shadow:0 4px 12px rgba(16,185,129,0.3); }
.btn-danger:hover    { transform:translateY(-1px); box-shadow:0 4px 12px rgba(239,68,68,0.3); }
.btn-warning:hover   { transform:translateY(-1px); box-shadow:0 4px 12px rgba(245,158,11,0.3); }
.btn-info:hover      { transform:translateY(-1px); box-shadow:0 4px 12px rgba(6,182,212,0.3); }
.btn-secondary:hover { transform:translateY(-1px); box-shadow:0 4px 12px rgba(107,114,128,0.3); }

.btn-outline-success:hover, .btn-outline-danger:hover, .btn-outline-warning:hover,
.btn-outline-info:hover, .btn-outline-secondary:hover { transform:translateY(-1px); }
.btn:active { transform:translateY(0) !important; }

.sc-btn-lg { padding:0.7rem 1.5rem; font-size:0.95rem; font-weight:600; }
.btn-sm { padding:0.35rem 0.75rem; font-size:0.8rem; border-radius:6px; }

/* ====== FORMS - UNIFIED ====== */
.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: var(--border-color);
    padding: 0.6rem 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
}
.form-control:focus, .form-select:focus { border-color:var(--primary-color); box-shadow:0 0 0 3px rgba(var(--primary-rgb),0.12); }

.form-label { font-size:0.85rem; font-weight:500; color:var(--text-primary); margin-bottom:0.4rem; }

.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
    border-color: var(--border-color);
    background: var(--bg-light);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.form-check-input:checked { background-color:var(--primary-color); border-color:var(--primary-color); }
.form-switch .form-check-input { transition: var(--transition); }

/* ====== ALERTS - UNIFIED ====== */
.sc-alert { border-radius:0.5rem; padding:0.85rem 1.2rem; font-size:0.88rem; border:none; animation:fadeInUp 0.3s ease-out; }
.alert { border-radius: 0.5rem; font-size: 0.88rem; }

/* ====== MOBILE NAV ====== */
.mobile-nav {
    display: none;
    background: var(--bg-card);
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    position: sticky; top: 0; z-index: 1020;
    border-bottom: 1px solid var(--border-color);
    align-items: center; justify-content: space-between;
}
.mobile-nav > button, .mobile-nav > div { flex: 0 0 40px; min-width: 40px; }
.mobile-nav > h5 { flex: 1 1 auto; text-align: center; margin: 0; }
.sc-mobile-toggle { color: var(--text-primary); font-size: 1.25rem; }
.sc-mobile-toggle:hover { color: var(--primary-color); background: transparent; }
.sc-mobile-title { color: var(--text-primary); font-weight: 700; letter-spacing: 0.5px; }

/* ====== LOGIN PAGE ====== */
.login-body {
    background: linear-gradient(135deg, var(--bg-light) 0%, #dbeafe 50%, var(--bg-light) 100%);
    min-height: 100vh;
}
.login-card {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.1) !important;
    overflow: hidden;
}
.login-card::before { content:''; display:block; height:4px; background:var(--primary-gradient); }
.login-logo {
    width:64px; height:64px; margin:0 auto;
    border-radius:16px; background:var(--primary-gradient);
    color:#fff; display:flex; align-items:center; justify-content:center;
    font-size:1.8rem;
    box-shadow: 0 8px 24px rgba(var(--primary-rgb),0.25);
    transition: var(--transition);
}
.login-logo:hover { transform: rotate(10deg) scale(1.08); }

code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 0.82rem; }

/* ====== FOOTER ====== */
.sc-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ====== HIGHLIGHT ROW ====== */
.highlight-row { animation: highlightFade 3s ease-out forwards; }

/* ====== DASHBOARD ====== */
.sc-alert-critical {
    background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(239,68,68,0.02));
    border: 1px solid rgba(239,68,68,0.2);
    border-left: 4px solid #ef4444;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-size: 0.88rem;
}
.sc-alert-estoque {
    background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(245,158,11,0.03));
    border: 1px solid rgba(245,158,11,0.2);
    border-left: 4px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-size: 0.88rem;
}
.sc-alert-estoque .border-bottom { border-color: var(--border-color) !important; }

/* ====== PWA INSTALL BANNER ====== */
.sc-install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: calc(100% - 32px);
    max-width: 420px;
}
.sc-install-inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
}
.sc-install-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.sc-install-icon img { width: 100%; height: 100%; object-fit: cover; }
.sc-install-content { flex: 1; min-width: 0; }
.sc-install-content strong { font-size: 1rem; color: var(--text-primary); }
.sc-install-content small { font-size: 0.8rem; line-height: 1.4; }
.sc-install-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.sc-install-close:hover { opacity: 1; }
.sc-install-banner.sc-install-hide {
    animation: scInstallSlideOut 0.35s ease forwards;
}
@keyframes scInstallSlideOut {
    to { opacity: 0; transform: translateX(-50%) translateY(30px); }
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .sc-install-inner {
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
}

.sc-datetime {
    display:flex; align-items:center; gap:0.5rem;
    font-size:0.85rem; color:var(--text-secondary);
    background:var(--bg-card); padding:0.5rem 1rem;
    border-radius:0.5rem; border:1px solid var(--border-color);
}
.sc-datetime i { color: var(--primary-color); }

/* ====== COLOR PICKER (Configuracoes) ====== */
.sc-color-option {
    display:flex; flex-direction:column; align-items:center; gap:6px;
    padding:10px; border-radius:0.5rem;
    border:2px solid var(--border-color);
    cursor:pointer; transition:var(--transition);
    background:var(--bg-light);
}
.sc-color-option:hover { border-color:var(--text-muted); transform:translateY(-2px); }
.sc-color-option.active { border-color:var(--primary-color); box-shadow:0 0 0 3px rgba(var(--primary-rgb),0.15); }

.sc-color-swatch { width:100%; height:32px; border-radius:6px; transition:var(--transition-fast); }
.sc-color-option:hover .sc-color-swatch { transform:scale(1.05); }
.sc-color-option span { font-size:0.72rem; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:0.5px; }

/* ====== CHART ====== */
.chart-container { position:relative; height:260px; display:flex; align-items:center; justify-content:center; }

/* ====== PHOTO GALLERY ====== */
.gallery-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px; }
.gallery-grid img {
    width:100%; height:120px; object-fit:cover;
    border-radius:0.5rem; cursor:pointer;
    transition:var(--transition); border:2px solid transparent;
}
.gallery-grid img:hover { transform:scale(1.05); border-color:var(--primary-color); box-shadow:0 8px 20px rgba(0,0,0,0.15); }

/* ====== LIGHTBOX GLOBAL ====== */
.sc-lightbox {
    position:fixed; inset:0; z-index:99999;
    background:rgba(0,0,0,0.92);
    display:flex; align-items:center; justify-content:center;
    opacity:0; visibility:hidden;
    transition:opacity 0.3s, visibility 0.3s;
}
.sc-lightbox.active { opacity:1; visibility:visible; }
.sc-lb-content {
    display:flex; align-items:center; justify-content:center;
    max-width:90vw; max-height:90vh; position:relative;
}
.sc-lb-img {
    max-width:90vw; max-height:85vh;
    object-fit:contain; border-radius:8px;
    box-shadow:0 8px 40px rgba(0,0,0,0.5);
    transition:opacity 0.15s;
    user-select:none; -webkit-user-drag:none;
}
.sc-lb-close {
    position:absolute; top:16px; right:20px; z-index:10;
    background:rgba(220,38,38,0.85); color:#fff; border:none;
    width:44px; height:44px; border-radius:50%;
    font-size:1.5rem; line-height:1; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    transition:background 0.2s, transform 0.2s;
    box-shadow:0 2px 12px rgba(0,0,0,0.3);
}
.sc-lb-close:hover { background:rgba(220,38,38,1); transform:scale(1.1); }
.sc-lb-prev, .sc-lb-next {
    position:absolute; top:50%; transform:translateY(-50%); z-index:10;
    background:rgba(255,255,255,0.15); color:#fff; border:none;
    width:48px; height:48px; border-radius:50%;
    font-size:1.2rem; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    transition:background 0.2s, transform 0.2s;
    backdrop-filter:blur(4px);
}
.sc-lb-prev { left:16px; }
.sc-lb-next { right:16px; }
.sc-lb-prev:hover, .sc-lb-next:hover {
    background:rgba(255,255,255,0.3); transform:translateY(-50%) scale(1.1);
}
.sc-lb-counter {
    position:absolute; bottom:20px; left:50%; transform:translateX(-50%);
    color:rgba(255,255,255,0.8); font-size:0.85rem;
    background:rgba(0,0,0,0.5); padding:4px 14px; border-radius:20px;
    backdrop-filter:blur(4px);
}
@media (max-width:576px) {
    .sc-lb-prev, .sc-lb-next { width:40px; height:40px; font-size:1rem; }
    .sc-lb-prev { left:8px; }
    .sc-lb-next { right:8px; }
    .sc-lb-close { top:10px; right:12px; width:38px; height:38px; font-size:1.3rem; }
}

/* ====== MODALS - UNIFIED ====== */
.modal-content { border-radius:var(--radius-lg); border:none; box-shadow:0 25px 60px rgba(0,0,0,0.15); overflow:hidden; }
.modal-header { padding:1.2rem 1.5rem; border-bottom:1px solid var(--border-color); }
.modal-body { padding:1.5rem; }
.modal-footer { padding:1rem 1.5rem; border-top:1px solid var(--border-color); }

/* ====== CHAT / COMMENTS ====== */
.chat-box { max-height:300px; overflow-y:auto; padding:1rem; background:var(--bg-light); border-radius:0.5rem; border:1px solid var(--border-color); }
.chat-msg {
    margin-bottom:0.75rem; padding:0.6rem 0.9rem;
    border-radius:0.5rem; background:var(--bg-card);
    border:1px solid var(--border-color);
    transition:var(--transition-fast);
    animation: fadeInUp 0.2s ease-out;
}
.chat-msg:hover { border-color:rgba(var(--primary-rgb),0.2); box-shadow:0 2px 8px rgba(0,0,0,0.04); }
.chat-msg-admin { border-left:3px solid var(--primary-color); }
.chat-msg-tecnico { border-left:3px solid #10b981; }

/* ====== PROFILE ====== */
.profile-avatar-lg {
    width:120px; height:120px; object-fit:cover;
    border-radius:50%; border:4px solid var(--bg-card);
    box-shadow:0 8px 24px rgba(0,0,0,0.1);
    transition:var(--transition);
}
.profile-avatar-lg:hover { transform:scale(1.05); border-color:var(--primary-color); }

/* ====== MISC ====== */
a { transition: color 0.15s ease; }
.text-decoration-none:hover { opacity: 0.95; }
.container-fluid { animation: fadeIn 0.3s ease-out; }

/* ====== SCROLLABLE CONTAINERS ====== */
.sc-scroll-sm  { max-height: 150px; overflow-y: auto; }
.sc-scroll-md  { max-height: 250px; overflow-y: auto; }
.sc-scroll-lg  { max-height: 300px; overflow-y: auto; }
.sc-scroll-vh  { max-height: 70vh; overflow-y: auto; }

/* ====== THUMBNAIL IMAGES ====== */
.sc-thumb-img { max-height: 150px; cursor: pointer; transition: var(--transition); }
.sc-thumb-img:hover { transform: scale(1.03); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.sc-thumb-lg { max-height: 250px; cursor: pointer; transition: var(--transition); }
.sc-thumb-lg:hover { transform: scale(1.03); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

/* ====== CHAT TIMESTAMP ====== */
.sc-chat-time { font-size: 0.75rem; color: var(--text-muted); }
.sc-chat-history { font-size: 0.9em; }

/* ====== LOGS TABLE ====== */
.sc-logs-table { font-size: 0.85rem; }
.sc-col-datetime { width: 200px; }
.sc-col-level { width: 100px; }

/* ====== REPORT PRINT ====== */
.sc-report-header { border-bottom: 2px solid var(--text-primary); margin-bottom: 20px; padding-bottom: 10px; }

/* ====== PRINT ====== */
@media print {
    .sidebar, .mobile-nav, .sc-topbar, .sc-footer, .btn, .no-print { display:none !important; }
    .main-content { margin-left:0 !important; width:100% !important; }
    .card { break-inside:avoid; box-shadow:none; border:1px solid #ddd; }
    body { background-color: white !important; }
}
