/* ============================================================
   ESTILOS GERAIS
   ============================================================ */
body {
    font-family: "Inter", system-ui, sans-serif;
    background: #f4f6f9;
    /* cor de fundo padrão */
    margin: 0;
    padding: 0;
    display: flex;
    /* layout flex para ocupar toda a altura */
    flex-direction: column;
    min-height: 100vh;
}

h2 {
    color: #2c3e50;
    text-align: center;
    margin-top: 40px;
}

/* ============================================================
   FORMULÁRIOS (login, cadastro, edição)
   ============================================================ */
form {
    max-width: 300px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

label {
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
}

input[type="email"],
input[type="password"],
input[type="text"],
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

button {
    width: 100%;
    padding: 10px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

button:hover {
    background: #2980b9;
}

p.error {
    color: red;
    text-align: center;
    font-size: 13px;
}

/* ============================================================
   HEADER 
   ============================================================ */
/* ============================================================
   HEADER 
   ============================================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1002;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 250px;
}

.brand {
    font-weight: 700;
    font-size: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230055ff'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5zm0 9l2.5-1.25L12 8.5l-2.5 1.25L12 11zm0 2.5l-5-2.5-5 2.5L12 22l10-8.5-5-2.5-5 2.5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.hamburger {
    font-size: 20px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #555;
    padding: 5px;
}

.hamburger:hover {
    background: transparent;
    color: #333;
}

/* Centro: campo de pesquisa */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

.search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    background: #fff;
    outline: none;
}

.search-input:focus {
    border-color: #3498db;
}

/* Direita: botões e perfil */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-plus {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: #1f75cb;
    color: #ffd700;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: #155a9c;
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .app-header,
body.dark-mode .sidebar,
body.dark-mode .content,
body.dark-mode .card,
body.dark-mode .filter-bar,
body.dark-mode .data-table-container,
body.dark-mode .data-table th,
body.dark-mode .data-table td,
body.dark-mode .search-input,
body.dark-mode .pagination-info select,
body.dark-mode form {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .page-title,
body.dark-mode h2,
body.dark-mode label,
body.dark-mode .sidebar-nav a {
    color: #e0e0e0;
}

body.dark-mode .sidebar-nav a:hover,
body.dark-mode .sidebar-nav a.active {
    background: #3d3d3d;
    color: #4dabf7;
    border-right-color: #4dabf7;
}

body.dark-mode .data-table tr:hover {
    background: #363636;
}

body.dark-mode .search-box input {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .btn-secondary {
    background: transparent;
    color: #ccc;
}

body.dark-mode .btn-secondary:hover {
    color: #fff;
}

.user-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff6b81;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

/* ============================================================
   SIDEBAR (menu lateral)
   ============================================================ */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 60px;
    /* Collapsed width initially or based on design */
    height: calc(100vh - 60px);
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar:hover,
.sidebar.expanded {
    width: 220px;
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 0;
    /* Remove horizontal padding for perfect centering */
    width: 100%;
    /* Ensure full width */
    color: #555;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: color 0.2s;
    justify-content: center;
    /* Center content (icon) */
}

.sidebar:hover .sidebar-nav a,
.sidebar.expanded .sidebar-nav a {
    justify-content: flex-start;
    /* Align left when expanded */
    padding: 12px 20px;
    /* Restore padding when expanded */
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: transparent;
    color: #007bff;
    border-right: none;
}

.sidebar-nav a .icon {
    width: 32px;
    /* Reduced size */
    height: 32px;
    /* Reduced size */
    min-width: 32px;
    margin-right: 0;
    /* No margin when collapsed */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    color: #555;
}

.sidebar:hover .sidebar-nav a .icon,
.sidebar.expanded .sidebar-nav a .icon {
    margin-right: 15px;
    /* Add margin when expanded */
}

.sidebar-nav a .icon svg {
    width: 18px;
    /* Reduced SVG size */
    height: 18px;
    /* Reduced SVG size */
}

.sidebar-nav a:hover .icon,
.sidebar-nav a.active .icon {
    background: #007bff;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2);
}

.sidebar-nav a .menu-label {
    opacity: 0;
    transition: opacity 0.2s;
    font-weight: 500;
}

.sidebar:hover .sidebar-nav a .menu-label,
.sidebar.expanded .sidebar-nav a .menu-label {
    opacity: 1;
}

/* Dark Mode Overrides for Sidebar */
body.dark-mode .sidebar-nav a {
    color: #aaa;
}

body.dark-mode .sidebar-nav a .icon {
    color: #aaa;
}

body.dark-mode .sidebar-nav a:hover .icon,
body.dark-mode .sidebar-nav a.active .icon {
    background: #007bff;
    color: #fff;
}

body.dark-mode .sidebar-nav a:hover,
body.dark-mode .sidebar-nav a.active {
    color: #fff;
}

/* ============================================================
   CONTEÚDO PRINCIPAL
   ============================================================ */
.content {
    margin-top: 60px;
    margin-left: 60px;
    /* Matches collapsed sidebar */
    padding: 30px;
    transition: margin-left 0.3s ease;
}

.sidebar:hover~.content,
.sidebar.expanded~.content {
    margin-left: 220px;
    /* Optional: push content */
}

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.date-filter {
    display: flex;
    gap: 10px;
}

.date-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid #eee;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

/* Revenue Card Specifics */
.revenue-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item h4 {
    margin: 0;
    font-size: 13px;
    color: #777;
    font-weight: 500;
}

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

.stat-item .value.green {
    color: #2ecc71;
}

.stat-item .value.red {
    color: #e74c3c;
}

.stat-item .change {
    font-size: 12px;
    font-weight: 600;
}

.change.up {
    color: #2ecc71;
}

.change.down {
    color: #e74c3c;
}

/* Summary Cards Row */
.summary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #eee;
}

.summary-card h4 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #777;
}

.summary-card .value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.summary-card .change {
    font-size: 12px;
    font-weight: 600;
}

/* Charts */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.donut-chart-container {
    height: 200px;
    display: flex;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .summary-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 220px;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

    .summary-row {
        grid-template-columns: 1fr;
    }

    .header-center {
        display: none;
    }
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.btn-voltar {
    display: inline-block;
    margin: 10px 0;
    padding: 8px 12px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.btn-voltar:hover {
    background: #2980b9;
}

/* ============================================================
   TELA DE LOGIN
   ============================================================ */
.login-page {
    background: #f4f6f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: #fff;
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 360px;
    box-sizing: border-box;
    text-align: left;
}

.login-logo {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
}

.login-links {
    text-align: right;
    margin-bottom: 15px;
}

.forgot-password {
    font-size: 13px;
    color: #3498db;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 10px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.login-btn:hover {
    background: #2980b9;
}

.login-footer {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 30px;
}

/* ============================================================
   LIST VIEWS (Clientes, Perfis, Permissões)
   ============================================================ */
.page-header {
    margin-bottom: 20px;
    background: transparent;
}

.breadcrumbs {
    font-size: 14px;
    color: #007bff;
    margin-bottom: 15px;
    font-weight: 500;
}

.breadcrumbs span {
    color: #999;
    margin: 0 5px;
}

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-primary {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #0069d9;
}

.btn-secondary {
    background: transparent;
    color: #555;
    border: none;
    padding: 8px 12px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.btn-secondary:hover {
    color: #333;
}

.filter-bar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.search-filter {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 15px 10px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    width: 280px;
    outline: none;
    color: #555;
}

.search-box input:focus {
    border-color: #007bff;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.btn-filter {
    background: #e3f2fd;
    color: #1976d2;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-filter:hover {
    background: #bbdefb;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-info select {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 5px 10px;
    color: #555;
    outline: none;
    background: #fff;
    cursor: pointer;
}

.data-table-container {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

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

.data-table th {
    text-align: left;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    color: #777;
    font-weight: 600;
    font-size: 13px;
    background: #fff;
    white-space: nowrap;
}

.data-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 14px;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: #fcfcfc;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffeaa7;
    color: #d35400;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

.name-cell {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #333;
}

.action-btn {
    color: #888;
    text-decoration: none;
    margin-left: 10px;
    font-size: 18px;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
}

.action-btn:hover {
    color: #333;
    background: #f5f5f5;
}

.checkbox-cell {
    width: 40px;
    text-align: center;
}

.checkbox-cell input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 3px;
}