:root {
    --bg-body: #1e1e1e;
    --bg-card: #2d2d2d;
    --primary-red: #ea5555;
    --primary-blue: #3b82f6;
    --text-white: #ffffff;
    --text-gray: #a1a1aa;
    --success: #10b981;
    --radius: 4px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-white);
    height: 100vh;
    overflow: hidden;
}

/* LAYOUT */
.app-layout {
    display: flex;
    height: 100vh;
    background-color: var(--bg-body);
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s;
}

.dashboard-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background-color: #000;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar .logo {
    padding: 1.5rem;
    border-bottom: 2px solid var(--primary-red);
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.5px;
}

.sidebar .logo span {
    color: var(--primary-red);
}

.side-nav {
    flex: 1;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

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

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #333;
}

/* HEADER */
.top-header {
    background-color: var(--bg-card);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: #666;
}

.breadcrumbs span {
    color: var(--text-white);
    font-weight: 500;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.u-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.u-role {
    font-size: 0.7rem;
    color: var(--text-gray);
}

/* CONTROLS */
.controls-bar {
    background-color: var(--bg-body);
    padding: 1rem 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.control-label {
    font-size: 0.7rem;
    color: var(--text-gray);
    text-transform: uppercase;
    font-weight: 600;
}

.select-input {
    background-color: #2d2d2d;
    color: white;
    border: 1px solid #444;
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
}

.toggle-view {
    display: flex;
    background-color: #333;
    border-radius: var(--radius);
    padding: 2px;
}

.view-btn {
    background: none;
    border: none;
    color: #888;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 2px;
}

.view-btn.active {
    background-color: #555;
    color: white;
    font-weight: 600;
}

/* ACTIONS */
.action-group {
    margin-left: auto;
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-export {
    background-color: var(--primary-red);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export:hover {
    opacity: 0.9;
}

/* DASHBOARD CONTENT */
.dashboard-content {
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

.grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.col-span-2 {
    grid-column: span 2;
}

.widget-panel {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.widget-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-title {
    color: var(--primary-red);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #2d2d2d 0%, #252525 100%);
    border: 1px solid #333;
    border-top: 3px solid var(--primary-red);
    position: relative;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: white;
}

.kpi-title {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    color: #ccc;
}

.kpi-trend {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
}

.chart-wrapper {
    padding: 1.5rem;
    position: relative;
    height: 350px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1.5rem;
    color: var(--text-gray);
    font-weight: 600;
    border-bottom: 1px solid #444;
    text-transform: uppercase;
    font-size: 0.75rem;
    background-color: #252525;
}

.data-table td {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #444;
    color: #ddd;
}

.text-right {
    text-align: right;
}

.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-ok {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.hidden {
    display: none !important;
}

/* WIDGET LISTS */
.list-widget {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-widget li {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.team-perf {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tp-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.tp-bar {
    flex: 1;
    height: 6px;
    background-color: #444;
    border-radius: 3px;
    overflow: hidden;
}

.tp-bar div {
    height: 100%;
    background-color: var(--success);
    transition: width 0.5s;
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.modal-card {
    background: var(--bg-card);
    width: 500px;
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid #444;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
}

.close-modal {
    cursor: pointer;
    color: #888;
    font-size: 1.5rem;
    line-height: 1;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: #ccc;
}

.form-input {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #444;
    padding: 0.6rem;
    color: white;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.form-input:focus {
    border-color: var(--primary-blue);
    outline: none;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.error-msg {
    color: #ea5555;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}
