:root {
    --color-bg-primary: #D4C9C0;
    --color-bg-secondary: #FBFBFB;
    --color-accent: #CD6A5A;
    --color-text-main: #5A5A4A;
    --color-action: #1E90FF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 250px;
    background-color: var(--color-bg-secondary);
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--color-accent);
    background-color: var(--color-text-main);
}

.sidebar-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-accent);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header .logo-img {
    max-width: 100%;
    height: auto;
    max-height: 50px;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--color-text-main);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--color-bg-primary);
    border-left-color: var(--color-accent);
}

.sidebar-link.active {
    background-color: var(--color-bg-primary);
    border-left-color: var(--color-action);
    font-weight: 600;
}

.sidebar-icon {
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.sidebar-text {
    flex: 1;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s;
}

.sidebar-footer {
    border-top: 1px solid #e0e0e0;
    padding: 1rem;
    background-color: #f5f5f5;
}

.user-info-sidebar {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--color-text-main);
    font-size: 0.9rem;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
}

.sidebar-logout {
    border-top: 1px solid #e0e0e0;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    background-color: var(--color-bg-secondary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 2rem;
    z-index: 999;
    transition: left 0.3s ease;
}

.main-wrapper.sidebar-collapsed ~ .header,
.header.sidebar-collapsed {
    left: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 30px;
    height: 30px;
    justify-content: center;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-text-main);
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.logo-img-header {
    max-width: 120px;
    height: auto;
    max-height: 40px;
    object-fit: contain;
}

.logo-img-login {
    max-width: 200px;
    height: auto;
    max-height: 60px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.user-menu-dropdown {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: transparent;
    border: 1px solid var(--color-text-main);
    color: var(--color-text-main);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.user-menu-toggle:hover {
    background-color: var(--color-bg-primary);
    border-color: var(--color-accent);
}

.user-info {
    color: var(--color-text-main);
    font-size: 0.9rem;
}

.user-menu-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.user-menu-toggle.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background-color: var(--color-bg-secondary);
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid #e0e0e0;
}

.user-menu-dropdown-content.show {
    display: block;
}

.user-menu-header {
    padding: 1rem;
    background-color: var(--color-bg-primary);
    border-bottom: 1px solid #e0e0e0;
}

.user-menu-name {
    font-weight: 600;
    color: var(--color-text-main);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.user-menu-role {
    font-size: 0.8rem;
    color: #666;
}

.user-menu-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 0.5rem 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--color-text-main);
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.user-menu-item:hover {
    background-color: var(--color-bg-primary);
}

.user-menu-item-danger {
    color: var(--color-accent);
}

.user-menu-item-danger:hover {
    background-color: #f8d7da;
}

.user-menu-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.btn-logout {
    background-color: var(--color-accent);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
}

.btn-logout:hover {
    opacity: 0.9;
}

/* Main Wrapper */
.main-wrapper {
    margin-left: 250px;
    margin-top: 70px;
    padding: 2rem;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 70px);
}

.main-wrapper.sidebar-collapsed {
    margin-left: 0;
}

/* Main Content */
.main-content {
    background-color: var(--color-bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-accent);
}

.page-title {
    font-size: 2rem;
    color: var(--color-text-main);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--color-action);
    color: white;
}

.btn-primary:hover {
    background-color: #1a7dd9;
}

.btn-secondary {
    background-color: var(--color-accent);
    color: white;
}

.btn-secondary:hover {
    background-color: #b85a4a;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
}

table thead {
    background-color: var(--color-text-main);
    color: white;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    vertical-align: middle;
}

table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

table tbody tr:hover {
    background-color: #f5f5f5;
}

table tbody tr:last-child {
    border-bottom: none;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-action);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-accent);
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--color-action), #1a7dd9);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    opacity: 0.9;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-info {
    background-color: var(--color-action);
    color: white;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-box {
    background-color: var(--color-bg-secondary);
    padding: 3rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-accent);
}

/* Actions */
.actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.actions a,
.actions button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
        padding: 0.5rem;
        margin-top: 60px;
    }
    
    .main-content {
        padding: 1rem;
        border-radius: 0;
        margin-bottom: 0.5rem;
        box-shadow: none;
    }
    
    .header {
        left: 0;
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        gap: 0.5rem;
    }
    
    .logo-header {
        font-size: 1.2rem;
    }
    
    .user-info {
        display: none;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }

    table {
        font-size: 0.875rem;
    }

    table th,
    table td {
        padding: 0.5rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        width: 100%;
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0;
    }
    
    .card-header {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .table-container {
        margin: 0 -1rem;
        width: calc(100% + 2rem);
        overflow-x: auto;
    }
    
    .alert {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-wrapper.sidebar-collapsed {
        margin-left: 0;
    }
    
    .header.sidebar-collapsed {
        left: 0;
    }
}

/* Etapa Color Indicator */
.etapa-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    min-width: 40px;
    white-space: nowrap;
    border: 1px solid rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

/* Histórico */
.historico-item {
    padding: 1rem;
    border-left: 4px solid var(--color-action);
    background-color: #f9f9f9;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.historico-item .data {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.historico-item .usuario {
    font-weight: 500;
    color: var(--color-text-main);
}

.historico-item .observacao {
    margin-top: 0.5rem;
    color: #666;
    font-style: italic;
}

/* Permissões */
.permissoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.permissao-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.permissao-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

