/* ===========================
   VARIÁVEIS E RESET GLOBAL
   =========================== */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f97316;
    --danger-color: #ef4444;
    --light-bg: #f9fafb;
    --border-color: #e5e7eb;
    --light-border: #d1d5db;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

/* ===========================
   TELAS PRINCIPAIS
   =========================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, 30px);
    }
}

.screen {
    display: none;
    visibility: hidden;
    opacity: 0;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: fadeIn 0.3s ease-in;
}

#loginScreen {
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

#mainScreen {
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-color);
    overflow-y: auto;
}

/* ===========================
   LOGIN
   =========================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 28px;
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-light);
    font-size: 12px;
}

.photo-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.photo-input-group input[type="file"] {
    padding: 8px 12px;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.photo-url-input {
    padding: 10px 12px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    font-size: 13px !important;
}

.photo-url-input::placeholder {
    color: var(--text-light);
}

.photo-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.photo-preview img {
    width: 120px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: var(--light-bg);
}

.login-note {
    text-align: center;
    color: var(--text-light);
    margin-top: 16px;
    font-size: 12px;
}

/* ===========================
   BOTÕES
   =========================== */

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--light-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    opacity: 0.9;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--text-dark);
}

/* ===========================
   NAVBAR
   =========================== */

.navbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.hamburger:hover {
    background: #f8fafc;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    border-radius: 6px;
    transition: var(--transition);
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--primary-color);
    background-color: #eff6ff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
    font-size: 14px;
}

.sync-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-sync {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-sync:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-sync:active {
    transform: translateY(0);
}

/* ===========================
   CONTAINER E MAIN
   =========================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    margin-bottom: 24px;
    font-size: 24px;
    color: var(--text-dark);
}

/* ===========================
   DASHBOARD
   =========================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-value.status-em-uso {
    color: var(--warning-color);
}

.stat-value.status-disponivel {
    color: var(--success-color);
}

.stat-value.status-manutencao {
    color: var(--danger-color);
}

.stat-value.status-baixado {
    color: var(--text-light);
}

/* ===========================
   GRÁFICOS
   =========================== */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.chart-container h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

#chartStatus,
#chartTipo,
#chartDepartment,
#chartColaborador,
#chartMovTipo,
#chartMovMes {
    width: 100%;
    height: 300px;
}

.mov-row {
    cursor: pointer;
}

.mov-row:hover {
    background-color: #f3f4f6;
}

/* ===========================
   TABELAS
   =========================== */

.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

.filter-select {
    flex: 0 1 150px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background-color: var(--light-bg);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===========================
   STATUS BADGES
   =========================== */

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-disponivel {
    background-color: #dcfce7;
    color: #166534;
}

.badge-em-uso {
    background-color: #fef08a;
    color: #713f12;
}

.badge-manutencao {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-baixado {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* ===========================
   MODAL
   =========================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text-dark);
}

#formEquipamento,
#formColaborador,
#formMovimentacao {
    padding: 20px;
}

/* Tabs de modo de cadastro */
.form-mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.mode-tab {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.mode-tab:hover {
    color: var(--primary-color);
}

.mode-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.form-mode-content {
    display: none;
}

.form-mode-content.active {
    display: block;
}

.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
}

.info-box strong {
    color: #1565c0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row.full {
    grid-template-columns: 1fr;
}

.modal-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===========================
   MOVIMENTAÇÕES - MODAL
   =========================== */

.movimentacao-modal .modal-body {
    padding: 20px;
}

.movimentacao-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.movimentacao-summary .summary-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
}

.summary-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.summary-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.movimentacao-details {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.movimentacao-details .detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 14px;
}

.movimentacao-details .detail-row:last-child {
    border-bottom: none;
}

.movimentacao-details .detail-label {
    color: var(--text-light);
    min-width: 120px;
}

.movimentacao-details .detail-value {
    color: var(--text-dark);
    font-weight: 500;
    text-align: right;
    flex: 1;
}

