/*
 * TopHire Employee Dashboard - Modern Redesign
 * Senior UX/UI Implementation
 *
 * Design Philosophy: Clean, professional, high-contrast, and accessible.
 * Focus on clear hierarchy, spacious layout, and modern typography.
 */

:root {
    /* Color Palette - Professional Dark Theme */
    --color-primary: #3b82f6; /* Blue for primary actions/accents */
    --color-primary-dark: #2563eb;
    --color-background: #0f172a; /* Dark Slate */
    --color-surface: #1e293b; /* Slightly lighter surface for cards */
    --color-text-main: #f8fafc; /* Light text for high contrast */
    --color-text-secondary: #94a3b8; /* Muted text for secondary info */
    --color-border: #334155; /* Subtle border */
    --color-success: #10b981;
    --color-danger: #ef4444;

    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Spacing & Radius */
    --spacing-unit: 8px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 9999px;

    /* Shadow */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background-color: var(--color-background);
    font-family: var(--font-family);
    color: var(--color-text-main);
    line-height: 1.6;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(4 * var(--spacing-unit)) calc(2 * var(--spacing-unit));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-unit) calc(2 * var(--spacing-unit));
    margin-bottom: calc(4 * var(--spacing-unit));
    border-radius: var(--radius-lg);
    background-color: var(--color-surface);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    background-color: var(--color-primary);
    color: var(--color-background);
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-main);
}

.brand-subtitle {
    display: none; /* Removed for cleaner header */
}

.app-nav {
    display: flex;
    align-items: center;
    gap: calc(2 * var(--spacing-unit));
    font-size: 14px;
}

.nav-link {
    padding: var(--spacing-unit) calc(2 * var(--spacing-unit));
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-text-main);
}

.nav-earned {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0 var(--spacing-unit);
}

.nav-earned-label {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-earned-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-success);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background-color: var(--color-border);
}

.nav-user {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.nav-user-name {
    font-size: 14px;
    font-weight: 500;
}

.nav-user-id {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.nav-link-quiet {
    color: var(--color-text-secondary);
}

/* Main & Footer */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: calc(4 * var(--spacing-unit));
    padding-bottom: calc(4 * var(--spacing-unit));
}

.app-footer {
    padding-top: calc(2 * var(--spacing-unit));
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    color: var(--color-text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Card */
.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: calc(4 * var(--spacing-unit));
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(3 * var(--spacing-unit));
}

.card-actions {
    display: flex;
    gap: var(--spacing-unit);
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Typography */
.page-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 var(--spacing-unit);
}

.summary-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin: 0 0 var(--spacing-unit);
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text-main);
}

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

/* Summary grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: calc(2 * var(--spacing-unit));
}

.summary-card {
    padding: calc(3 * var(--spacing-unit));
    border-radius: var(--radius-lg);
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    padding: var(--spacing-unit) calc(2 * var(--spacing-unit));
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-main);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text-main);
}

.btn-secondary:hover {
    background-color: #334155;
    border-color: #475569;
}

.btn-ghost {
    background-color: transparent;
    border-color: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    color: var(--color-text-main);
    background-color: rgba(59, 130, 246, 0.1);
}

.btn-warning {
    background-color: #f59e0b;
    color: var(--color-text-main);
}

.btn-warning:hover {
    background-color: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-danger {
    background-color: var(--color-danger);
    color: var(--color-text-main);
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-success {
    background-color: var(--color-success);
    color: var(--color-text-main);
}

.btn-success:hover {
    background-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-full {
    width: 100%;
}

/* Auth */
.auth-layout {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card {
    max-width: 400px;
    width: 100%;
    padding: calc(5 * var(--spacing-unit));
}

.auth-header {
    text-align: center;
    margin-bottom: calc(4 * var(--spacing-unit));
}

.auth-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: var(--spacing-unit);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: var(--spacing-unit) 0 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: calc(2 * var(--spacing-unit));
}

/* Fields */
.field-group {
    margin-bottom: var(--spacing-unit);
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--color-text-secondary);
}

