/* ========== RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f0f2f5;
}

/* ========== LOGIN ========== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: #333;
}

.login-header p {
    color: #666;
    margin-top: 5px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border 0.3s;
}

.login-form input:focus {
    border-color: #667eea;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-login:hover {
    transform: scale(1.02);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 12px;
}

/* ========== ALERTAS ========== */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

/* ========== LAYOUT ADMIN ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 240px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.user-name {
    display: block;
    font-size: 14px;
    color: #bdc3c7;
}

.user-level {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    font-size: 11px;
    margin-top: 5px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #667eea;
}

.sidebar-nav a span {
    font-size: 18px;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 20px;
}

.logout-link {
    color: #e74c3c !important;
}

.logout-link:hover {
    background: rgba(231, 76, 60, 0.1) !important;
}

/* ========== CONTEÚDO PRINCIPAL ========== */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 25px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 25px;
}

.main-header h1 {
    font-size: 24px;
    color: #2c3e50;
}

.header-info {
    display: flex;
    gap: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

/* ========== CARDS DASHBOARD ========== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-3px);
}

.card-icon {
    font-size: 35px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.card-blue .card-icon {
    background: #e3f2fd;
}
.card-green .card-icon {
    background: #e8f5e9;
}
.card-purple .card-icon {
    background: #f3e5f5;
}
.card-orange .card-icon {
    background: #fff3e0;
}

.card-content h3 {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.card-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* ========== AÇÕES RÁPIDAS ========== */
.quick-actions {
    margin-bottom: 30px;
}

.quick-actions h2 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-btn {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.action-btn span {
    font-size: 30px;
    display: block;
    margin-bottom: 10px;
}

.action-btn p {
    font-weight: 600;
    font-size: 14px;
}

/* ========== TABELAS ========== */
.table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.table thead {
    background: #f8f9fa;
}

.table th {
    padding: 12px 15px;
    text-align: left;
    font-size: 13px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
}

.table td {
    padding: 12px 15px;
    border-top: 1px solid #f1f3f5;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.ultimas-vendas {
    margin-top: 30px;
}

.ultimas-vendas h2 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 15px;
}

/* ========== CAIXA - LAYOUT ========== */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-item span {
    display: block;
    font-size: 13px;
    color: #7f8c8d;
}

.stat-item strong {
    font-size: 22px;
    color: #2c3e50;
}

.caixa-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 25px;
}

/* ========== PANELS ========== */
.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.panel-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 16px;
    color: #2c3e50;
}

/* ========== SERVIÇOS ========== */
.servicos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.servico-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.servico-item:hover {
    border-color: #667eea;
    background: #eef1ff;
}

.servico-item .codigo {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    display: block;
}

.servico-item .nome {
    font-size: 13px;
    color: #555;
    display: block;
    margin: 5px 0;
}

.servico-item .preco {
    color: #28a745;
    font-weight: bold;
    font-size: 14px;
}

.preco-input {
    width: 100%;
    padding: 5px;
    border: 2px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    margin-top: 5px;
}

#buscaServico {
    padding: 6px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
}

/* ========== CLIENTE ========== */
.cliente-panel {
    margin-top: 15px;
}

.cliente-busca {
    display: flex;
    gap: 8px;
    padding: 15px;
}

.cliente-busca input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.cliente-busca button {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.cliente-busca button:first-of-type {
    background: #667eea;
    color: white;
}

.cliente-busca .btn-novo {
    background: #28a745;
    color: white;
}

/* ========== VENDA ATUAL ========== */
#listaItens {
    padding: 15px;
    min-height: 150px;
}

#listaItens .vazio {
    text-align: center;
    color: #999;
    padding: 30px 0;
}

.item-carrinho {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 5px;
}

.item-carrinho .item-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.item-carrinho .item-info .codigo {
    font-weight: bold;
    color: #667eea;
}

.item-carrinho .item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.item-carrinho .item-actions .preco {
    font-weight: bold;
    color: #28a745;
}

.item-carrinho .btn-remover {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
}

.total-venda {
    padding: 15px 20px;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.total-venda strong {
    font-size: 24px;
    color: #2c3e50;
}

.venda-acoes {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
}

.venda-acoes select {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.btn-finalizar {
    flex: 2;
    padding: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-finalizar:hover {
    background: #218838;
}

.btn-limpar {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* ========== AÇÕES RÁPIDAS CAIXA ========== */
.acoes-rapidas {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.acoes-rapidas button {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-relatorios {
    background: #6c757d;
    color: white;
}

.btn-vendas-dia {
    background: #17a2b8;
    color: white;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.modal-cliente {
    max-width: 450px;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* ========== FORMULÁRIOS ========== */
#formCliente input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

#formCliente input:focus {
    border-color: #667eea;
    outline: none;
}

.btn-salvar {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 992px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header h2,
    .sidebar-header .user-name,
    .sidebar-header .user-level,
    .sidebar-nav a span:not(:first-child) {
        display: none;
    }
    
    .sidebar-nav a {
        justify-content: center;
        padding: 12px;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .caixa-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .servicos-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* =============================================
   RELÓGIO ADMIN - CONTAINER BONITO
   ============================================= */
.relogio-admin-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 20px 8px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    min-width: 180px;
}
.relogio-admin-container:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}
.relogio-admin-hora {
    font-size: 26px;
    font-weight: bold;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
    line-height: 1;
}
.relogio-admin-hora .segundos {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    font-weight: normal;
}
.relogio-admin-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 12px;
}
.relogio-admin-data {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    letter-spacing: 0.3px;
}
.relogio-admin-semana {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 300;
}
/* ============================================
   BOTÃO SAÍDA
   ============================================ */
.btn-saida {
    background: #ea4335;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-saida:hover {
    background: #d33426;
}

/* ============================================
   VALOR NEGATIVO (SAÍDAS)
   ============================================ */
.saldo-bar .saldo-info .item .valor.negativo {
    color: #ea4335;
}

/* ============================================
   MODAL SAÍDA
   ============================================ */
.modal-saida {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal-saida .modal-box {
    background: white;
    padding: 24px;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    animation: fadeIn 0.2s;
    position: relative;
}

.modal-saida .modal-box h2 {
    font-size: 18px;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.modal-saida .modal-box p {
    color: #5f6368;
    font-size: 13px;
    margin-bottom: 16px;
}

.modal-saida .modal-box .btn-fechar-modal {
    position: absolute;
    right: 12px;
    top: 8px;
    background: none;
    border: none;
    font-size: 22px;
    color: #9aa0a6;
    cursor: pointer;
}

.modal-saida .categorias-rapidas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.modal-saida .categorias-rapidas button {
    background: #f8f9fa;
    border: 2px solid #e8eaed;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    transition: all 0.2s;
    text-align: left;
}

.modal-saida .categorias-rapidas button:hover {
    border-color: #ea4335;
    background: #fce8e6;
    color: #ea4335;
}

.modal-saida .form-group {
    margin-bottom: 12px;
}

.modal-saida .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    margin-bottom: 4px;
}

.modal-saida .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e8eaed;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.modal-saida .form-group input:focus {
    border-color: #ea4335;
}

.modal-saida .btn-confirmar-saida {
    width: 100%;
    padding: 12px;
    background: #ea4335;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.modal-saida .btn-confirmar-saida:hover {
    background: #d33426;
}