.assign-user-info {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.assign-user-info p {
    margin: 8px 0;
    font-size: 14px;
}

.assign-user-info strong {
    color: var(--text-color);
    margin-right: 8px;
}

/* ===========================
   TOAST NOTIFICATION
   =========================== */

.toast {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 20px;
    background-color: var(--success-color);
    color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.toast.active {
    display: block;
}

.toast.error {
    background-color: var(--danger-color);
}

.toast.warning {
    background-color: var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===========================
   CONFIGURAÇÕES
   =========================== */

.settings-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    margin-bottom: 16px;
    color: var(--text-dark);
}

.settings-section p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 16px;
}

.settings-section.danger {
    border-left: 4px solid var(--danger-color);
}

.settings-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

/* ===========================
   MOVIMENTAÇÕES RECENTES
   =========================== */

.recent-movements {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.recent-movements h3 {
    margin-bottom: 16px;
    color: var(--text-dark);
}

/* ===========================
   RESPONSIVO
   =========================== */

@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px;
    }

    .logo-wrap {
        justify-content: flex-start;
    }

    .hamburger {
        display: inline-flex;
        align-self: flex-end;
        margin-top: -44px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        overflow: visible;
        padding-bottom: 0;
        gap: 6px;
    }

    .nav-btn {
        font-size: 13px;
        padding: 6px 12px;
        white-space: nowrap;
    }

    .user-info,
    .sync-buttons {
        display: none;
        align-self: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .navbar-content.nav-open .nav-menu,
    .navbar-content.nav-open .user-info,
    .navbar-content.nav-open .sync-buttons {
        display: flex;
    }

    .container {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .equipment-card-image {
        height: 170px;
    }

    .equipment-card-content {
        padding: 16px;
    }

    .card-actions-mini {
        flex-wrap: wrap;
    }

    .btn-icon {
        flex: 1 1 45%;
    }

    .equipment-status-resumo {
        font-size: 13px;
    }

    .toolbar {
        flex-direction: column;
    }

    .filter-input,
    .filter-select {
        min-width: 100%;
    }

    .modal-content {
        width: 95%;
    }

    .data-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }

    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .login-box {
        padding: 30px 20px;
    }

    .stat-card h3 {
        font-size: 12px;
    }

    .stat-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .navbar {
        position: relative;
    }

    .navbar-content {
        flex-direction: column;
    }

    .nav-menu {
        overflow-x: auto;
    }

    .container {
        padding: 16px 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 20px 16px;
    }

    .login-box h1 {
        font-size: 22px;
    }

    .tab-content h2 {
        font-size: 18px;
    }

    .modal-content {
        width: 98%;
        max-height: 95vh;

    .modal-lg,
    .modal-md {
        max-width: 96%;
    }
    }

    .equipment-card-image {
        height: 150px;
    }

    .equipment-card-title {
        font-size: 16px;
    }

    .equipment-card-subtitle {
        font-size: 13px;
    }

    .btn-icon {
        flex: 1 1 100%;
    }
}

/* ===========================
   SCROLLBAR CUSTOMIZADO
   =========================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
/* ===========================
   EQUIPMENT CARD MODAL
   =========================== */

.equipment-card-modal {
    max-width: 900px;
    padding: 0;
}

.equipment-card-full {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0;
    min-height: 500px;
}

.card-photo {
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: 32px;
    overflow-y: auto;
    max-height: 80vh;
}

.card-info h2 {
    margin: 0 0 12px 0;
    font-size: 28px;
    color: var(--text-color);
}

.card-info .badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.info-item strong {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 16px;
    color: var(--text-color);
}

.current-user-section {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.current-user-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.user-badge img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.user-badge div {
    flex: 1;
}

.user-badge strong {
    display: block;
    font-size: 16px;
}

.user-badge span {
    font-size: 13px;
    color: var(--text-light);
}

.small-text {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
}

.history-section h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    padding: 12px;
    background: var(--light-bg);
    border-left: 3px solid var(--primary-color);
    margin-bottom: 8px;
    border-radius: 4px;
}

.history-item strong {
    display: block;
    margin-bottom: 4px;
}

.history-item small {
    color: var(--text-light);
}

.card-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.card-actions .btn {
    flex: 1;
}

/* ===========================
   CARDS VISUAIS (GRID)
   =========================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 18px;
}

/* Cards de Equipamentos */
.equipment-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.equipment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.equipment-card-image {
    width: 100%;
    height: 200px;
    background: var(--light-bg);
    position: relative;
    overflow: hidden;
}

.equipment-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.equipment-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
}

