/* ================= VARIABLES & RESET ================= */
:root {
    --bg-body: #f1f5f9;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --text-main: #334155;
    --text-muted: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 8px;
    --font-main: 'Inter', system-ui, sans-serif;
    --sidebar-width: 250px;
    --chat-bg: #efe7dd;
    --chat-me: #d9fdd3;
    --chat-other: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-body);
    font-family: var(--font-main);
    color: var(--text-main);
}

#app-layout {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

aside {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1e293b;
    flex-shrink: 0;
    z-index: 20;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

main {
    flex: 1;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 25px;
    position: relative;
    width: 100%;
}

main::-webkit-scrollbar {
    width: 8px;
}

main::-webkit-scrollbar-track {
    background: transparent;
}

main::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* SIDEBAR */
.brand {
    padding: 20px;
    border-bottom: 1px solid #1e293b;
    text-align: center;
    background: var(--bg-sidebar);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.sidebar-logo {
    width: 100%;
    height: auto;
    max-height: 50px;
    object-fit: contain;
}

.user-profile-mini {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #1e293b;
}

.avatar-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-shrink: 0;
}

.user-avatar-mini {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #334155;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.2s;
    color: white;
}

.avatar-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.user-info-mini div {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
}

.user-info-mini span {
    font-size: 11px;
    color: #94a3b8;
}

nav {
    flex: 1;
    padding-top: 15px;
    overflow-y: auto;
}

nav button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 12px 20px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

nav button:hover,
nav button.active {
    background: #1e293b;
    color: white;
    border-left-color: var(--primary);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #1e293b;
    background: rgba(0, 0, 0, 0.2);
    margin-top: auto;
}

.btn-logout-sidebar {
    width: 100%;
    background: #334155;
    color: #f87171;
    border: none;
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 12px;
}

.sidebar-credits {
    margin-top: 15px;
    font-size: 10px;
    color: #64748b;
    text-align: center;
    font-weight: 500;
}

/* UI ELEMENTS */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-shrink: 0;
    height: 40px;
}

h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-main);
}

.card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

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

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

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

.dash-grid-finance {
    display: grid;
    grid-template-columns: 3fr 7fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media(max-width: 900px) {
    .dash-grid-finance {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 900px) {
    .dash-grid-charts {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.kpi-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.kpi-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.notification-area {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    border-bottom: 1px solid #fcd34d;
    padding-bottom: 5px;
}

.notif-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f1f5f9;
}

.notif-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    width: 300px;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 100;
    overflow: hidden;
    animation: fadeIn 0.2s;
}

.notif-header {
    background: #f8fafc;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-main);
}

.notif-list {
    max-height: 300px;
    overflow-y: auto;
}

.notif-row {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    color: #475569;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.notif-row:hover {
    background: #f8fafc;
}

.notif-row.unread {
    background: #eff6ff;
    color: #1e293b;
    border-left: 3px solid var(--primary);
}

.notif-empty {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

.chart-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    padding: 15px 0;
    gap: 20px;
}

.pie-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
    margin-bottom: 20px;
}

.pie-chart::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    font-weight: 500;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.bar-chart-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    width: 100%;
    padding-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 14%;
    height: 100%;
    justify-content: flex-end;
    gap: 4px;
}

.bar-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 100%;
    width: 100%;
}

.bar {
    width: 8px;
    border-radius: 2px 2px 0 0;
    transition: height 0.5s;
    position: relative;
}

.bar:hover::after {
    content: attr(data-val);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    background: #333;
    color: #fff;
    padding: 2px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
    z-index: 5;
    white-space: nowrap;
}

.bar-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

.rank-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.rank-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    width: 40%;
}

.rank-info {
    flex: 1;
    padding-right: 15px;
}

.rank-bar {
    flex: 1;
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    margin: 0 10px;
    overflow: hidden;
}

.rank-fill {
    height: 100%;
    background: var(--success);
}

.rank-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.input-group {
    margin-bottom: 15px;
}

.input-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: block;
    text-transform: uppercase;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.filters-bar .input-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    font-size: 13px;
    background: #fff;
    color: #334155;
    transition: 0.2s;
}

.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
    margin: 25px 0 15px 0;
    text-transform: uppercase;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    border: 1px solid #cbd5e1;
    background: transparent;
    color: var(--text-main);
}

