/* ============================================
   ERP SYSTEM - MAIN STYLESHEET
   ============================================ */

/* CSS Variables - shadcn/ui style */
:root {
    /* Core Colors */
    --background: hsl(0 0% 100%);
    --foreground: hsl(240 10% 3.9%);

    /* Card */
    --card: hsl(0 0% 100%);
    --card-foreground: hsl(240 10% 3.9%);

    /* Primary */
    --primary: hsl(240 5.9% 10%);
    --primary-foreground: hsl(0 0% 98%);

    /* Secondary */
    --secondary: hsl(240 4.8% 95.9%);
    --secondary-foreground: hsl(240 5.9% 10%);

    /* Muted */
    --muted: hsl(240 4.8% 95.9%);
    --muted-foreground: hsl(240 3.8% 46.1%);

    /* Accent */
    --accent: hsl(240 4.8% 95.9%);
    --accent-foreground: hsl(240 5.9% 10%);

    /* Destructive */
    --destructive: hsl(0 84.2% 60.2%);
    --destructive-foreground: hsl(0 0% 98%);

    /* Border & Input */
    --border: hsl(240 5.9% 90%);
    --input: hsl(240 5.9% 90%);
    --ring: hsl(240 5.9% 10%);

    /* Sidebar - shadcn style */
    --sidebar: hsl(0 0% 98%);
    --sidebar-foreground: hsl(240 10% 3.9%);
    --sidebar-primary: hsl(240 5.9% 10%);
    --sidebar-primary-foreground: hsl(0 0% 98%);
    --sidebar-accent: hsl(240 4.8% 95.9%);
    --sidebar-accent-foreground: hsl(240 5.9% 10%);
    --sidebar-border: hsl(240 5.9% 90%);
    --sidebar-ring: hsl(240 5% 64.9%);

    /* Legacy colors (for compatibility) */
    --primary-hex: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --accent-green: #10b981;

    /* Backgrounds */
    --bg-primary: hsl(240 4.8% 95.9%);
    --bg-secondary: hsl(0 0% 100%);
    --bg-sidebar: var(--sidebar);
    --bg-sidebar-hover: var(--sidebar-accent);

    /* Text */
    --text-primary: var(--foreground);
    --text-secondary: var(--muted-foreground);
    --text-light: hsl(240 3.8% 66%);
    --text-sidebar: var(--sidebar-foreground);
    --text-sidebar-muted: var(--muted-foreground);

    /* Borders */
    --border-light: var(--border);
    --border-medium: hsl(240 5.9% 80%);

    /* Status Colors */
    --success: hsl(142 76% 36%);
    --warning: hsl(38 92% 50%);
    --danger: hsl(0 84% 60%);
    --info: hsl(217 91% 60%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-sidebar: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Sizing */
    --sidebar-width: 256px;
    --sidebar-collapsed: 64px;
    --header-height: 80px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms ease;

    /* Border Radius - shadcn style */
    --radius: 0.5rem;
    --radius-sm: calc(var(--radius) - 4px);
    --radius-md: calc(var(--radius) - 2px);
    --radius-lg: var(--radius);
    --radius-xl: calc(var(--radius) + 4px);
}

/* Dark Mode Support - shadcn style */
.dark {
    --background: hsl(240 10% 3.9%);
    --foreground: hsl(0 0% 98%);

    --card: hsl(240 10% 8%);
    --card-foreground: hsl(0 0% 98%);

    --primary: hsl(0 0% 90%);
    --primary-foreground: hsl(240 5.9% 10%);

    --secondary: hsl(240 3.7% 15.9%);
    --secondary-foreground: hsl(0 0% 98%);

    --muted: hsl(240 3.7% 15.9%);
    --muted-foreground: hsl(240 5% 64.9%);

    --accent: hsl(240 3.7% 15.9%);
    --accent-foreground: hsl(0 0% 98%);

    --destructive: hsl(0 62.8% 50.6%);
    --destructive-foreground: hsl(0 0% 98%);

    --border: hsl(240 3.7% 15.9%);
    --input: hsl(240 3.7% 20%);
    --ring: hsl(240 4.9% 83.9%);

    /* Sidebar - dark mode */
    --sidebar: hsl(240 10% 8%);
    --sidebar-foreground: hsl(0 0% 98%);
    --sidebar-primary: hsl(217 91% 60%);
    --sidebar-primary-foreground: hsl(0 0% 98%);
    --sidebar-accent: hsl(240 3.7% 15.9%);
    --sidebar-accent-foreground: hsl(0 0% 98%);
    --sidebar-border: hsl(240 3.7% 15.9%);
    --sidebar-ring: hsl(240 4.9% 83.9%);

    /* Legacy */
    --bg-primary: hsl(240 10% 3.9%);
    --bg-secondary: hsl(240 10% 8%);
    --bg-sidebar: var(--sidebar);
    --bg-sidebar-hover: var(--sidebar-accent);
    --text-primary: var(--foreground);
    --text-secondary: var(--muted-foreground);
    --text-light: hsl(240 5% 50%);
    --border-light: var(--border);
    --border-medium: hsl(240 3.7% 25%);
}

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

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Evita scroll vertical do documento em telas que possuem scroll interno (ex: Kanban de tarefas) */
body.no-y-scroll {
    overflow-y: hidden;
}

/* ============================================
   SIDEBAR - SHADCN STYLE
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--transition-normal), transform var(--transition-normal);
    overflow: hidden;
}

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

/* Sidebar Header - shadcn style */
.sidebar-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--sidebar-border);
    position: relative;
    gap: 8px;
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-toggle {
    margin: 0 auto;
}

