:root {
    --primary-color: #00796b;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --credit-color: #00796b;
    --debit-color: #d32f2f;
    --pending-color: #ff9800;
}

body.page-template-template-fiado-control, .fiado-dashboard-wrapper {
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Auth Page */
.fiado-auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--primary-color);
    padding: 20px;
}

.fiado-auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.fiado-auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.fiado-auth-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: #004d40;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 14px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Dashboard Layout */
.fiado-main-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left Sidebar */
.fiado-sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    flex-shrink: 0;
}

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

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f9f9f9;
}

.client-list {
    list-style: none;
    padding: 0;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: background 0.2s;
}

.client-item:hover, .client-item.active {
    background: #e0f2f1;
}

.client-item .client-info {
    display: flex;
    flex-direction: column;
}

.client-item .client-balance {
    font-weight: 600;
}

/* Center Content */
.fiado-content {
    flex-grow: 1;
    padding: 30px;
    background: #f8fafb;
}

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

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

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-card h4 {
    margin: 0 0 10px 0;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

/* Transactions Table */
.transactions-section {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.fiado-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: #666;
    font-weight: 600;
}

.fiado-table td {
    padding: 15px;
    border-bottom: 1px solid #f5f5f5;
}

/* Right Sidebar (Form) */
.fiado-form-sidebar {
    width: 320px;
    background: var(--white);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    flex-shrink: 0;
}

/* Icons */
.action-icons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #999;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--primary-color);
}

/* Fluid Layout */
@media (max-width: 1200px) {
    .fiado-main-layout {
        flex-direction: column;
    }
    .fiado-sidebar, .fiado-form-sidebar {
        width: 100%;
        border: none;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Modais */
.fiado-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

/* Utilitários */
.btn-secondary {
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-link {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    text-align: center;
}

.radio-group {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

#auth-message {
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
}

/* Font Awesome fallback icons if not loaded */
.fas, .far {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}
