/* ══════════════════════════════════════════════
   PORTAL PROJETO TI — Design System
   Baseado em projetoti.com.br
   ══════════════════════════════════════════════ */

/* ═══ CSS Variables ═══ */
:root {
    --bg-primary: #0F0F0F;
    --bg-secondary: #1A1A1A;
    --bg-card: #1E1E1E;
    --bg-input: #252525;
    --bg-hover: #2A2A2A;
    --bg-sidebar: #141414;

    --green-primary: #4ADE80;
    --green-dark: #22C55E;
    --green-glow: rgba(74, 222, 128, 0.15);
    --green-gradient: linear-gradient(135deg, #4ADE80, #22C55E);

    --blue-primary: #60A5FA;
    --yellow-primary: #F59E0B;
    --purple-primary: #A78BFA;
    --red-primary: #EF4444;

    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --text-muted: #666666;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-green: 0 4px 20px rgba(74, 222, 128, 0.2);

    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══ Reset & Base ═══ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
}

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ═══ Utilities ═══ */
.hidden {
    display: none !important;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ═══════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════ */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(74, 222, 128, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(34, 197, 94, 0.03) 0%, transparent 50%),
        var(--bg-primary);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    animation: slideIn 0.5s ease;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--green-gradient);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.logo-img {
    height: 100px;
    width: auto;
    object-fit: contain;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-footer {
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* ═══ Form Elements ═══ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    color: var(--green-primary);
    font-size: 12px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-select:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    padding-right: 44px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.password-wrapper input:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--green-primary);
}

.form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: #EF4444;
    font-size: 13px;
    text-align: center;
}

/* ═══ 2FA ═══ */
.twofa-header {
    text-align: center;
    margin-bottom: 8px;
}

.twofa-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: var(--green-primary);
}

.twofa-icon.setup {
    background: rgba(96, 165, 250, 0.15);
    color: var(--blue-primary);
}

.twofa-header h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.twofa-header p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.twofa-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 8px 0;
}

.twofa-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

.twofa-digit:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.qr-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: var(--radius-md);
    margin: 12px auto;
    width: fit-content;
}

.manual-key {
    text-align: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.manual-key code {
    display: block;
    margin-top: 4px;
    background: var(--bg-input);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--green-primary);
    letter-spacing: 2px;
    user-select: all;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    transition: color var(--transition-fast);
    width: 100%;
}

.btn-link:hover {
    color: var(--green-primary);
}

/* ═══ Buttons ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--green-gradient);
    color: #000;
    box-shadow: var(--shadow-green);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(74, 222, 128, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-input);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
    padding: 14px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-size: 14px;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-icon.edit:hover {
    color: var(--blue-primary);
    border-color: rgba(96, 165, 250, 0.3);
}

.btn-icon.delete:hover {
    color: var(--red-primary);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-icon.view:hover {
    color: var(--green-primary);
    border-color: rgba(74, 222, 128, 0.3);
}

.btn-icon.reset-2fa:hover {
    color: var(--yellow-primary);
    border-color: rgba(245, 158, 11, 0.3);
}

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */
#portal-screen {
    display: none;
    min-height: 100vh;
}

#portal-screen.active {
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: all var(--transition-slow);
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    min-height: 140px;
    position: relative;
}

.sidebar-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.logo-icon-sidebar {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}



.logo-text-sidebar {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}


.sidebar-toggle {
    position: absolute;
    right: 15px;
    top: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    display: none;
    transition: color var(--transition-fast);
}

