:root {
    /* Color Palette - Modern Enterprise */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.1);
    --secondary: #64748b;
    --dark: #0f172a;
    --light: #f8fafc;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    /* Backgrounds */
    --bg-app: #f1f5f9;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: rgba(255, 255, 255, 0.05);

    /* Header */
    --header-height: 70px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--dark);
    background-color: var(--bg-app);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Scrollbar Modernization */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Glassmorphism Classes */
.glass-effect {
    background: var(--bg-glass);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Auth Specific Styles */
.auth-page-wrapper {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(79, 70, 229, 0.4)),
                url("/assets/image/backgroundfluxo.png") center/cover no-repeat fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-card {
    background: var(--bg-card);
    border-radius: 1.5rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    transition: var(--transition);
}

.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn-premium {
    padding: 0.6rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    border: 1.5px solid transparent;
}

.btn-premium-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-premium-primary:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.btn-premium-success {
    background: #10b981;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-premium-success:hover {
    background: #059669;
    color: white;
    transform: translateY(-2px);
}

.btn-premium-danger {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-premium-danger:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
}

.btn-premium-outline {
    background: transparent;
    border-color: #e2e8f0;
    color: #64748b;
}

.btn-premium-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--primary);
}

/* Table Action Buttons */
.btn-action {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 1.1rem;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-action-edit:hover {
    color: var(--primary);
    border-color: #c7d2fe;
    background: #f5f3ff;
}

.btn-action-delete:hover {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

.btn-action-view:hover {
    color: #10b981;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

/* Inputs */
.form-premium, .form-control, .form-select {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    transition: var(--transition);
    font-size: 0.9rem;
    color: #1e293b;
}

.form-premium:focus, .form-control:focus, .form-select:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-soft);
    outline: none;
}

/* Tables */
.table {
    --bs-table-hover-bg: #f8fafc;
}

.table thead th {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border: none;
}

.table tbody td {
    padding: 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Layout Specifics */
.wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.sidebar-premium {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 1000;
    height: 100vh;
}

.sidebar-premium.collapsed {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #f8fafc;
    height: 100vh;
    overflow: hidden; /* Scroll will be on content-body */
    position: relative;
}

.header-main {
    height: var(--header-height);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 900;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 950;
    display: none;
    backdrop-filter: blur(4px);
    transition: var(--transition);
}

@media (max-width: 1024px) {
    .sidebar-premium {
        position: fixed;
        left: calc(var(--sidebar-width) * -1);
        height: 100vh;
        z-index: 1000;
    }
    .sidebar-premium.show {
        left: 0;
    }
    .sidebar-premium.show ~ .sidebar-overlay {
        display: block;
    }
    .main-container {
        width: 100%;
    }
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar Nav Enhancements */
.sidebar-premium .nav-link {
    color: #94a3b8;
    padding: 0.85rem 1.5rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    margin: 4px 0;
}

.sidebar-premium .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.sidebar-premium .nav-link.active {
    color: white;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.15) 0%, rgba(79, 70, 229, 0) 100%);
    border-left-color: var(--primary);
    box-shadow: inset 10px 0 20px -15px var(--primary);
}

.sidebar-premium .nav-link i {
    font-size: 1.1rem;
    margin-right: 1rem;
    transition: var(--transition);
    opacity: 0.7;
}

.sidebar-premium .nav-link.active i {
    color: #818cf8;
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(129, 140, 248, 0.5));
}

.sidebar-premium hr {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 1.5rem 1rem;
}

.sidebar-premium small {
    color: #475569;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding-left: 1.5rem !important;
    text-transform: uppercase;
    font-size: 0.65rem;
    opacity: 0.7;
}

/* User Profile Sidebar Section */
.sidebar-user {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar-wrapper {
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    width: 70px !important;
    height: 70px !important;
    margin: 0 auto;
}

.avatar-wrapper:hover {
    transform: scale(1.05);
    border-color: var(--primary) !important;
}

.avatar-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.avatar-wrapper:hover .avatar-hover-overlay {
    opacity: 1;
}

/* Sidebar Resizer */
.sidebar-resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    transition: var(--transition);
}

.sidebar-resizer:hover {
    background: var(--primary);
    opacity: 0.5;
}

/* Transition Utility */
.transition-all {
    transition: var(--transition);
}

.hover-translate-x:hover {
    transform: translateX(5px);
}

.hover-translate-y:hover {
    transform: translateY(-3px);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.cursor-pointer {
    cursor: pointer;
}

.letter-spacing-1 {
    letter-spacing: 1px;
}

/* Breadcrumb Styles */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #cbd5e1;
    font-size: 0.8rem;
    padding: 0 0.75rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    text-decoration: none;
    color: var(--secondary);
    transition: var(--transition);
    font-size: 0.75rem;
    font-weight: 700;
}

/* ===== Fluxo (Steps) ===== */
.flow-step {
    cursor: grab;
    user-select: none;
    position: relative;
    padding: 1.25rem;
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.flow-step.is-dragging {
    opacity: 0.6;
    cursor: grabbing;
}

/* ===== Inbox Split-Pane Layout ===== */
.inbox-wrapper {
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

.inbox-list {
    width: 380px;
    min-width: 320px;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.inbox-detail {
    flex: 1;
    background: #f8fafc;
    overflow-y: auto;
}

.inbox-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.inbox-item:hover {
    background: #f8fafc;
}

.inbox-item.active {
    background: var(--primary-soft);
    border-left-color: var(--primary);
}