.sidebar.collapsed .sidebar-header {
    flex-direction: column;
    padding: 12px 8px;
}

.sidebar-toggle:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
}

.sidebar-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-normal);
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--sidebar-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-primary-foreground);
    flex-shrink: 0;
}

.logo-icon svg {
    width: 18px;
    height: 18px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    font-family: 'Sora', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sidebar-foreground);
    white-space: nowrap;
    line-height: 1.3;
    transition: opacity var(--transition-fast), width var(--transition-fast);
}

.logo-subtitle {
    display: block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--muted-foreground);
    margin-top: 2px;
}

.logo-accent {
    color: var(--accent-green);
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Sidebar Menu - shadcn style */
.sidebar-menu {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.menu-section {
    margin-bottom: 16px;
}

.menu-label {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    padding: 8px 12px 4px;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .menu-label {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.menu-list {
    list-style: none;
}

.menu-item {
    margin-bottom: 2px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--sidebar-foreground);
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
}

.menu-link:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
}

.menu-link:focus-visible {
    outline: 2px solid var(--sidebar-ring);
    outline-offset: -2px;
}

.menu-item.active .menu-link {
    background: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
    font-weight: 600;
}

.menu-item.active .menu-link .menu-icon {
    color: var(--sidebar-accent-foreground);
}

.menu-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    transition: color var(--transition-fast);
}

.menu-link:hover .menu-icon {
    color: var(--sidebar-foreground);
}

.menu-icon svg {
    width: 100%;
    height: 100%;
}

.menu-text {
    font-size: 0.875rem;
    white-space: nowrap;
    transition: opacity var(--transition-fast), width var(--transition-fast);
}

.sidebar.collapsed .menu-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .menu-link {
    justify-content: center;
    padding: 10px;
}

/* Submenu - shadcn style */
.submenu {
    list-style: none;
    margin-left: 28px;
    margin-top: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item.has-submenu.expanded .submenu {
    max-height: 200px;
}

.submenu li {
    margin-bottom: 2px;
}

.submenu .menu-link {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted-foreground);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all var(--transition-normal);
    border-left: 2px solid transparent;
}

.submenu .menu-link:hover {
    color: var(--sidebar-foreground);
    background: var(--sidebar-accent);
}

.submenu .menu-link.active {
    color: var(--sidebar-foreground);
    background: var(--sidebar-accent);
    border-left-color: var(--sidebar-primary);
    font-weight: 600;
}

/* Submenu Arrow */
.submenu-arrow {
    margin-left: auto;
    width: 16px;
    height: 16px;
    transition: transform var(--transition-normal);
    color: var(--muted-foreground);
}

.submenu-arrow svg {
    width: 100%;
    height: 100%;
}

.menu-item.has-submenu.expanded .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar.collapsed .submenu-arrow {
    display: none;
}

.sidebar.collapsed .submenu {
    display: none;
}

/* Sidebar Footer - shadcn style */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    cursor: pointer;
    width: 100%;
}

.user-profile:hover {
    background: var(--sidebar-accent);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    font-weight: 500;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.user-avatar svg {
    width: 16px;
    height: 16px;
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: opacity var(--transition-fast), width var(--transition-fast);
}

.sidebar.collapsed .user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.user-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sidebar-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    line-height: 1.2;
}

.user-menu-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar.collapsed .user-menu-btn {
    display: none;
}

.user-menu-btn:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-foreground);
}

.user-menu-btn svg {
    width: 16px;
    height: 16px;
}

.user-menu-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    transition: transform var(--transition-normal);
    margin-left: auto;
}

.user-menu-arrow svg {
    width: 16px;
    height: 16px;
}

.user-profile.active .user-menu-arrow {
    transform: rotate(180deg);
}

.sidebar.collapsed .user-menu-arrow {
    display: none;
}

