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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
}

.container {
    display: flex;
    width: 100%;
    max-width: 1600px;
    margin: 20px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px 0;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2em;
    color: #ecf0f1;
    padding: 0 20px;
}

.menu-item {
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-size: 14px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #3498db;
}

.menu-item.active {
    background: rgba(52, 152, 219, 0.2);
    border-left-color: #3498db;
}

.main-content {
    flex: 1;
    padding: 40px;
    background: #f8f9fa;
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-title {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-success { 
    background: linear-gradient(135deg, #27ae60, #2ecc71); 
}

.btn-danger { 
    background: linear-gradient(135deg, #e74c3c, #c0392b); 
}

.btn-edit { 
    background: linear-gradient(135deg, #f39c12, #e67e22); 
}

.btn-info { 
    background: linear-gradient(135deg, #3498db, #2980b9); 
}

.btn-warning { 
    background: linear-gradient(135deg, #f39c12, #e67e22); 
}

.item-list {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.item:hover {
    background-color: #f8f9fa;
}

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

.item-info { 
    flex: 1; 
}

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

.summary-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.1em;
}

.icon { 
    font-size: 1.2em; 
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
}

.search-box {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.client-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.client-card:hover {
    transform: translateY(-2px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab.active {
    border-bottom-color: #3498db;
    color: #3498db;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.badge {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.badge.success { 
    background: #27ae60; 
}

.badge.warning { 
    background: #f39c12; 
}

.badge.danger { 
    background: #e74c3c; 
}

.product-selector {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

.product-item {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.product-item:hover {
    background-color: #f8f9fa;
}

.product-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #3498db;
}

/* ===== LOGIN ===== */
#login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

#login-container .login-card {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

#login-container .login-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #2c3e50;
}

#login-container .login-card input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

#login-container .login-card input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

#login-container .login-card #login-button {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#login-container .login-card #login-button:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    transform: translateY(-2px);
}

#login-container .login-card #login-error {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #e74c3c;
}

/* Novos estilos para a seção de autenticação */
.auth-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-section h2 {
    margin-bottom: 20px;
    color: white;
    font-size: 2em;
}

.auth-section input {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
}

.auth-section input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.auth-section button {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

#login-button {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

#login-button:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
}

#signup-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

#signup-button:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
}

#auth-error {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 0.9em;
}

#clienteExibicao {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: default;
}

#seletorClientes {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.cliente-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.cliente-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cliente-item.selected {
    border-color: #2ecc71;
    background-color: #f1f9f1;
}

.cliente-info {
    flex: 1;
}

.cliente-info h3 {
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.cliente-info p {
    margin: 3px 0;
    color: #7f8c8d;
    font-size: 0.9em;
}