/* Main Styles for Sistema Base de Dadus Suco Mascarenhas */

:root {
    --primary-dark: #1e3a5f;
    --primary-blue: #2c5282;
    --primary-light: #3182ce;
    --accent-blue: #4299e1;
    --sidebar-bg: #1a365d;
    --text-light: #ffffff;
    --text-muted: #a0aec0;
    --bg-light: #f7fafc;
    --bg-gray: #edf2f7;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gray);
    min-height: 100vh;
    color: #2d3748;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: var(--sidebar-bg);
    padding: 0;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-logo {
    text-align: center;
    padding: 25px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--accent-blue);
    background: white;
    padding: 3px;
}

.sidebar-menu {
    list-style: none;
    padding: 15px;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu a.active {
    background: var(--primary-light);
    color: white;
}

.sidebar-menu a i {
    margin-right: 12px;
    width: 20px;
    font-size: 1.1rem;
}

.sidebar-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 15px 15px 10px;
    font-weight: 600;
    letter-spacing: 1px;
}

.user-info {
    padding: 20px 15px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info .btn-logout {
    width: 100%;
    background: #c53030;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 500;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.user-info .btn-logout:hover {
    background: #9b2c2c;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
    background: var(--bg-gray);
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.page-header p {
    color: #718096;
    font-size: 0.95rem;
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s;
    border-left: 4px solid var(--primary-light);
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.stat-card .stat-icon i {
    font-size: 1.5rem;
    color: white;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 8px;
}

/* Chart Cards */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.chart-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border: none;
}

.chart-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}

.chart-card .card-body {
    padding: 0;
}

.chart-container {
    position: relative;
    height: 250px;
}

/* Data List */
.data-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.data-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.data-list li:last-child {
    border-bottom: none;
}

.data-list .label {
    color: #4a5568;
    font-size: 0.9rem;
}

.data-list .value {
    font-weight: 600;
    color: var(--primary-dark);
    background: #ebf8ff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Language Switcher */
.lang-switcher {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 1001;
}

.lang-switcher .dropdown-toggle {
    background: var(--primary-blue);
    border: none;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: var(--card-shadow);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-switcher .dropdown-toggle:hover,
.lang-switcher .dropdown-toggle:focus {
    background: var(--primary-dark);
    color: white;
}

.lang-switcher .dropdown-toggle::after {
    margin-left: 4px;
}

.lang-switcher .lang-code {
    font-weight: 700;
}

.lang-switcher .dropdown-menu {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-top: 5px;
    min-width: 180px;
}

.lang-switcher .dropdown-item {
    color: #4a5568;
    padding: 10px 15px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.lang-switcher .dropdown-item:hover {
    background: #ebf8ff;
    color: var(--primary-dark);
}

.lang-switcher .dropdown-item.active {
    background: var(--primary-light);
    color: white;
}

.lang-switcher .dropdown-item.active .badge {
    background: white !important;
    color: var(--primary-dark);
}

/* Page action buttons */
.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page-actions .btn {
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    .stats-row {
        grid-template-columns: 1fr;
    }
}

/* Flash Messages */
.alert-floating {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    min-width: 300px;
    animation: slideDown 0.3s ease;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.alert-success {
    background: #48bb78;
    color: white;
}

.alert-danger {
    background: #fc8181;
    color: white;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.85rem;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 15px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-color: #e2e8f0;
}

.table-hover tbody tr:hover {
    background-color: #f7fafc;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 5px 10px;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-primary:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 6px;
    border-color: #e2e8f0;
    padding: 10px 15px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
}

/* Code */
code {
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--primary-dark);
    font-size: 0.85rem;
}

/* Print styles */
@media print {
    .sidebar,
    .lang-switcher,
    .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
    }
}