/* User Dropdown Menu - shadcn style */
.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 12px;
    right: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all var(--transition-normal);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--muted-foreground);
}

.dropdown-item:hover svg {
    color: var(--foreground);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.dropdown-item-danger {
    color: var(--destructive);
}

.dropdown-item-danger:hover {
    background: transparent;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%));
    background-size: 200% auto;
    background-position: 99% center;
    color: white;
}

.dropdown-item-danger svg {
    color: var(--destructive);
}

/* ============================================
   MAIN CONTENT - shadcn style
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 24px 32px 32px;
    min-height: 100vh;
    background: var(--background);
    transition: margin-left var(--transition-normal);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* Header */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 30px;
}

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

.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
}

.page-title h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box svg {
    width: 20px;
    height: 20px;
    color: var(--text-light);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-primary);
    width: 200px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-light);
}

.header-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.header-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.header-btn svg {
    width: 22px;
    height: 22px;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content {
    position: relative;
}

.page-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

/* Stats Cards */
.stats-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.stats-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats-icon svg {
    width: 26px;
    height: 26px;
}

.stats-icon.revenue {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: var(--success);
}

.stats-icon.clients {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: var(--info);
}

.stats-icon.tasks {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(6, 182, 212, 0.05) 100%);
    color: var(--accent);
}

.stats-icon.pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: var(--warning);
}

.stats-info {
    flex: 1;
}

.stats-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stats-value {
    display: block;
    font-family: 'Sora', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.stats-change {
    font-size: 0.8rem;
    font-weight: 500;
}

.stats-change.positive {
    color: var(--success);
}

.stats-change.negative {
    color: var(--danger);
}

/* Dashboard Row */
.dashboard-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

/* Chart Card */
.chart-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card-header h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.period-select {
    padding: 8px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
}

.period-select:hover {
    border-color: var(--primary);
}

.view-all {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.view-all:hover {
    color: var(--primary-dark);
}

.chart-container {
    height: 280px;
    position: relative;
}

/* Activity Card */
.activity-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-item:first-child {
    padding-top: 0;
}

.activity-item:hover {
    background: var(--bg-primary);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: var(--radius-sm);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 18px;
    height: 18px;
}

/* Login/Logout */
.activity-icon.login {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.06));
    color: #10b981;
}

.activity-icon.logout {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.18), rgba(107, 114, 128, 0.06));
    color: #6b7280;
}

/* Usuários */
.activity-icon.user-add {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));
    color: #6366f1;
}

.activity-icon.user-edit {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0.06));
    color: #a855f7;
}

/* Clientes */
.activity-icon.client-add {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.06));
    color: #22c55e;
}

.activity-icon.client-edit {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(14, 165, 233, 0.06));
    color: #0ea5e9;
}

/* Financeiro */
.activity-icon.money-in {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.06));
    color: #10b981;
}

.activity-icon.money-edit {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.06));
    color: #3b82f6;
}

/* Tarefas */
.activity-icon.task-add {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.06));
    color: #f59e0b;
}

.activity-icon.task-edit {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.18), rgba(234, 179, 8, 0.06));
    color: #eab308;
}

/* Cards Kanban */
.activity-icon.card-add {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(236, 72, 153, 0.06));
    color: #ec4899;
}

.activity-icon.card-edit {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.18), rgba(244, 114, 182, 0.06));
    color: #f472b6;
}

.activity-icon.card-move {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0.06));
    color: #8b5cf6;
}

.activity-icon.card-complete {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.06));
    color: #10b981;
}

.activity-icon.card-reopen {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.06));
    color: #f59e0b;
}

.activity-icon.board-add {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(79, 70, 229, 0.06));
    color: #4f46e5;
}

/* Roles */
.activity-icon.role-add {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(20, 184, 166, 0.06));
    color: #14b8a6;
}

.activity-icon.role-edit {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(6, 182, 212, 0.06));
    color: #06b6d4;
}

/* Calendário */
.activity-icon.calendar-add {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.06));
    color: #3b82f6;
}

.activity-icon.calendar-edit {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(14, 165, 233, 0.06));
    color: #0ea5e9;
}

/* Estados */
.activity-icon.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.06));
    color: #ef4444;
}

.activity-icon.default {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.15), rgba(107, 114, 128, 0.05));
    color: #6b7280;
}

/* Legado - compatibilidade */
.activity-icon.new-client {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.06));
    color: #10b981;
}

.activity-icon.payment {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.06));
    color: #3b82f6;
}

.activity-icon.schedule {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.06));
    color: #f59e0b;
}

.activity-icon.content {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0.06));
    color: #8b5cf6;
}

.activity-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.06));
    color: #10b981;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-light);
    flex-shrink: 0;
}