.sidebar-toggle:hover {
    color: var(--green-primary);
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover:not(.disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--green-glow);
    color: var(--green-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--green-primary);
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.badge-soon {
    margin-left: auto;
    font-size: 10px;
    background: var(--bg-hover);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 16px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 16px 4px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-primary);
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    color: #EF4444;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ═════ Sidebar Minimized State (Desktop) ═════ */
@media (min-width: 769px) {
    body.sidebar-minimized .sidebar {
        width: var(--sidebar-collapsed) !important;
    }

    body.sidebar-minimized .main-content {
        margin-left: var(--sidebar-collapsed) !important;
    }

    /* Hover effect to expand (overlays content) using JS class */
    body.sidebar-minimized .sidebar.sidebar-expanded {
        width: var(--sidebar-width) !important;
        box-shadow: var(--shadow-lg);
    }

    /* Hide texts and adjust layout when minimized and NOT expanded */
    body.sidebar-minimized .sidebar:not(.sidebar-expanded) .logo-text-sidebar,
    body.sidebar-minimized .sidebar:not(.sidebar-expanded) .nav-item span,
    body.sidebar-minimized .sidebar:not(.sidebar-expanded) .nav-section-title,
    body.sidebar-minimized .sidebar:not(.sidebar-expanded) .user-details,
    body.sidebar-minimized .sidebar:not(.sidebar-expanded) .badge-soon {
        opacity: 0;
        visibility: hidden;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 0;
        overflow: hidden;
    }

    body.sidebar-minimized .sidebar:not(.sidebar-expanded) .btn-logout span {
        display: none;
    }

    body.sidebar-minimized .sidebar:not(.sidebar-expanded) .user-info {
        gap: 0;
    }

    body.sidebar-minimized .sidebar:not(.sidebar-expanded) .logo-icon-sidebar {
        height: 36px;
    }

    /* Rotate transition for the minimize button */
    body.sidebar-minimized .sidebar-minimize-btn i {
        transform: rotate(180deg);
    }
}

/* Ensure smooth text transitions inside sidebar */
.sidebar .logo-text-sidebar,
.sidebar .nav-item span,
.sidebar .nav-section-title,
.sidebar .user-details,
.sidebar .badge-soon {
    transition: opacity var(--transition-fast), width var(--transition-fast), margin var(--transition-fast);
    white-space: nowrap;
}

/* Minimize Toggle Button */
.sidebar-minimize-btn {
    position: absolute;
    right: -12px;
    top: 30px;
    width: 24px;
    height: 24px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    display: none;
    /* Shown via media query */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 101;
}

.sidebar-minimize-btn i {
    font-size: 10px;
    transition: transform var(--transition-fast);
}

.sidebar-minimize-btn:hover {
    color: var(--green-primary);
    border-color: var(--green-primary);
    background: var(--bg-input);
    box-shadow: 0 0 10px var(--green-glow);
}

@media (min-width: 769px) {
    .sidebar-minimize-btn {
        display: flex;
    }
}

/* ═══════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

.top-header {
    height: var(--header-height);
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
}

.page-info h1 {
    font-size: 20px;
    font-weight: 700;
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-primary);
    font-size: 14px;
}

.page-container {
    padding: 30px;
}

/* ═══ Stats Grid ═══ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #000;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ═══ Dashboard Grid ═══ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ═══ Card ═══ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--green-primary);
}

.card-body {
    padding: 20px 24px;
}

/* ═══ Recent List ═══ */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.recent-item:hover {
    background: var(--bg-hover);
}

.recent-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.recent-item-info {
    flex: 1;
    min-width: 0;
}

.recent-item-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-item-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.recent-item-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--green-primary);
    white-space: nowrap;
}

/* ═══ Empty State ═══ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 14px;
}

.empty-state-sm {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}

.empty-state-sm i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.3;
    display: block;
}

.empty-state-sm p {
    font-size: 13px;
}

/* ═══ Page Actions ═══ */
.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-bar {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-bar input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.filter-group {
    display: flex;
    gap: 8px;
}

/* ═══ Data Table ═══ */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.data-table thead {
    background: var(--bg-input);
}

.data-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 18px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.actions-cell {
    display: flex;
    gap: 6px;
}

/* ═══ Status Badge ═══ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.status-badge.active {
    background: rgba(74, 222, 128, 0.12);
    color: var(--green-primary);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-primary);
}

.status-badge.analise {
    background: rgba(245, 158, 11, 0.12);
    color: var(--yellow-primary);
}

.status-badge.avulso {
    background: rgba(245, 158, 11, 0.12);
    color: var(--yellow-primary);
}

.status-badge.plano {
    background: rgba(96, 165, 250, 0.12);
    color: var(--blue-primary);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ═══ Cards Grid (Planos) ═══ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.plano-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

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

.plano-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--green-gradient);
}

.plano-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.plano-card-title {
    font-size: 18px;
    font-weight: 700;
}

.plano-card-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--green-primary);
    margin-bottom: 12px;
}

.plano-card-price span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

.plano-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.plano-card-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ═══ Modal ═══ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.modal.wide {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

/* ═══ Peças List (Serviços) ═══ */
.pecas-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.peca-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.peca-item input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
}