.quantity-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    backdrop-filter: blur(4px);
}

.equipment-card-content {
    padding: 20px;
}

.equipment-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-color);
}

.equipment-card-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin: 0 0 16px 0;
}

.equipment-user-status {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    background: #f5f5f5;
    color: #666;
    border-left: 4px solid #999;
}

.equipment-user-status.em-uso {
    background: #fff3cd;
    color: #856404;
    border-left-color: #ff9800;
}

.equipment-user-status.disponivel {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.equipment-card-info {
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 600;
}

.card-actions-mini {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-icon {
    flex: 1;
    padding: 8px;
    background: var(--light-bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.btn-icon.btn-assign {
    background: #28a745;
    color: white;
}

.btn-icon.btn-assign:hover {
    background: #218838;
}

/* Cards de Colaboradores */
.colaborador-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.colaborador-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.colaborador-card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 24px;
    text-align: center;
    position: relative;
}

.colaborador-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.colaborador-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.colaborador-status.status-ativo {
    background: var(--success-color);
    color: white;
}

.colaborador-status.status-inativo {
    background: var(--error-color);
    color: white;
}

.colaborador-card-content {
    padding: 20px;
}

.colaborador-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-color);
    text-align: center;
}

.colaborador-role {
    font-size: 14px;
    color: var(--text-light);
    margin: 0 0 16px 0;
    text-align: center;
}

.colaborador-info {
    margin-bottom: 16px;
}

.equipment-card-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-item .number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-item .label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .equipment-card-full {
        grid-template-columns: 1fr;
    }
    
    .card-photo {
        min-height: 250px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   MODAL DE PERFIL DO COLABORADOR
   =========================== */

.colaborador-profile-modal {
    max-width: 900px;
    padding: 0;
}

.profile-layout {
    max-height: 85vh;
    overflow-y: auto;
}

.profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 24px;
    color: white;
}

.profile-photo-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.profile-basic-info h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: white;
}

.profile-role {
    margin: 0 0 16px 0;
    font-size: 16px;
    opacity: 0.9;
}

.profile-status-badges {
    display: flex;
    gap: 8px;
}

.profile-status-badges .badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-info {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.alert {
    margin: 24px 32px;
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-danger {
    background: #fee;
    border-color: var(--error-color);
    color: var(--error-color);
}

.alert strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.alert p {
    margin: 0;
    font-size: 14px;
}

.profile-section {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
}

.profile-section:last-of-type {
    border-bottom: none;
}

.profile-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--text-color);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-info-item .info-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info-item .info-value {
    font-size: 15px;
    color: var(--text-color);
    font-weight: 500;
}

.equipment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.equipment-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--light-bg);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.equipment-item:hover {
    background: #e8f4f8;
    transform: translateX(4px);
}

.equipment-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.equipment-item-info {
    flex: 1;
}

.equipment-item-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: var(--text-color);
}

.equipment-item-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
}

.equipment-item-date {
    font-size: 12px;
    color: var(--text-light);
}

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary-color);
    z-index: 1;
}

.timeline-item.returned::before {
    border-color: var(--success-color);
}

.timeline-item.active::before {
    border-color: var(--warning-color);
    background: var(--warning-color);
}

.timeline-content {
    background: var(--light-bg);
    padding: 16px;
    border-radius: 8px;
}