.btn-mini {
    padding: 6px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    position: relative;
}

.btn-mini:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-mini[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    margin-bottom: 6px;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.full-width {
    width: 100%;
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
}

.badge-estudo {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.badge-negociacao {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}

.badge-aprovado {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.badge-reprovado {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.score-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-align: center;
    min-width: 40px;
    display: inline-block;
}

.score-low {
    background: #ef4444;
}

.score-mid {
    background: #f59e0b;
}

.score-high {
    background: #10b981;
}

.score-none {
    background: #94a3b8;
}

.warning-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    margin-top: 8px;
    font-weight: 600;
}

.link-btn {
    font-size: 12px;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    margin-left: 5px;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 800px;
}

th {
    text-align: left;
    padding: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    background: #f8fafc;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
}

tr:hover td {
    background: #f8fafc;
}

.project-details-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.detail-section-header {
    background: #f8fafc;
    padding: 8px 15px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}

.detail-section-header:first-child {
    border-top: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.detail-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
}

.detail-item:nth-child(2n) {
    border-right: none;
}

.detail-full {
    grid-column: span 2;
    border-right: none;
}

.detail-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
    font-weight: 600;
    text-transform: uppercase;
}

.detail-value {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.4;
}

.detail-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    padding: 6px 10px;
    background: #f0f9ff;
    border-radius: 4px;
    margin-top: 5px;
}

.detail-file-link:hover {
    background: #e0f2fe;
}

.chat-container {
    height: 250px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    background-color: var(--chat-bg);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23d1d7db' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    padding: 8px 12px;
    border-radius: 7.5px;
    font-size: 13px;
    max-width: 75%;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    line-height: 1.4;
}

.chat-msg.me {
    align-self: flex-end;
    background: var(--chat-me);
    border-top-right-radius: 0;
}

.chat-msg.other {
    align-self: flex-start;
    background: var(--chat-other);
    border-top-left-radius: 0;
}

.chat-meta {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
}

.chat-user-name {
    font-weight: 700;
    font-size: 11px;
    color: var(--primary-dark);
    margin-bottom: 2px;
    display: block;
}

.mention-tag {
    color: #007acc;
    font-weight: 600;
    background: rgba(0, 122, 204, 0.1);
    padding: 0 2px;
    border-radius: 3px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #f0f2f5;
    align-items: center;
}

.mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 10px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 200px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 100;
}

.mention-dropdown.active {
    display: block;
}

.mention-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.mention-item:hover,
.mention-item.selected {
    background: #f8fafc;
}

.mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #cbd5e1;
}

.mention-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mention-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 13px;
}

.mention-role {
    font-size: 11px;
    color: var(--text-muted);
}

#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.login-box {
    background: #1e293b;
    padding: 40px 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
    text-align: center;
}

.login-logo {
    max-width: 180px;
    margin-bottom: 20px;
}

.login-subtitle {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 20px;
}

.login-input {
    background: white !important;
    margin-bottom: 15px;
    border: 1px solid #475569;
}

.login-msg {
    color: #ef4444;
    font-size: 12px;
    margin-bottom: 15px;
    min-height: 18px;
}

.login-footer {
    position: absolute;
    bottom: 20px;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    opacity: 0.7;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 95%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: 0.3s;
    max-height: 90vh;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fff;
}

.photo-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.photo-preview {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #f1f5f9;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.photo-label {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: block;
    }

    aside {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }

    aside.open {
        transform: translateX(0);
    }

    #mobile-overlay.open {
        display: block;
        opacity: 1;
    }

    #mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 15;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .dash-grid-charts {
        grid-template-columns: 1fr;
    }
}

