@charset "UTF-8";

:root {
    --bg: #f5f7fa;
    --card: #ffffff;
    --accent: #4361ee;
    --accent-light: #4895ef;
    --accent-dark: #3a0ca3;
    --sidebar: #1a1f2e;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.12);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --present: #10b981;
    --absent: #ef4444;
    --excused: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background: var(--sidebar);
    color: #fff;
    padding: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.sidebar .brand {
    font-weight: 700;
    font-size: 1.5rem;
    padding: 24px 24px 32px;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    border-bottom: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 0.5px;
}

.sidebar nav {
    padding: 20px 16px;
    flex: 1;
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    color: #cbd5e0;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar .nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
}

.sidebar .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateX(4px);
}

.sidebar .nav-item.active {
    background: rgba(67,97,238,0.15);
    color: #fff;
    border-left: 4px solid var(--accent);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: #a0aec0;
}

/* Main content */
.main-content {
    margin-left: 280px;
    flex: 1;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: var(--card);
    box-shadow: 0 2px 15px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar .welcome {
    font-size: 1.1rem;
}

.topbar .logout {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.topbar .logout:hover {
    background: rgba(67,97,238,0.1);
}

.page {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Karty */
.card {
    background: var(--card);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow-hover);
}

.card h2 {
    color: var(--text);
    margin-bottom: 24px;
    font-size: 1.5rem;
    font-weight: 700;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.card h3 {
    color: var(--text);
    margin-bottom: 16px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Siatki */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.grid .card {
    margin-bottom: 0;
}

/* Tabele */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.table th {
    background: #f8fafc;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr {
    transition: background 0.2s ease;
}

.table tr:hover {
    background: #f8fafc;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Przyciski */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(67,97,238,0.25);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67,97,238,0.35);
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn.outline {
    background: transparent !important;
    border: 2px solid var(--accent) !important;
    color: var(--accent) !important;
    box-shadow: none !important;
}

.btn.outline:hover {
    background: rgba(67,97,238,0.1) !important;
    transform: translateY(-1px) !important;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Formularze */
input, select, textarea {
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid var(--border);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}

.search-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-row input {
    flex: 1;
    min-width: 250px;
}

/* Live search (członkowie) */
.live-search {
    position: relative;
}

.live-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-hover);
    max-height: 320px;
    overflow: auto;
    z-index: 200;
    display: none;
}

.live-search-results.open {
    display: block;
}

.live-search-item {
    width: 100%;
    text-align: left;
    background: white;
    border: none;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.live-search-item:hover {
    background: #f8fafc;
}

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

.live-search-title {
    font-weight: 700;
    color: var(--text);
}

.live-search-sub {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 2px;
}

.live-search-empty {
    padding: 12px 14px;
    color: var(--text-light);
}

/* Segmented tabs */
.segmented {
    display: inline-flex;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.segmented a {
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    border-right: 1px solid var(--border);
    background: transparent;
}

.segmented a:last-child {
    border-right: none;
}

.segmented a.active {
    background: rgba(67,97,238,0.12);
    color: var(--accent);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: white;
    border-radius: 14px;
    padding: 22px;
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow: auto;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: rgba(0,0,0,0.06);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.present {
    background: rgba(16,185,129,0.1);
    color: var(--present);
}

.status-badge.absent {
    background: rgba(239,68,68,0.1);
    color: var(--absent);
}

.status-badge.excused {
    background: rgba(245,158,11,0.1);
    color: var(--excused);
}

.status-badge.success {
    background: rgba(16,185,129,0.1);
    color: var(--success);
}

.status-badge.warning {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
}

.status-badge.danger {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

.status-badge.info {
    background: rgba(67,97,238,0.1);
    color: var(--accent);
}

/* Filar kafelki */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.pillar-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px var(--shadow);
}

.pillar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--shadow-hover);
}

.pillar-card h3 {
    margin: 0 0 10px 0;
    color: var(--accent);
}

.pillar-card .pillar-stats {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Meeting list */
.meeting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    background: white;
}

.meeting-item .meeting-info h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.meeting-item .meeting-info .meeting-date {
    color: var(--text-light);
    font-size: 0.85rem;
}

.meeting-item .meeting-actions {
    display: flex;
    gap: 8px;
}

/* Procenty w raportach */
.progress-bar {
    width: 100px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 6px;
    background: var(--accent);
    border-radius: 3px;
}

/* Alerty */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert.warning {
    background: #ffedd5;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert.info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--accent);
}

/* Notyfikacje */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 350px;
    border-left: 4px solid var(--accent);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.notification-close:hover {
    background: rgba(0,0,0,0.1);
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--border);
}

/* Puste stany */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--border);
    display: block;
}

/* Mobile menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 101;
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mobile-menu-btn:hover {
    background: var(--accent-light);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsywność */
@media (max-width: 1200px) {
    .page {
        padding: 24px;
    }
}

@media (max-width: 992px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .mobile-menu-btn {
        display: block;
    }
    .topbar {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .topbar .welcome {
        order: 2;
        width: 100%;
    }
    .topbar .logout {
        order: 1;
        margin-left: auto;
    }
    .page {
        padding: 20px;
    }
    .card {
        padding: 20px;
    }
    .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table th, .table td {
        padding: 12px 16px;
        white-space: nowrap;
    }
    .search-row {
        flex-direction: column;
    }
    .search-row input {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .card {
        padding: 16px;
    }
    .card h2 {
        font-size: 1.3rem;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
}
