@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.mobile-only {
    display: none;
}

:root {
    --bg-main: #14141E;
    --bg-panel: #1E1E2E;
    --bg-header: #1A1A2E;
    --text-primary: #E0E0E0;
    --text-secondary: #9E9E9E;
    --border-color: #2D2D3D;
    --accent-cyan: #00BCD4;
    --accent-cyan-hover: #0097A7;
    --salary-green: #4CAF50;
    --btn-edit: #00BCD4;
    --btn-delete: #EF5350;
    --row-bg: #252536;
    --row-hover: #3F3F5A;
    --row-border: #333348;
    --stat-bg: #161622;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

/* Layout */
.layout-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.brand {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.brand-subtitle {
    font-size: 11px;
    color: var(--accent-cyan);
    font-weight: 600;
    text-align: right;
    margin-top: -2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.settings-btn-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--row-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.settings-btn-modern:hover {
    background-color: var(--row-hover);
    color: white;
    border-color: var(--accent-cyan);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 6px 6px 16px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-main);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.btn-logout-modern {
    background-color: rgba(239, 83, 80, 0.1);
    color: var(--btn-delete);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.btn-logout-text {
    display: inline;
}

.btn-logout-modern:hover {
    background-color: var(--btn-delete);
    color: white;
}

/* Sub Navigation (Tabs) */
.sub-nav {
    display: flex;
    padding: 0 24px;
    background-color: var(--bg-main);
    gap: 32px;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.sub-nav::-webkit-scrollbar {
    display: none; /* hide scrollbar for horizontal sub-nav */
}

.nav-tab {
    padding: 16px 0 8px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    position: relative;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--accent-cyan);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-cyan);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 8px 24px 24px 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.home-title {
    font-size: 48px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Panels */
.panel {
    background-color: var(--bg-panel);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.custom-input {
    width: 100%;
    background-color: #222230;
    border: 1px solid #44445A;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.custom-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.custom-input::placeholder {
    color: #666;
}

select.custom-input {
    appearance: auto;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-dodaj {
    background-color: var(--accent-cyan);
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    min-width: 120px;
    text-align: center;
    margin-top: 8px;
}

.btn-dodaj:hover {
    background-color: var(--accent-cyan-hover);
}

/* Employee List */
.employee-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.employee-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--row-bg);
    border: 1px solid var(--row-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    transition: background-color 0.15s;
}

.employee-card:hover {
    background-color: var(--row-hover);
}

.emp-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.emp-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.emp-name .fw-bold {
    font-weight: 700;
}

.emp-salaries {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.salary-label {
    color: var(--text-secondary);
}

.salary-val {
    font-weight: 600;
    color: var(--salary-green);
}

.text-success {
    color: var(--salary-green) !important;
}

.text-danger {
    color: var(--btn-delete) !important;
}

.ms-3 {
    margin-left: 16px;
}

.emp-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-action {
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-action.edit {
    color: var(--btn-edit);
    background: rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.2);
}

.btn-action.edit:hover {
    background: rgba(0, 188, 212, 0.2);
    border-color: rgba(0, 188, 212, 0.4);
}

.btn-action.delete {
    color: var(--btn-delete);
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.btn-action.delete:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 10px 16px;
    background-color: var(--stat-bg);
    border-radius: 8px;
    flex-shrink: 0;
}

.btn-page {
    background-color: var(--accent-cyan);
    border: none;
    color: white;
    min-width: 40px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    padding: 6px 12px;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-page:not(:disabled):hover {
    background-color: var(--accent-cyan-hover);
}

.page-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.page-info strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Blazor Validation */
.validation-message {
    color: var(--btn-delete);
    font-size: 12px;
    margin-top: 4px;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.login-panel {
    background-color: var(--bg-panel);
    border-radius: 12px;
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-white { color: var(--text-primary); }
.fw-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.w-100 { width: 100%; }

/* Override Radzen chart styles for dark theme */
.rz-chart {
    background: transparent !important;
}

.rz-chart svg {
    overflow: visible !important;
}

.rz-axis-text, .rz-chart text {
    font-size: 11px !important;
    fill: #9E9E9E !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #333348;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a4a60;
}

/* Blazor error UI */
#blazor-error-ui {
    display: none;
}

/* Donut chart responsive container */
.donut-chart-container {
    background: #161622;
    border-radius: 10px;
    padding: 8px;
    height: 400px;
}

/* Desktop variant: shown on wide screens, hidden on mobile */
.donut-desktop { display: block; }
.donut-mobile  { display: none; }

@media (max-width: 900px) {
    .donut-desktop { display: none; }
    .donut-mobile  {
        display: block;
        height: 400px;
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        height: 100%;
        gap: 12px;
    }
    
    .panel {
        height: 100%;
        min-height: 0;
        padding: 16px;
    }

    .left-panel {
        overflow-y: auto;
    }
    
    .mobile-only {
        display: block !important;
    }

    .btn-show-history {
        margin-top: auto;
        width: 100%;
        background-color: #2196F3;
        color: white;
        border: none;
        padding: 12px;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 8px;
    }

    .btn-close-modal {
        position: absolute;
        top: 16px;
        right: 16px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10000;
    }

    .right-panel {
        display: none;
    }

    .right-panel.mobile-modal-open {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background-color: var(--bg-main);
        border-radius: 0;
        padding: 24px 16px;
        height: 100vh !important;
    }
    
    .main-content {
        overflow: hidden;
        padding: 8px 12px 12px 12px;
    }
    
    .top-header {
        padding: 12px 16px;
    }
    
    .sub-nav {
        padding: 0 16px;
        gap: 20px;
    }

    .brand-title {
        font-size: 20px;
    }

    .header-actions {
        gap: 12px;
    }

    .user-badge {
        gap: 8px;
        padding: 4px 4px 4px 8px;
    }

    .user-name-text {
        display: none;
    }

    .btn-logout-text {
        display: none;
    }
    
    .btn-logout-modern {
        padding: 6px 8px;
    }

    .settings-btn-text {
        display: none;
    }

    .settings-btn-modern {
        padding: 8px 10px;
    }
    
    /* Stats containers wrap */
    .stat-cards-container {
        flex-direction: column !important;
        gap: 16px !important;
    }
    
    .stat-cards-container > div {
        width: 100% !important;
        min-width: unset !important;
    }
    
    .home-title {
        font-size: 28px !important;
    }

    .panel-title {
        flex-wrap: wrap;
    }

    .employee-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .emp-salaries {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .ms-3 {
        margin-left: 0 !important;
    }
    
    .emp-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .employee-list {
        overflow-x: hidden;
    }
}

/* Settings Modal */
.custom-settings-dialog .rz-dialog-content {
    padding: 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

.custom-settings-dialog .rz-dialog-titlebar {
    display: none !important;
}

.custom-settings-dialog {
    background: transparent !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
    border-radius: 10px !important;
}

.settings-container {
    display: flex; 
    height: 500px; 
    background-color: #141414; 
    color: #FFFFFF; 
    border-radius: 10px; 
    overflow: hidden; 
    width: 100%;
}

.settings-sidebar {
    width: 240px; 
    background-color: #1F1F1F; 
    padding: 20px 15px; 
    display: flex; 
    flex-direction: column; 
    border-right: 1px solid #2C2C2C;
    flex-shrink: 0;
}

.settings-tab {
    padding: 10px 15px; 
    border-radius: 6px; 
    font-weight: 600; 
    font-size: 13px; 
    margin-bottom: 5px; 
    cursor: pointer; 
    transition: all 0.2s;
    background-color: transparent; 
    color: #A0A0A0;
}

.settings-tab.active {
    background-color: #323232; 
    color: #FFFFFF;
}

.settings-content-wrapper {
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    background-color: #141414;
    min-width: 0;
}

.settings-header {
    padding: 30px 40px 20px 40px;
}

.settings-body {
    padding: 0 40px; 
    flex: 1;
    overflow-y: auto;
}

.settings-footer {
    padding: 15px 40px; 
    border-top: 1px solid #2C2C2C; 
    background-color: #181818;
}

@media (max-width: 900px) {
    .rz-dialog.custom-settings-dialog {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        left: 0 !important;
        top: 0 !important;
        margin: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
    }

    .custom-settings-dialog .rz-dialog-content {
        border-radius: 0 !important;
        height: 100vh !important;
    }

    .settings-container {
        flex-direction: column;
        height: 100vh !important;
        border-radius: 0 !important;
    }

    .settings-sidebar {
        width: 100%;
        flex-direction: row;
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid #2C2C2C;
        overflow-x: auto;
    }

    .settings-tab {
        margin-bottom: 0;
        margin-right: 10px;
        white-space: nowrap;
    }

    .settings-header, .settings-body, .settings-footer {
        padding: 20px !important;
    }
}

.stat-card-link:hover {
    transform: translateY(-4px);
    background-color: var(--bg-panel) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
}