/* Page Placeholder */
.page-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-medium);
    text-align: center;
    padding: 60px 40px;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 24px;
}

.placeholder-icon svg {
    width: 36px;
    height: 36px;
}

.page-placeholder h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.page-placeholder p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 400px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

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

    .search-box {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        top: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 280px;
    }

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

    .stats-card {
        padding: 20px;
    }

    .page-title h1 {
        font-size: 1.4rem;
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   SCROLLBAR CUSTOMIZATION - shadcn style
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius);
}

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

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

/* ================= MÓDULO CLIENTES (MELHORADO V2) ================= */

/* Tabela de Clientes Melhorada */
.clients-table {
    table-layout: fixed;
}

.clients-table th:nth-child(1) { width: 18%; } /* Nome */
.clients-table th:nth-child(2) { width: 13%; } /* Documento */
.clients-table th:nth-child(3) { width: 9%; }  /* Status */
.clients-table th:nth-child(4) { width: 14%; } /* Serviço */
.clients-table th:nth-child(5) { width: 17%; } /* Contato */
.clients-table th:nth-child(6) { width: 12%; } /* Plataformas */
.clients-table th:nth-child(7) { width: 10%; } /* Ações */

/* Header direito com filtros */
.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Célula do Nome com Avatar */
.client-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Avatar com Iniciais (Bolinha colorida) */
.client-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

/* Nome clicável */
.client-name-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.client-name-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.client-name-link:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Célula do Documento */
.document-cell {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Célula de Serviço */
.service-cell {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Célula de Plataformas - Agora com dots coloridos */
.platforms-cell {
    text-align: center;
}

.platforms-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.platform-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: default;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.platform-dot:hover {
    transform: scale(1.3);
}

.no-platforms {
    color: var(--text-light);
}

/* Célula de Contato - estilos movidos para clients.css */

.contact-phone {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.contact-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Badges de Status */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-active {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-inactive {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* ================= MODAL DE CLIENTE MELHORADO ================= */

.modal-client {
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Modal Body com Scroll */
.modal-body-scroll {
    overflow-y: auto;
    max-height: calc(90vh - 140px);
    padding: 24px;
}

/* Botão de Fechar Melhorado */
.modal-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Seções do Formulário */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

/* Label com Dica */
.label-hint {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-light);
    margin-left: 4px;
}

/* Grid de 2 colunas */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-grid-2:last-child {
    margin-bottom: 0;
}

/* Header de Plataformas */
.platforms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.platforms-header label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.btn-link {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-link:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* Seletor de Plataformas */
.platforms-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.platform-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.platform-checkbox:hover {
    border-color: var(--primary-light);
    background: rgba(37, 99, 235, 0.05);
}

.platform-checkbox.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.platform-checkbox input[type="checkbox"] {
    display: none;
}

/* Dot colorido da plataforma */
.platform-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.platform-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Botão Secundário */
.btn-secondary {
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
}

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

/* ================= GERENCIADOR DE PLATAFORMAS ================= */

.modal-sm {
    max-width: 450px;
}

.modal-xs {
    max-width: 380px;
}

.platform-manager-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    max-height: 250px;
    overflow-y: auto;
}

.platform-manager-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.platform-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-icon-sm:hover {
    background: var(--primary);
    color: white;
}

.btn-danger-sm:hover {
    background: transparent;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%));
    background-size: 200% auto;
    background-position: 99% center;
    color: white;
    transform: scale(1.1);
}

.default-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: var(--border-light);
    color: var(--text-light);
    border-radius: 10px;
    text-transform: uppercase;
}

/* Seção de Adicionar Plataforma */
.platform-add-section {
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.platform-add-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.platform-add-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Color Picker Grid */
.color-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.selected {
    border-color: var(--text-primary);
    transform: scale(1.15);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Z-index para modais sobrepostos */
.platform-manager-overlay {
    z-index: 2100;
}

.edit-platform-overlay {
    z-index: 2200;
}

/* Responsivo */
@media (max-width: 768px) {
    .clients-table {
        table-layout: auto;
    }
    
    .clients-table th:nth-child(6),
    .clients-table td:nth-child(6) {
        display: none; /* Esconde plataformas em telas pequenas */
    }
    
    .form-grid-2 { 
        grid-template-columns: 1fr; 
    }
    
    .modal-client {
        max-width: 100%;
        margin: 10px;
    }
    
    .modal-body-scroll {
        max-height: calc(100vh - 180px);
    }
    
    .platforms-selector {
        gap: 8px;
    }
    
    .platform-checkbox {
        padding: 6px 10px;
    }
    
    .platform-name {
        font-size: 0.8rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: flex-end;
    }
}