.field-input {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 10px 12px;
    font-size: 16px;
    outline: none;
    background-color: var(--color-background);
    color: var(--color-text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    background-color: var(--color-surface);
}

/* Flash Messages */
.flash-container {
    margin-bottom: calc(3 * var(--spacing-unit));
    /* The container class in base.html will handle the width */
}

.flash {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    padding: calc(2 * var(--spacing-unit)) calc(3 * var(--spacing-unit)); /* Increased padding for better look */
    border-radius: var(--radius-lg); /* Larger radius for card look */
    font-size: 14px;
    border: 1px solid;
    background-color: var(--color-surface); /* Background for better contrast */
    box-shadow: var(--shadow-md);
}

.flash-success {
    border-color: var(--color-success);
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.flash-error {
    border-color: var(--color-danger);
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.flash-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Month list */
.month-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.month-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(1.5 * var(--spacing-unit)) calc(2 * var(--spacing-unit));
    border-radius: var(--radius-md);
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    transition: background-color 0.2s ease;
}

.month-row:hover {
    background-color: #1f2937;
}

.month-label {
    font-size: 16px;
    font-weight: 500;
}

.month-links {
    display: flex;
    gap: var(--spacing-unit);
}

.chip-link {

/* News Page Styles */
.news-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(4 * var(--spacing-unit));
    /* The news-page-header is already styled as a card, no change needed here */
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: calc(2 * var(--spacing-unit)); /* Spacing between news items */
}

.news-row {
    /* Fixed width is achieved by making the news-row take the full width of its parent (.news-list),
       which in turn takes the full width of the .container.
       The header block (.news-page-header) and flash messages now also use the .container width,
       ensuring all main content blocks have the same width. */
    display: block; /* Important for the anchor tag to take full width */
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: calc(3 * var(--spacing-unit)); /* Improved padding for aesthetics */
    transition: all 0.2s ease;
    color: var(--color-text-main); /* Ensure text color is visible */
}

.news-row:hover {
    background-color: #2c3e50; /* Slightly darker on hover */
    border-color: var(--color-primary); /* Highlight border on hover */
    box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-lg);
    text-decoration: none;
}

.news-row-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-unit);
}

.news-row-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--color-primary); /* Highlight title */
}

.news-row-date {
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap; /* Keep date on one line */
}

.news-row-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0 0 calc(2 * var(--spacing-unit));
    /* Optional: Limit lines for description */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-row-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-secondary);
    padding-top: var(--spacing-unit);
    border-top: 1px solid var(--color-border);
}

.admin-actions {
    display: flex;
    gap: var(--spacing-unit);
}

.admin-actions .btn-ghost {
    padding: 4px 8px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}

.admin-actions .text-danger {
    color: var(--color-danger);
}

.admin-actions .text-danger:hover {
    color: var(--color-text-main);
    background-color: var(--color-danger);
}

.empty-state {
    text-align: center;
    padding: calc(5 * var(--spacing-unit));
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    margin-top: calc(4 * var(--spacing-unit));
}

.empty-state .text-muted {
    font-size: 16px;
}


    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

.chip-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.chip-link-muted {
    color: var(--color-text-secondary);
}

/* Form Elements - General */
.form-group {
    margin-bottom: calc(3 * var(--spacing-unit));
}

.form-control {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 10px 12px;
    font-size: 16px;
    outline: none;
    background-color: var(--color-background);
    color: var(--color-text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical; /* Allow textarea to be resized vertically */
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    background-color: var(--color-surface);
}

.form-inline {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-unit);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 calc(2 * var(--spacing-unit));
}

/* News Card Specific Styles */
.card {
    /* Existing card styles */
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: calc(4 * var(--spacing-unit));
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-unit);
}

.card-subtitle {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.card-text {
    font-size: 16px;
    margin-bottom: calc(2 * var(--spacing-unit));
}

/* Tables */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: calc(2 * var(--spacing-unit));
}

.data-table {
    width: 100%;
    border-collapse: separate; /* Use separate for rounded corners */
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.data-table thead {
    background-color: var(--color-primary);
    color: var(--color-text-main);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--color-background);
}

.data-table tbody tr:nth-child(even) {
    background-color: #111827; /* Slightly darker row for zebra striping */
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: #2d3748;
}

/* Table Totals/Notes */
.total-badge {
    margin-top: calc(3 * var(--spacing-unit));
    display: inline-flex;
    align-items: baseline;
    gap: var(--spacing-unit);
    padding: var(--spacing-unit) calc(2 * var(--spacing-unit));
    border-radius: var(--radius-pill);
    background-color: rgba(16, 185, 129, 0.15); /* Success color for totals */
    color: var(--color-success);
    font-size: 14px;
    font-weight: 600;
}

.note-block {
    margin-top: calc(3 * var(--spacing-unit));
    padding: calc(2 * var(--spacing-unit));
    border-radius: var(--radius-md);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
}

.note-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--color-text-main);
}

.note-text {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: calc(2 * var(--spacing-unit));
    }

    .app-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-unit);
    }

    .nav-earned {
        align-items: flex-start;
    }

    .nav-divider {
        display: none;
    }

    .nav-user {
        align-items: flex-start;
    }

    .card {
        padding: calc(3 * var(--spacing-unit));
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Стили для страницы Новостей (news.html) --- */

.page-header {
    margin-bottom: calc(4 * var(--spacing-unit));
}

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 0;
}

.news-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: calc(3 * var(--spacing-unit));
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: calc(2 * var(--spacing-unit));
    padding-bottom: calc(1 * var(--spacing-unit));
    border-bottom: 1px solid var(--color-border);
}

.news-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--color-primary);
    margin: 0;
    line-height: 1.4;
}

.news-id {
    font-size: 0.8em;
    color: var(--color-text-secondary);
    background-color: var(--color-background);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    margin-left: 10px;
    flex-shrink: 0;
}

