/* 
 * CIA do Sono - Sistema de Orçamentos
 * Design minimalista e moderno
 */

:root {
    /* Paleta de Cores da Marca CIA do Sono */
    --brand-cream: #F3F1E9;
    --brand-beige: #D9BEA7;
    --brand-brown: #6A4934;
    --brand-brown-dark: #523828;
    
    /* Cores baseadas na paleta */
    --primary: #6A4934;
    --primary-dark: #523828;
    --primary-light: #D9BEA7;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #F3F1E9;
    --dark: #6A4934;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgba(106, 73, 52, 0.1);
    --shadow-lg: 0 10px 25px 0 rgba(106, 73, 52, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--brand-cream);
    color: var(--brand-brown);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout Principal */
.app-container {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid rgba(217, 190, 167, 0.3);
    padding: 24px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
}

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

.sidebar-logo-img {
    max-width: 200px;
    width: 100%;
    height: auto;
}

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

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--brand-brown);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    background: var(--brand-cream);
    color: var(--brand-brown-dark);
}

.nav-link.active {
    background: var(--brand-beige);
    color: var(--brand-brown-dark);
    font-weight: 600;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-brown);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--brand-brown);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-label {
    font-size: 14px;
    color: var(--brand-brown);
    margin-bottom: 8px;
    opacity: 0.8;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-brown);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: var(--brand-brown);
    color: var(--white);
    border: none;
}

.btn-primary:hover {
    background: var(--brand-brown-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(106, 73, 52, 0.2);
}

/* Botão específico para auth */
.auth-card .btn-primary {
    background: #6A4934;
    color: var(--white);
    border: none;
    padding: 14px 24px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(106, 73, 52, 0.2);
}

.auth-card .btn-primary:hover {
    background: #523828;
    box-shadow: 0 6px 16px rgba(106, 73, 52, 0.3);
    transform: translateY(-1px);
}

.auth-card .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(106, 73, 52, 0.2);
}

.btn-secondary {
    background: var(--brand-cream);
    color: var(--brand-brown);
    border: 1px solid rgba(217, 190, 167, 0.4);
}

.btn-secondary:hover {
    background: var(--brand-beige);
    color: var(--brand-brown-dark);
    border-color: var(--brand-beige);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

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

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

/* Labels específicos para auth */
.auth-card .form-label {
    color: #6A4934;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

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

/* Inputs específicos para auth */
.auth-card .form-control {
    border-color: rgba(217, 190, 167, 0.4);
    background: #F3F1E9;
    color: #6A4934;
}

.auth-card .form-control:focus {
    border-color: #D9BEA7;
    box-shadow: 0 0 0 3px rgba(217, 190, 167, 0.2);
    background: var(--white);
}

.form-control:disabled {
    background: var(--light);
    cursor: not-allowed;
}

/* Table */
.table-container {
    overflow-x: auto;
}

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

.table thead {
    background: var(--brand-cream);
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--brand-brown);
    border-bottom: 2px solid var(--brand-beige);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(217, 190, 167, 0.2);
}

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

.table tbody tr:hover {
    background: var(--brand-cream);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Search & Filters */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 14px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--dark);
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-light);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

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

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F3F1E9 0%, #D9BEA7 100%);
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: 16px;
    padding: 48px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(106, 73, 52, 0.15);
    border: 1px solid rgba(217, 190, 167, 0.3);
}

.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo-img {
    max-width: 280px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.auth-title {
    font-size: 28px;
    font-weight: 600;
    color: #6A4934;
    margin-bottom: 32px;
    text-align: center;
    letter-spacing: -0.5px;
}

.auth-description {
    text-align: center;
    color: #6A4934;
    margin-bottom: 32px;
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.8;
}

.auth-link {
    text-align: center;
    margin-top: 32px;
    color: #6A4934;
    font-size: 14px;
}

.auth-link a {
    color: #6A4934;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.auth-link a:hover {
    color: #D9BEA7;
    border-bottom-color: #D9BEA7;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

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

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

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

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