/* PRINT STYLES */
@media print {

    html,
    body {
        background: white !important;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    /* Hide all direct children of body by default */
    body>* {
        display: none !important;
    }

    /* Only show the print area */
    body>#print-area {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        min-height: 100%;
        background: white !important;
        padding: 0;
        z-index: 9999;
    }

    #print-area * {
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    @page {
        size: A4;
        margin: 10mm;
    }

    #print-area h2 {
        display: block;
        text-align: center;
        margin-bottom: 20px;
        font-size: 18px;
        text-transform: uppercase;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        color: black !important;
    }

    /* Grid Layout for Print */
    #print-area .detail-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        border: 1px solid #000;
        background: white !important;
    }

    #print-area .detail-item {
        border-bottom: 1px solid #000;
        border-right: 1px solid #000;
        color: black !important;
        background: white !important;
        padding: 8px 10px;
    }

    /* Fix grid borders */
    #print-area .detail-item:nth-child(2n) {
        border-right: none;
    }

    #print-area .detail-full {
        grid-column: span 2;
        border-right: none;
    }

    #print-area .detail-value {
        color: black !important;
    }

    /* Headers */
    #print-area .detail-section-header {
        background: #f0f0f0 !important;
        color: black !important;
        border-top: 1px solid #000 !important;
        border-bottom: 1px solid #000 !important;
        font-weight: bold;
        padding: 5px 10px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #print-area .detail-section-header:first-child {
        border-top: none !important;
    }

    /* Remove backgrounds from specific containers if they leak */
    #print-area .project-details-container {
        border: none;
        background: white !important;
    }

    /* Header/Footer Images */
    .print-page-container {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        position: relative;
    }

    .print-header {
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }

    .print-header img {
        width: 100%;
        max-height: 150px;
        object-fit: contain;
    }

    .print-footer {
        width: 100%;
        text-align: center;
        margin-top: auto;
        padding-top: 20px;
    }

    .print-footer img {
        width: 100%;
        max-height: 100px;
        object-fit: contain;
    }

    .print-content {
        flex: 1;
        padding: 0 20px;
    }

    .print-meta {
        margin-bottom: 20px;
        font-size: 14px;
        text-align: center;
    }

    .print-admin-box {
        margin-top: 20px;
        border: 1px dashed #000;
        padding: 10px;
    }

    #print-area {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Suggestions List for Autocomplete */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

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

.suggestion-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

/* Scrollbar for suggestions */
.suggestions-list::-webkit-scrollbar {
    width: 6px;
}

.suggestions-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.suggestions-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Toast Notification */
/* Toast Notification */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* Allows clicking through container area */
}

.toast {
    pointer-events: auto;
    background: #fffbeb;
    /* Yellow-ish background like screenshot */
    border-left: 5px solid #f59e0b;
    /* Amber */
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    cursor: pointer;
    min-width: 320px;
    transition: 0.3s;
    border: 1px solid #fcd34d;
}

.toast:hover {
    transform: translateX(-5px);
}

.toast-content {
    flex: 1;
}

.toast-msg {
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    /* Dark Amber */
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toast-meta {
    font-size: 12px;
    color: #b45309;
}

.notif-check-btn {
    background: #fff;
    border: 1px solid #f59e0b;
    color: #f59e0b;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.notif-check-btn:hover {
    background: #f59e0b;
    color: white;
}

/* Notification Panel Row Styles */
.notif-row {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: background 0.2s;
}

.notif-row:hover {
    background: #f8fafc;
}

.notif-row.unread {
    background: #fffbeb;
    /* Yellow background for unread */
}

.notif-row span {
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
}


@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Weekly Chart / My Network Styles */
/* ENHANCED CHART LAYOUT */
.chart-layout {
    display: flex;
    height: 320px;
    margin-top: 20px;
    padding-bottom: 20px;
    /* Space or x-axis labels */
    position: relative;
    border-bottom: 1px solid #e2e8f0;
}

.chart-y-axis {
    display: flex;
    flex-direction: column-reverse;
    /* 0 at bottom */
    justify-content: space-between;
    padding-right: 15px;
    border-right: 1px solid #e2e8f0;
    min-width: 80px;
    /* Fixed width for labels */
    height: 100%;
}

.y-label {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    height: 20px;
    /* Approximate height for alignment */
    display: flex;
    align-items: center;
    /* Center vertically relative to grid line point */
    justify-content: flex-end;
    /* Adjust margin to align center of text with grid line */
    transform: translateY(50%);
}

.y-label:last-child {
    transform: translateY(50%);
    /* 0 label */
}

.y-label:first-child {
    transform: translateY(-50%);
    /* Top label */
}


.chart-content-area {
    flex: 1;
    position: relative;
    height: 100%;
    margin-left: 0;
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    z-index: 0;
    pointer-events: none;
}

.grid-line {
    width: 100%;
    height: 1px;
    background: #f1f5f9;
}

.chart-weekly-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    /* Distribute weeks */
    z-index: 10;
    padding: 0 20px;
    /* Side padding inside chart area */
    border-bottom: none;
    /* Handled by layout wrapper */
    margin-top: 0;
    height: 100%;
}

