/* Design Tokens */
:root {
    --color-sidebar-bg: #0F1E33;
    --color-sidebar-hover: #1E3A5F;
    --color-primary: #2563EB;
    --color-primary-hover: #1D4ED8;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #F43F5E;
    --color-surface: #FFFFFF;
    --color-background: #F5F7FA;
    --color-border: #EEF0F3;
    --color-text-primary: #1E293B;
    --color-text-secondary: #64748B;
    --color-text-muted: #94A3B8;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-family);
    background-color: var(--color-background);
    color: var(--color-text-primary);
}

.app-snackbar-host,
.app-snackbar-host.mud-snackbar-location-top-left {
    position: fixed !important;
    top: calc(68px + 16px);
    left: calc(260px + 16px);
    right: auto;
    margin: 0 !important;
    z-index: 1400;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-snackbar-host .mud-snackbar {
    min-width: 320px;
    max-width: 420px;
    background: transparent;
    opacity: 1;
    border-radius: 12px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
}

.app-snackbar-host .mud-alert {
    align-items: flex-start;
    border-radius: 12px;
    border: 1px solid transparent;
}

.app-snackbar-host .mud-alert-icon {
    margin-top: 2px;
    font-size: 12px;
}

.app-snackbar-host .mud-alert-message {
    font-size: 13px;
    line-height: 1.45;
}

.app-snackbar-host .mud-alert-filled-success {
    background: #ECFDF5 !important;
    border-color: #A7F3D0;
    color: #065F46;
}

.app-snackbar-host .mud-alert-filled-error {
    background: #FEF2F2 !important;
    border-color: #FECACA;
    color: #991B1B;
}

.app-snackbar-host .mud-alert-filled-warning,
.app-snackbar-host .mud-alert-filled-info {
    background: #FFFBEB !important;
    border-color: #FDE68A;
    color: #92400E;
}

.app-snackbar-host .mud-alert-filled-success .mud-alert-icon,
.app-snackbar-host .mud-alert-filled-error .mud-alert-icon,
.app-snackbar-host .mud-alert-filled-warning .mud-alert-icon,
.app-snackbar-host .mud-alert-filled-info .mud-alert-icon,
.app-snackbar-host .mud-alert-filled-success .mud-button-root,
.app-snackbar-host .mud-alert-filled-error .mud-button-root,
.app-snackbar-host .mud-alert-filled-warning .mud-button-root,
.app-snackbar-host .mud-alert-filled-info .mud-button-root {
    color: inherit;
}

.app-snackbar-host .mud-snackbar-close-button {
    align-self: flex-start;
}

/* Layout Principal */
.acelerador-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.acelerador-sidebar {
    width: 260px;
    background-color: var(--color-sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
}

.sidebar-logo {
    height: 68px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo--svg {
    padding: 11px 20px;
    display: block;
}

.sidebar-logo-text h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.sidebar-logo-text p {
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.2;
}

.sidebar-search {
    padding: 16px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-menu :deep(.mud-nav-menu) {
    width: 100%;
}

.sidebar-menu :deep(.mud-nav-item) {
    color: #cbd5e1;
    font-size: 14px;
    padding-left: 12px;
    padding-right: 12px;
}

.sidebar-menu :deep(.mud-nav-item:hover) {
    background-color: var(--color-sidebar-hover);
    color: #ffffff;
}

.sidebar-menu :deep(.mud-nav-item.active) {
    background-color: var(--color-primary);
    color: #ffffff;
}

.sidebar-user {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

/* Main Content */
.acelerador-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* TopBar */
.acelerador-topbar {
    height: 68px;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    gap: 24px;
    flex-shrink: 0;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.topbar-breadcrumb-item {
    color: var(--color-text-secondary);
}

.topbar-breadcrumb-current {
    color: var(--color-text-primary);
    font-weight: 500;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Content Area */
.acelerador-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Dashboard */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header-actions {
    display: flex;
    gap: 12px;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0;
}

.quick-action {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    height: auto !important;
    padding: 12px !important;
    text-align: left;
}

.quick-action div small {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* Kanban */
.kanban-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.kanban-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-column {
    min-width: 290px;
    background-color: rgba(203, 213, 225, 0.4);
    border-radius: var(--radius-lg);
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
}

.kanban-column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.kanban-column-title h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.kanban-column-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-column-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-card {
    cursor: grab;
    transition: all 0.2s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #F5F7FA;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--color-border);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1E293B;
}

.login-header p {
    font-size: 13px;
    color: #64748B;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1E293B;
    margin-bottom: 6px;
}

.form-group.checkbox label {
    display: flex;
    align-items: center;
    font-size: 13px;
    margin-bottom: 0;
}

.form-group.checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.form-control {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
    background: white;
    color: #1E293B;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:disabled {
    background-color: #F8FAFC;
    color: #94A3B8;
}

.btn-block {
    width: 100%;
    padding: 11px 16px;
    margin-top: 24px;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-danger {
    background-color: #FEE2E2;
    color: #7F1D1D;
    border: 1px solid #FECACA;
}

.alert-success {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #D1FAE5;
}

.login-footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
}

.login-footer-text a {
    color: var(--color-primary);
    text-decoration: none;
}

.login-footer-text a:hover {
    text-decoration: underline;
}

.blank-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #F5F7FA;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    gap: 16px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lead-card {
    animation: fadeIn 0.3s ease;
}

.lead-card.leaving {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lead-card.entering {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lead-card.entering.active {
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive */
@media (max-width: 960px) {
    .acelerador-sidebar {
        width: 200px;
    }

    .kanban-board {
        gap: 12px;
    }

    .kanban-column {
        min-width: 260px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 16px;
    }

    .dashboard-header-actions {
        width: 100%;
    }

    .dashboard-header-actions button {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .app-snackbar-host,
    .app-snackbar-host.mud-snackbar-location-top-left {
        top: 16px;
        left: 16px;
        right: 16px;
    }

    .app-snackbar-host .mud-snackbar {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .acelerador-layout {
        flex-direction: column;
    }

    .acelerador-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }

    .acelerador-main {
        margin-bottom: 60px;
    }

    .acelerador-content {
        padding: 16px;
    }

    .kanban-column {
        min-width: 240px;
    }
}

/* Form Styles */
input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    background-color: var(--color-background);
}

.btn-lg {
    padding: 12px 20px;
    font-size: 16px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #D1FAE5;
}

/* Sidebar additions */
.sidebar-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    border-radius: 6px;
    font-size: 13px;
}

.sidebar-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.nav-section {
    padding: 8px 0;
}

.nav-group {
    margin-top: 16px;
}

.nav-group-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 12px;
    letter-spacing: 0.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--color-sidebar-hover);
    color: white;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), #8B5CF6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

/* TopBar additions */
.topbar-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
}

.topbar-btn-support {
    background-color: var(--color-success);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
}

.topbar-breadcrumb-sep {
    color: var(--color-text-secondary);
    margin: 0 8px;
}

/* Dashboard additions */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.kpi-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.quick-actions-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--color-border);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.quick-action-btn:hover {
    border-color: var(--color-primary);
    background-color: #F0F9FF;
}

.quick-action-btn strong {
    font-size: 13px;
    display: block;
}

.quick-action-btn small {
    font-size: 11px;
    color: var(--color-text-secondary);
    display: block;
}

/* Kanban additions */
.capacity-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

/* Utility classes */
.mb-4 {
    margin-bottom: 16px;
}

.mt-6 {
    margin-top: 24px;
}

.ml-2 {
    margin-left: 8px;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.w-100 {
    width: 100%;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