.peca-item input:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.peca-item input:first-child {
    flex: 1;
}

.peca-item input:nth-child(2) {
    width: 140px;
}

.peca-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: var(--red-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.peca-remove:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-add-peca {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add-peca:hover {
    border-color: var(--green-primary);
    color: var(--green-primary);
}

.totals-summary {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.total-row.grand-total {
    border-top: 1px solid var(--border-color);
    margin-top: 6px;
    padding-top: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--green-primary);
}

/* ═══ Detail View ═══ */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-item {
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.detail-item.full {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
}

/* ═══ Toast ═══ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    min-width: 280px;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
    transition: all var(--transition-normal);
}

.toast.success {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--green-primary);
}

.toast.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red-primary);
}

.toast.info {
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: var(--blue-primary);
}

/* ══════════════ REPORTS MODULE ══════════════ */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.report-card:hover {
    border-color: var(--green-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: var(--bg-hover);
}

.report-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--green-primary);
    flex-shrink: 0;
}

.report-info h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.report-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.report-summary-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-item {
    background: var(--bg-input);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.summary-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--green-primary);
}

.chart-container {
    background: var(--bg-input);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    min-height: 300px;
}

/* Responsive Table for Reports */
.report-table-wrapper {
    overflow-x: auto;
    margin-top: 10px;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 9999;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .page-container {
        padding: 16px;
    }

    .top-header {
        padding: 0 16px;
    }

    .twofa-inputs {
        gap: 6px;
    }

    .twofa-digit {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }

    .login-card {
        padding: 28px 24px;
    }
}

@media (max-width: 480px) {
    .header-date {
        display: none;
    }

    .header-user span {
        display: none;
    }
}

/* ══════════════ INVOICE STYLES (PDF) ══════════════ */
.invoice-wrapper {
    position: fixed;
    top: -9999px;
    left: -9999px;
}

.invoice-container {
    padding: 20mm;
    background: #fff;
    color: #000;
    font-family: 'Outfit', 'Inter', sans-serif;
    width: 210mm;
    margin: 0 auto;
    box-sizing: border-box;
}

.invoice-header {
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 40px;
}

.invoice-logo {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.invoice-logo img {
    height: 70px;
    filter: none !important;
}

.invoice-brand {
    font-size: 16px;
    font-weight: 600;
    margin-top: 5px;
}

.invoice-title {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin-top: 20px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.invoice-table th,
.invoice-table td {
    border: 1px solid #ccc;
    padding: 8px 12px;
    text-align: left;
    font-size: 13px;
    color: #000;
}

.invoice-table .label {
    width: 160px;
    background: #e9ecef;
    font-weight: bold;
    text-transform: uppercase;
}

.services-table thead th {
    background: #e9ecef;
    text-transform: uppercase;
    font-weight: bold;
}

.invoice-payment {
    margin: 25px 0;
    color: #FF0000;
    font-weight: 700;
    font-size: 16px;
}

.invoice-payment p {
    margin: 2px 0;
}

.invoice-footer-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.footer-table .label {
    width: 100px;
}

.invoice-container strong {
    font-weight: 700;
}

/* ═══ Dashboard Enhancements ═══ */
.dashboard-header-intro {
    margin-bottom: 24px;
}

.dashboard-header-intro h1 {
    font-size: 24px;
    margin-bottom: 4px;
    color: #fff;
}

.dashboard-header-intro p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.btn-quick {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.2s;
}

.btn-quick:hover {
    background: var(--bg-hover);
    border-color: var(--green-primary);
    transform: translateY(-2px);
    color: var(--green-primary);
}

.btn-quick i {
    font-size: 20px;
}

.btn-quick span {
    font-size: 12px;
    font-weight: 500;
}

/* KPI Sublabels & Growth */
.stat-sublabel {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-growth {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 600;
}

.stat-growth.up {
    color: #4ADE80;
}

.stat-growth.down {
    color: #EF4444;
}

/* Mini Ranking */
.ranking-list {
    list-style: none;
    padding: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-idx {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-right: 12px;
    color: var(--green-primary);
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.ranking-val {
    font-size: 11px;
    color: var(--text-muted);
}

/* Services Detail in Dashboard */
.recent-item-meta {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.recent-item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}