.week-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 5px;
    position: relative;
    height: 100%;
    justify-content: flex-end;
}

.week-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    /* Spacing between bars in a group */
    height: 100%;
    width: 100%;
    max-width: 80px;
    /* Constraint bar group width */
}

.week-bar {
    width: 16px;
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease-out;
    position: relative;
    min-height: 0px;
}

.week-label {
    position: absolute;
    bottom: -35px;
    /* Push label below the axis line */
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.meta-line-container {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    pointer-events: none;
    z-index: 20;
}

.meta-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 2px dashed;
    z-index: 20;
    opacity: 0.8;
}

.meta-line-varejo {
    border-color: #3b82f6;
}

.meta-line-pl {
    border-color: #10b981;
}

.meta-line-factum {
    border-color: #8b5cf6;
}

.meta-label {
    position: absolute;
    right: 0;
    top: -20px;
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    z-index: 21;
    white-space: nowrap;
}

.meta-label-varejo {
    background: #3b82f6;
}

.meta-label-pl {
    background: #10b981;
}

.meta-label-factum {
    background: #8b5cf6;
}


.goal-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.goal-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    transition: 0.2s;
}

.goal-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.goal-card h4 {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
}

.goal-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
}

.goal-status.active {
    background: #dbeafe;
    color: #1e40af;
}

/* Updated Colors for New Chart */
/* Negotiation: Warning/Yellow */
.bar-negoc {
    background: #facc15;
}

/* Approved: Success/Green */
.bar-aprov {
    background: #22c55e;
}

/* Reproved: Danger/Red */
.bar-reprov {
    background: #ef4444;
}

/* Legend updates */
.dot-negoc {
    background: #facc15;
}

.dot-aprov {
    background: #22c55e;
}

.dot-reprov {
    background: #ef4444;
}

.dot-meta {
    background: #6366f1;
    border-top: 2px dashed #6366f1;
    height: 0;
    width: 14px;
    border-radius: 0;
}

/* TEAM DASHBOARD STYLES */
.team-dashboard-container {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.team-card {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-top: 5px solid;
}

.team-tony {
    border-color: #84cc16;
    /* Lime */
}

.team-douglas {
    border-color: #0ea5e9;
    /* Sky Blue */
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

.team-title {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-total {
    font-size: 18px;
    font-weight: 700;
    color: #334155;
}

.team-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #64748b;
}

.stat-value {
    font-weight: 700;
    color: #334155;
}

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.color-varejo {
    background: #3b82f6;
}

.color-pl {
    background: #10b981;
}

.color-factum {
    background: #8b5cf6;
}

.color-indefinido {
    background: #cbd5e1;
}

@media(max-width: 768px) {
    .team-dashboard-container {
        flex-direction: column;
    }
}

/* Team Dashboard Enhancements */
.team-main-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-block {
    text-align: center;
}

.stat-block-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 4px;
}

.stat-block-val {
    font-size: 18px;
    font-weight: bold;
}

.btn-mini-history {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 10;
}

.btn-mini-history:hover {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Modal Enhancements */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    /* Reset to hidden by default to prevent static modals from showing */
    display: none;
    justify-content: center;
    align-items: center;
}

/* Activation state for standard modals */
.modal-overlay.active {
    display: flex;
    z-index: 20000;
    /* Ensure active modals are on top */
    animation: fadeIn 0.3s ease-out forwards;
}

/* Special rule for History Modal (dynamic) to force visibility */
#historyModal {
    display: flex !important;
    z-index: 20000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    max-width: 90%;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Team Badges */
.badge-team-tony {
    background-color: #dcfce7;
    color: #166534;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-team-douglas {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-team-neutral {
    background-color: #f1f5f9;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}. u s e r - t e a m - l a b e l   {  
         f o n t - s i z e :   1 1 p x ;  
         c o l o r :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 5 ) ;  
         / *   D i s c r e e t   /   O p a c i t y   * /  
         m a r g i n - t o p :   2 p x ;  
         f o n t - w e i g h t :   5 0 0 ;  
         t e x t - t r a n s f o r m :   u p p e r c a s e ;  
         l e t t e r - s p a c i n g :   0 . 5 p x ;  
 }  
 