/* ContratoJá Dashboard Styles */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --muted: #6b7280;
    --border: #e5e7eb;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --header-bg: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--background);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    height: 64px;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

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

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

.logo-circle {
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background-color: #f9fafb;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

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

.notification-icon {
    position: relative;
    cursor: pointer;
}

.notification-icon i {
    font-size: 20px;
    color: var(--muted);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-avatar {
    font-size: 24px;
    color: var(--primary);
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

/* Main Layout */
.main-layout {
    display: flex;
    margin-top: 64px;
    height: calc(100vh - 64px);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    left: 0;
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.sidebar-content {
    padding: 24px 16px;
}

.new-contract-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: background-color 0.2s;
}

.new-contract-btn:hover {
    background-color: var(--primary-dark);
}

.sidebar-nav {
    margin-top: 8px;
}

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

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.nav-item.active .nav-link {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-link i {
    width: 20px;
    font-size: 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.content-title h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.content-title p {
    color: var(--muted);
    font-size: 16px;
}

.btn-new-contract {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-new-contract:hover {
    background-color: var(--primary-dark);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Content Body */
.content-body {
    max-width: 1200px;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-icon.primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.stat-icon.success {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-icon.warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

/* Progress Card */
.progress-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

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

.progress-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.progress-card .badge {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.progress-percentage {
    font-weight: 600;
    color: #1f2937;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-message {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
}

/* Values Grid */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.value-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
}

.value-card:hover {
    box-shadow: var(--shadow-lg);
}

.value-card .card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.value-card .card-header i {
    color: var(--success);
    font-size: 16px;
}

.value-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.value-amount {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

/* Contracts Section */
.contracts-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

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

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header i {
    font-size: 16px;
    color: var(--muted);
}

.btn-view-all {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view-all:hover {
    background-color: var(--primary);
    color: white;
}

.contracts-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
}

.contract-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    background-color: var(--card-bg);
    transition: all 0.2s;
}

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

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

.contract-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.contract-category {
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.contract-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-assinado {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.status-rascunho {
    background-color: #fef3c7;
    color: #d97706;
}

.status-aguardando-revisao {
    background-color: #fef3c7;
    color: #d97706;
}

.contract-details {
    margin-bottom: 12px;
}

.contract-parties {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.contract-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.contract-dates {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
}

/* Alert Section */
.alert-section {
    margin-bottom: 24px;
}

.alert-card {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.alert-icon {
    color: #f59e0b;
    font-size: 20px;
}

.alert-content {
    flex: 1;
}

.alert-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
}

.alert-content p {
    font-size: 12px;
    color: #92400e;
    margin: 0;
}

.btn-alert-action {
    background-color: transparent;
    border: 1px solid #f59e0b;
    color: #f59e0b;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-alert-action:hover {
    background-color: #f59e0b;
    color: white;
}

/* Actions Section */
.actions-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.actions-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-card {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 100px;
}

.action-card:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.action-card i {
    font-size: 24px;
    color: var(--muted);
    transition: color 0.2s;
}

.action-card:hover i {
    color: var(--primary);
}

.action-card span {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

/* Stat Cards */
.stat-card {
    height: 100%;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.stat-icon.success {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-icon.warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

/* Contract Cards */
.contract-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--card-bg);
    transition: all 0.2s ease;
}

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

.contract-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contract-card .card-text {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* Status Badges */
.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-draft {
    background-color: #f3f4f6;
    color: #374151;
}

.status-review {
    background-color: var(--warning-light);
    color: var(--warning);
}

.status-approved {
    background-color: var(--success-light);
    color: var(--success);
}

.status-signed {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.status-sent {
    background-color: var(--primary-light);
    color: var(--primary);
}

.status-archived {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Progress Bar */
.progress {
    background-color: #e5e7eb;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Quick Action Buttons */
.quick-action-btn {
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.alert-warning {
    background-color: var(--warning-light);
    border-left: 4px solid var(--warning);
    color: #92400e;
}

/* Badges */
.bg-outline-primary {
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .sidebar {
        position: fixed;
        left: -240px;
        z-index: 1001;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .content-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 16px;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 16px;
    }
    
    .header-center {
        display: none;
    }
    
    .content-title h1 {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .value-amount {
        font-size: 20px;
    }
    
    .contracts-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .contract-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .action-card {
        min-height: 80px;
        padding: 16px;
    }
    
    .action-card i {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .logo-text {
        display: none;
    }
    
    .user-name {
        display: none;
    }
    
    .header-right {
        gap: 12px;
    }
    
    .content-title h1 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}