.news-short-description {
    color: var(--color-text-main);
    margin-bottom: calc(2 * var(--spacing-unit));
    font-size: 0.95em;
    flex-grow: 1;
}

.news-full-description {
    margin-top: auto; /* Прижимает к низу */
    padding-top: calc(2 * var(--spacing-unit));
    border-top: 1px dashed var(--color-border);
}

.news-full-description p {
    margin: 0;
    font-size: 0.9em;
    color: var(--color-text-secondary);
    white-space: pre-wrap; /* Сохраняет переносы строк из Google Sheets */
}

.news-list > .text-muted {
    text-align: center;
    width: 100%;
    grid-column: 1 / -1;
    padding: 40px;
    font-size: 1.2em;
}


/* --- Updated News Page Styles --- */

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(4 * var(--spacing-unit));
    gap: calc(2 * var(--spacing-unit));
}

.news-header .page-title {
    margin: 0;
    flex-grow: 1;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: calc(3 * var(--spacing-unit));
    padding: 0;
}

.news-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: calc(3 * var(--spacing-unit));
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-unit);
    margin-bottom: calc(2 * var(--spacing-unit));
    padding-bottom: calc(2 * var(--spacing-unit));
    border-bottom: 1px solid var(--color-border);
}

.news-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-main);
    margin: 0;
    line-height: 1.3;
    flex-grow: 1;
    word-break: break-word;
}

.news-card-date {
    font-size: 12px;
    color: var(--color-text-secondary);
    background-color: rgba(59, 130, 246, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.news-card-description {
    color: var(--color-text-main);
    margin: 0 0 calc(2 * var(--spacing-unit)) 0;
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-footer {
    display: flex;
    gap: var(--spacing-unit);
    align-items: center;
    margin-top: auto;
    padding-top: calc(2 * var(--spacing-unit));
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.news-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(4 * var(--spacing-unit));
    gap: calc(2 * var(--spacing-unit));
    padding: calc(3 * var(--spacing-unit));
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.news-page-header .page-title {
    margin: 0;
    flex-grow: 1;
    font-size: 28px;
    font-weight: 700;
}

.news-card-content {
    padding: calc(3 * var(--spacing-unit));
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card-actions {
    display: flex;
    gap: var(--spacing-unit);
    align-items: center;
    padding: calc(2 * var(--spacing-unit)) calc(3 * var(--spacing-unit));
    border-top: 1px solid var(--color-border);
    background-color: rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: calc(8 * var(--spacing-unit));
    color: var(--color-text-secondary);
}

@media (max-width: 768px) {
    .news-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .news-header .btn {
        width: 100%;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-card-actions {
        margin-left: 0;
        width: 100%;
    }
}


/* --- Salary Accordion Styles (Variant 3) --- */

.salary-accordion {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--color-surface);
    box-shadow: var(--shadow-md);
}

.salary-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(3 * var(--spacing-unit)) calc(4 * var(--spacing-unit));
    cursor: pointer;
    list-style: none; /* Убираем стандартный маркер */
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.salary-summary::-webkit-details-marker {
    display: none;
}

.salary-summary:hover {
    background-color: #1f2937; /* Немного светлее для ховера */
}

.salary-summary .summary-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-main);
}

.salary-summary .summary-value {
    font-size: 32px;
    font-weight: 700;
}

.salary-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Две колонки для Начислений и Удержаний */
    gap: 1px; /* Минимальный зазор между элементами */
    background-color: var(--color-border); /* Цвет для разделения элементов */
    padding: 1px;
}

.salary-details-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(1.5 * var(--spacing-unit)) calc(2 * var(--spacing-unit));
    background-color: var(--color-background); /* Более темный фон для контраста */
}

.details-label {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.details-value {
    font-size: 16px;
    font-weight: 600;
}

/* Стили для цвета текста, используемые в salary.html */
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }


/* --- News List Styles (New Row Design) --- */

.news-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit); /* Отступ между строками */
}

.news-row {
    display: block;
    padding: calc(2 * var(--spacing-unit));
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    color: var(--color-text-main); /* Унаследовать цвет текста */
}

.news-row:hover {
    background-color: #1f2937; /* Немного светлее для ховера */
    border-color: var(--color-primary);
    text-decoration: none;
}

.news-row-content {
    display: flex;
    flex-direction: column;
}

.news-row-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-unit);
}

.news-row-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    /* Ограничение заголовка, если он слишком длинный */
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    margin-right: calc(2 * var(--spacing-unit));
}

.news-row-date {
    font-size: 12px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
    white-space: nowrap;
}

.news-row-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0 0 var(--spacing-unit) 0;
    line-height: 1.5;
    /* Ограничение описания до 2 строк */
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-row-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-secondary);
    padding-top: var(--spacing-unit);
    border-top: 1px solid var(--color-border);
}

.admin-actions {
    display: flex;
    gap: var(--spacing-unit);
}

.admin-actions .btn-ghost {
    font-size: 12px;
    padding: 4px 8px;
    text-transform: none;
    letter-spacing: normal;
}

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