.timeline-content h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: var(--text-color);
}

.timeline-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
}

.timeline-date {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
}

.profile-actions {
    padding: 24px 32px;
    background: var(--light-bg);
    display: flex;
    gap: 12px;
}

.profile-actions .btn {
    flex: 1;
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
    
    .profile-info-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-section {
        padding: 20px;
    }
    
    .profile-actions {
        flex-direction: column;
    }
}

/* ========== MODAL DETALHES GRUPO ========== */

.modal-lg {
    max-width: 980px;
}

.modal-md {
    max-width: 500px;
}

.grupo-resumo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(63, 81, 181, 0.08), rgba(33, 150, 243, 0.08));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.resumo-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resumo-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.resumo-valor {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.badge-primary {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.unidades-container {
    max-height: 620px;
    overflow-y: auto;
    padding-right: 6px;
}

.unidades-container h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-color);
}

.unidade-item {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.unidade-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}

.unidade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.unidade-etiqueta {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-color);
    background: var(--light-bg);
    padding: 4px 10px;
    border-radius: 999px;
}

.unidade-status {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.unidade-status.status-disponível {
    background: #4caf50;
}

.unidade-status.status-em-uso {
    background: #2196f3;
}

.unidade-status.status-manutenção {
    background: #ff9800;
}

.unidade-status.status-baixado {
    background: #9e9e9e;
}

.unidade-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.unidade-info .info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.unidade-info .label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.unidade-info .value {
    font-size: 14px;
    color: var(--text-color);
}

.unidade-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.btn-sm:hover {
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

.btn-info:hover {
    background: #1976d2;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* Lista de colaboradores para atribuição */
.colaboradores-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.colaborador-option {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.colaborador-option:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.colaborador-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.colaborador-option small {
    display: block;
    font-size: 12px;
    opacity: 0.7;
}

.equipment-status-resumo {
    background: var(--light-bg);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-color);
    margin: 12px 0;
    border: 1px solid var(--border-color);
}

.badge-quantidade {
    background: linear-gradient(135deg, var(--primary-color), #1976d2) !important;
    color: white !important;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(25, 118, 210, 0.35);
}

/* ===========================
   LEITOR DE CÓDIGO DE BARRAS
   =========================== */

.leitor-modal-content {
    max-width: 500px;
    width: 90%;
}

.leitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 16px;
}

.leitor-header h2 {
    font-size: 18px;
    color: var(--text-dark);
    margin: 0;
}

.leitor-body {
    padding: 0 20px 20px;
    max-height: 700px;
    overflow-y: auto;
}

.leitor-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    background: white;
    transition: all 0.3s ease;
}

.leitor-input:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.leitor-input::placeholder {
    color: var(--text-light);
}

.leitor-input::placeholder {
    color: var(--text-light);
}

.camera-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#cameraPrincipal {
    transition: background-color 0.2s ease !important;
}

#quagga-frame-overlay {
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    border: 3px solid rgba(16, 185, 129, 0.6);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.1), 0 0 0 2000px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 10;
}

.leitor-resultado {
    margin: 12px 0;
    padding: 12px;
    background: var(--light-bg);
    border-radius: 6px;
    border-left: 4px solid var(--success-color);
}

.leitor-resultado .equipment-card {
    background: white;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.leitor-erro {
    margin: 12px 0;
    padding: 12px;
    background: #fff5f5;
    border-radius: 6px;
    border-left: 4px solid var(--danger-color);
    color: var(--danger-color);
    font-weight: 500;
    font-size: 13px;
}

.leitor-historico {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.leitor-historico h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.historico-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.historico-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--light-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.historico-item:hover {
    background: #eff6ff;
    border-color: var(--primary-color);
    transform: translateX(3px);
}

.historico-item-codigo {
    font-weight: 600;
    color: var(--primary-color);
}

.historico-item-hora {
    font-size: 11px;
    color: var(--text-light);
}

.leitor-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
