/* /modules/personal/css/personal_dashboard.css */

/* --- Switcher Buttons --- */
#dashboard-group-switcher .nav-link {
    font-weight: 500;
    border-radius: 0.6rem;
    padding: 0.45rem 0.9rem;
    transition: all 0.25s ease, box-shadow 0.2s ease;
    color: var(--sidebar-text-color);
    background-color: transparent;
    border: none;
}
#dashboard-group-switcher .nav-link:not(.active):hover {
    background-color: var(--sidebar-link-hover-bg);
    transform: translateY(-2px);
}
#dashboard-group-switcher .nav-link.active {
    background-color: var(--apple-accent-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 0 12px var(--button-glow);
}
[data-bs-theme="dark"] #dashboard-group-switcher .nav-link.active {
    color: #1c1c1e;
}
#dashboard-group-switcher .nav-link.active:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 0 12px var(--button-glow);
}

/* --- Stat Panels --- */
.stat-card {
    background: var(--apple-card-bg);
    border: 1px solid var(--apple-card-border);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}
.stat-card-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--apple-secondary-text);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--apple-text-color);
    line-height: 1.2;
}

/* === Ninja Table Styles === */

/* Цветове за Чч (първа таблица) */
.table-ninja > tbody > tr > td.ninja-hours-green { 
    background-color: rgba(48, 209, 88, 0.3) !important; 
}
.table-ninja > tbody > tr > td.ninja-hours-yellow { 
    background-color: rgba(255, 204, 0, 0.3) !important; 
}
.table-ninja > tbody > tr > td.ninja-hours-red { 
    background-color: rgba(255, 59, 48, 0.3) !important; 
}

/* Click-to-filter (първа таблица) */
.ninja-cell-personal {
    cursor: pointer;
    color: var(--apple-accent-color);
    font-weight: 500;
}
.ninja-cell-personal:hover {
    text-decoration: underline;
}
.table-ninja th {
    font-size: 0.85rem;
}
.table-ninja td {
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Скрол (първа таблица) */
#ninja-table-container {
    max-height: 600px;
    overflow-y: auto;
}
.table-ninja {
     width: 100%;
}

/* Sticky header (първа таблица) */
.table-ninja th {
    position: sticky;
    top: 0;
    background-color: var(--apple-card-bg); 
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1); 
}

 
/* === НОВО: Стилове за Pivot Таблицата === */

#ninja-pivot-table-container {
    overflow-x: auto;
    overflow-y: auto; /* <-- MODIFIED */
    max-height: 600px; /* <-- MODIFIED */
}

.table-pivot {
    width: 100%;
    min-width: 1200px; 
    border-collapse: collapse;
}

.table-pivot th,
.table-pivot td {
    font-size: 0.85rem;
    text-align: center;
    vertical-align: middle;
    padding: 0.5rem 0.4rem;
    border: 1px solid var(--apple-card-border);
    white-space: nowrap;
}

/* General sticky header for pivot table */
.table-pivot th {
    background-color: var(--apple-card-bg); /* <-- MODIFIED */
    position: sticky;
    top: 0;
    z-index: 10; /* <-- MODIFIED */
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1); /* <-- MODIFIED */
}

/* "Лепкава" първа колона (Имена) */
.table-pivot tbody th {
    position: sticky;
    left: 0;
    background-color: var(--apple-card-bg);
    text-align: left;
    font-weight: 600;
    z-index: 6; /* This is correct: lower than header */
    min-width: 200px;
    
    cursor: pointer;
    color: var(--apple-accent-color);
    box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1); /* Added subtle shadow for column */
}
.table-pivot tbody th:hover {
    text-decoration: underline;
}

/* Горен-ляв ъгъл */
.table-pivot thead th:first-child {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 11; /* Highest z-index */
    background-color: var(--apple-card-bg); /* <-- MODIFIED */
}

/* Колона Общо */
.table-pivot .pivot-col-total {
    font-weight: bold;
    background-color: var(--apple-hover-bg);
}

/* === Условно форматиране за Pivot === */

/* noValue: "0" */
.pivot-cell-zero {
    color: var(--apple-secondary-text);
}

/* text (ПО, Б, etc.) */
.pivot-cell-leave {
    font-weight: bold;
    color: var(--apple-accent-color) !important;
}

/* 1-6.9 (light-blue) */
.pivot-cell-blue {
    background-color: rgba(90, 200, 250, 0.3) !important;
}

/* 7 (orange) */
.pivot-cell-orange {
    background-color: rgba(255, 149, 0, 0.4) !important;
}

/* 8 (green) */
.pivot-cell-green {
    background-color: rgba(48, 209, 88, 0.3) !important;
}

/* 9+ (yellow) */
.pivot-cell-yellow {
    background-color: rgba(255, 204, 0, 0.4) !important;
    font-weight: bold;
}

/* Зелено за почивни дни (от Grafana overrides) */
.pivot-day-weekend {
    background-color: rgba(48, 209, 88, 0.15) !important;
}