/* 
 * LeadTracker NFC - Estilos Principais
 * Bootstrap 5.3.2 + Custom Styles
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --lt-primary: #667eea;
    --lt-primary-dark: #5a67d8;
    --lt-secondary: #764ba2;
    --lt-success: #10b981;
    --lt-warning: #f59e0b;
    --lt-danger: #ef4444;
    --lt-info: #3b82f6;
    --lt-sidebar-width: 260px;
    --lt-sidebar-bg: #1e293b;
    --lt-sidebar-text: #94a3b8;
    --lt-header-height: 60px;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #e2e8f0;
    color: #334155;
}

/* Cards com design moderno */
.card {
    background-color: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 16px 16px 0 0;
    border: none;
    padding: 1.25rem 1.5rem;
}

.card-header .card-title {
    color: #ffffff;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Inputs modernos com estilo glassmorphism */
.form-control,
.form-select,
textarea.form-control {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-control:hover,
.form-select:hover {
    border-color: #cbd5e1;
    background: rgba(255, 255, 255, 1);
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--lt-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 6px -1px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Labels com estilo moderno */
.form-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label::before {
    content: "●";
    color: var(--lt-primary);
    font-size: 0.5rem;
}

/* Input groups com ícones */
.input-group {
    border-radius: 12px;
    overflow: hidden;
}

.input-group-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
}

/* Botões modernos */
.btn {
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(102, 126, 234, 0.4);
}

.btn-outline-secondary {
    border: 2px solid #e2e8f0;
    color: #64748b;
    background: transparent;
}

.btn-outline-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
}

/* Textarea com altura automática */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Form text (hints) */
.form-text {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-text::before {
    content: "ℹ";
    color: var(--lt-info);
}

a {
    color: var(--lt-primary);
    text-decoration: none;
}

a:hover {
    color: var(--lt-primary-dark);
}

/* ==========================================================================
   Layout - Sidebar
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--lt-sidebar-width);
    height: 100vh;
    background: var(--lt-sidebar-bg);
    color: var(--lt-sidebar-text);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand img,
.sidebar-logo {
    height: 40px;
    max-width: 180px;
    object-fit: contain;
}

.sidebar-nav {
    padding: 15px 0;
}

.sidebar-nav .nav-section {
    padding: 10px 20px 5px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

/* Submenu */
.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
}

.nav-submenu li {
    padding: 0;
}

.nav-submenu a {
    display: block;
    padding: 10px 20px 10px 50px;
    color: var(--lt-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-submenu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding-left: 55px;
}

.nav-submenu a.active {
    background: rgba(102, 126, 234, 0.2);
    color: var(--lt-primary);
    border-left: 3px solid var(--lt-primary);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--lt-sidebar-text);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: var(--lt-primary);
    border-left: 3px solid var(--lt-primary);
}

.sidebar-nav .nav-link i {
    width: 24px;
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

/* ==========================================================================
   Layout - Main Content
   ========================================================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: var(--lt-sidebar-width);
    min-height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-navbar {
    background: #fff;
    height: var(--lt-header-height);
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-content {
    padding: 25px;
    flex: 1;
}

.main-header {
    background: #fff;
    height: var(--lt-header-height);
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .header-left {
    display: flex;
    align-items: center;
}

.main-header .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-body {
    padding: 25px;
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.page-header {
    margin-bottom: 25px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.page-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 5px 0 0;
}

.breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 20px;
}

.card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 15px 20px;
}

/* ==========================================================================
   Stats Cards
   ========================================================================== */
.stat-card {
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card.primary, .stat-card.bg-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card.success, .stat-card.bg-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.stat-card.warning, .stat-card.bg-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-card.info, .stat-card.bg-info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.stat-card.danger, .stat-card.bg-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    top: 20px;
}

.stat-card .stat-content {
    position: relative;
    z-index: 1;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-card .stat-footer {
    margin-top: 10px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.stat-card .stat-footer .text-success {
    color: #a7f3d0 !important;
}

/* ==========================================================================
   Stat Mini (for product cards)
   ========================================================================== */
.stat-mini {
    display: flex;
    flex-direction: column;
}

.stat-mini .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-mini .stat-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table {
    margin-bottom: 0;
}

.table > thead {
    background: #f8fafc;
}

.table > thead > tr > th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
}

.table > tbody > tr > td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover > tbody > tr:hover {
    background-color: #f8fafc;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--lt-primary);
    border-color: var(--lt-primary);
}

.btn-primary:hover {
    background: var(--lt-primary-dark);
    border-color: var(--lt-primary-dark);
}

.btn-group-sm > .btn, .btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control, .form-select {
    border-radius: 6px;
    border-color: #e2e8f0;
    padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--lt-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.form-text {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ==========================================================================
   User Dropdown
   ========================================================================== */
.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 50px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    text-decoration: none;
}

.user-dropdown .dropdown-toggle:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-dropdown .dropdown-toggle::after {
    margin-left: 8px;
    opacity: 0.5;
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.user-info-nav {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name-nav {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.2;
}

.user-role-nav {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.2;
}

.user-dropdown .dropdown-menu {
    min-width: 220px;
    padding: 8px 0;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 12px;
}

.user-dropdown .dropdown-header {
    padding: 12px 16px;
}

.user-dropdown .dropdown-item {
    padding: 10px 16px;
}

.user-dropdown .dropdown-item:hover {
    background: #f1f5f9;
}

.user-dropdown .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lt-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-dropdown .user-info {
    text-align: left;
}

.user-dropdown .user-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 0.9rem;
}

.user-dropdown .user-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: none;
    color: #64748b;
}

.pagination .page-item.active .page-link {
    background: var(--lt-primary);
}

.pagination .page-link:hover {
    background: #f1f5f9;
    color: var(--lt-primary);
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* Sidebar brand icon spacing */
.sidebar-brand i {
    margin-right: 10px;
}

/* User info in sidebar footer */
.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-footer .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sidebar-footer .user-details {
    display: flex;
    flex-direction: column;
}

.sidebar-footer .user-name {
    font-weight: 500;
    color: #fff;
    font-size: 0.9rem;
}

.sidebar-footer .user-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* ==========================================================================
   Auth Pages
   ========================================================================== */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.auth-container,
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    max-width: 420px;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.auth-header {
    padding: 30px;
    text-align: center;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.auth-header img {
    max-height: 50px;
    margin-bottom: 15px;
}

.auth-logo-img {
    max-width: 200px;
    max-height: 60px;
    margin-bottom: 10px;
}

.auth-header h1,
.auth-logo {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0;
    font-weight: 700;
}

.auth-header p {
    color: #64748b;
    margin: 10px 0 0;
    font-size: 0.95rem;
}

.auth-body,
.auth-card > form,
.auth-card > div:not(.auth-header):not(.alert) {
    padding: 30px;
}

.auth-card .alert {
    margin: 0;
    border-radius: 0;
}

.auth-footer {
    padding: 20px 30px;
    background: #f8fafc;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
