﻿/* ========================
   elementy ogólne / helpery
   ======================== */

.table-end {
    text-align: center;
    font-weight: bold;
    color: #666;
}

.end-icon {
    font-size: 1.5em;
    vertical-align: middle;
    margin-right: 8px;
}

.end-text {
    font-size: 1.2em;
    vertical-align: middle;
}

.progress .label {
    position: absolute;
    top: 2px;
    left: 6px;
}

/* bootstrapowe nadpiski, jeśli używasz */
.bg-danger,
.bg-danger > tr {
    background-color: #dc3545 !important;
}

/* tło strony z dashboardem - opcjonalnie */
.dashboard-page {
    background: #f4f5f7;
    min-height: 100vh;
}


/* ========================
   GRIDSTACK / kontener
   ======================== */

.grid-stack {
    padding: 10px;
}

.grid-stack-item {
    padding: 6px;
}

    .grid-stack-item .grid-stack-item-content {
        height: 100%;
    }


/* ========================
   karta widgetu
   ======================== */

.dashboard-widget,
.kpi-spark-widget {
    background: #fff;
    border-radius: 14px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,.03);
    overflow: hidden;
}

/* nagłówek widgetu */
.widget-header {
    padding: 12px 14px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

    .widget-header h3 {
        font-size: 0.95rem;
        margin: 0;
        font-weight: 600;
    }

.widget-subtitle {
    display: block;
    font-size: .7rem;
    color: #888;
}

/* przycisk menu w rogu */
.widget-menu {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid #dcdfe4;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ciało widgetu */
.widget-body {
    padding: 10px 14px 14px;
    flex: 1;
    overflow-y: auto;
}


/* ========================
   widget: lista lekcji
   ======================== */

.widget-list .widget-list-item {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f2;
}

    .widget-list .widget-list-item:first-child {
        padding-top: 10px;
    }

    .widget-list .widget-list-item:last-child {
        border-bottom: none;
    }

.lesson-time {
    font-weight: 600;
    font-size: .8rem;
}

.lesson-title {
    font-weight: 500;
}

.lesson-meta {
    font-size: .7rem;
    color: #777;
}

.lesson-status {
    font-size: .65rem;
    background: #eef5ff;
    padding: 3px 8px;
    border-radius: 999px;
    align-self: center;
    white-space: nowrap;
}

.widget-empty {
    font-size: .8rem;
    color: #888;
    padding: 6px 0;
}

/* statusy dodatkowe (opcjonalnie) */
.lesson-status.is-active {
    background: #e6f7ec;
    color: #28a745;
}

.lesson-status.is-cancelled {
    background: #fde8e8;
    color: #d93025;
}

.kpi-widget {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.03);
    padding: 12px 16px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.kpi-header-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.kpi-header-horizontal .kpi-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.kpi-header-horizontal .kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111;
    text-align: right;
    white-space: nowrap;
}

.kpi-chart {
    height: 55px;
    margin-top: 4px;
    border-radius: 10px;
    overflow: hidden;
}



/* ========================
   dodatkowe poprawki wyglądu
   ======================== */

/* żeby karty lepiej odcinały się od tła */
.dashboard-widget + .dashboard-widget {
    margin-top: 10px;
}

/* scrollbar w widgetach – delikatniejszy, jeśli potrzebny */
.widget-body::-webkit-scrollbar {
    width: 6px;
}

.widget-body::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.12);
    border-radius: 999px;
}

/* teachers widget */
.widget-list--teachers .teacher-item {
    display: grid;
    grid-template-columns: 1fr 70px 70px;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f2;
}

    .widget-list--teachers .teacher-item:last-child {
        border-bottom: none;
    }

.teacher-name {
    font-weight: 500;
}

.teacher-hours {
    font-size: .75rem;
    color: #555;
    align-self: center;
}

.teacher-status {
    font-size: .65rem;
    text-align: center;
    padding: 3px 6px;
    border-radius: 999px;
    align-self: center;
}

    .teacher-status.is-ok {
        background: #e6f7ec;
        color: #2e7d32;
    }

    .teacher-status.is-warning {
        background: #fff4e5;
        color: #d97706;
    }

/* debtors widget */
.widget-list--debtors .debtor-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f2;
}

    .widget-list--debtors .debtor-item:last-child {
        border-bottom: none;
    }

.debtor-name {
    font-weight: 500;
}

.debtor-meta {
    font-size: .7rem;
    color: #777;
}

.debtor-amount {
    font-weight: 700;
    white-space: nowrap;
}

/* quick search widget */
.widget-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-search-input {
    border: 1px solid #dcdfe4;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: .85rem;
}

.widget-search-hint {
    font-size: .7rem;
    color: #888;
}

.widget-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget-search-item {
    padding: 6px 0;
    border-bottom: 1px solid #f2f2f2;
}

    .widget-search-item:last-child {
        border-bottom: none;
    }

.student-name {
    font-weight: 500;
}

.student-email {
    font-size: .7rem;
    color: #777;
}


/* widget: zajęcia wymagające uzupełnienia */
.widget-list--incomplete .incomplete-item {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f2;
}

    .widget-list--incomplete .incomplete-item:last-child {
        border-bottom: none;
    }

.incomplete-time {
    font-size: .7rem;
    color: #666;
}

.incomplete-title {
    font-weight: 500;
}

.incomplete-meta {
    font-size: .7rem;
    color: #777;
}

.incomplete-reason {
    font-size: .65rem;
    background: #fff4e5;
    color: #d97706;
    padding: 3px 8px;
    border-radius: 999px;
    align-self: center;
    white-space: nowrap;
}


.widget-chart-container {
    background: #fff;
    border-radius: 14px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,.03);
    overflow: hidden;
}

    .widget-chart-container .widget-header {
        padding: 12px 14px 0;
    }

        .widget-chart-container .widget-header h3 {
            font-size: 0.95rem;
            margin: 0;
            font-weight: 600;
        }

    .widget-chart-container .widget-body {
        padding: 10px 14px 14px;
        flex: 1;
    }

.widget-chart {
    height: 100%;
    width: 100%;
}
