* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f6fb;
    color: #1f2937;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: #111827;
    color: #fff;
    padding: 24px 18px;
}

.logo {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 36px;
}

.logo-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
}

.logo-subtitle {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 3px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-link {
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
}

.menu-link:hover,
.menu-link.active {
    background: #1f2937;
    color: #fff;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 82px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
}

.page-subtitle {
    color: #6b7280;
    margin-top: 4px;
    font-size: 14px;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logout-btn {
    border: none;
    background: #ef4444;
    color: #fff;
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
}

.content {
    padding: 28px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.card p {
    margin-bottom: 0;
    color: #6b7280;
    line-height: 1.5;
}

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #111827, #1e3a8a);
}

.login-card {
    width: 100%;
    max-width: 390px;
    background: #fff;
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.login-logo {
    width: 58px;
    height: 58px;
    background: #2563eb;
    color: #fff;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 20px;
}

.login-card h1 {
    margin: 0;
}

.login-card p {
    color: #6b7280;
    margin-bottom: 24px;
}

.login-card label {
    display: block;
    margin: 14px 0 6px;
    font-size: 14px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
}

.login-card button {
    width: 100%;
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 13px;
    border-radius: 12px;
    margin-top: 22px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.error-box {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.section-header {
    margin-bottom: 22px;
}

.section-header h1 {
    margin: 0 0 6px;
    font-size: 26px;
}

.section-header p {
    margin: 0;
    color: #6b7280;
}

.table-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
}

.data-table th {
    color: #6b7280;
    font-weight: 700;
    background: #f9fafb;
}

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

.profile-link {
    color: #1f2937;
    font-weight: 700;
    text-decoration: none;
}

.profile-link:hover {
    color: #2563eb;
}

.profile-card {
    background: #fff;
    border-radius: 22px;
    padding: 28px;
    max-width: 680px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info h1 {
    margin: 0 0 20px;
}

.profile-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.profile-row span {
    color: #6b7280;
}

@media (max-width: 600px) {
    .profile-card {
        flex-direction: column;
    }

    .profile-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.finance-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.period-select-form {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.form-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 15px;
    background: #fff;
}

.primary-btn {
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.primary-btn:hover {
    background: #1d4ed8;
}

.full-width {
    width: 100%;
    margin-top: 16px;
}

.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.summary-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.summary-card span {
    display: block;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
}

.summary-card strong {
    font-size: 22px;
}

.finance-forms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
}

.form-card {
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.form-card h2 {
    margin-top: 0;
    margin-bottom: 16px;
}

.form-card label {
    display: block;
    margin: 12px 0 6px;
    font-size: 14px;
    font-weight: 700;
}

.content-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
}

.table-header {
    margin-bottom: 14px;
}

.table-header h2 {
    margin: 0;
    font-size: 20px;
}

.table-subtext {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-success {
    background: #dcfce7;
    color: #166534;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-muted {
    background: #f3f4f6;
    color: #6b7280;
}

.finance-history-card {
    margin-bottom: 28px;
}

.messages {
    margin-bottom: 18px;
}

.message-box {
    background: #dcfce7;
    color: #166534;
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 8px;
}

@media (max-width: 1100px) {
    .finance-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-forms-grid,
    .content-grid-two {
        grid-template-columns: 1fr;
    }

    .finance-header {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .finance-summary-grid {
        grid-template-columns: 1fr;
    }

    .period-select-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
}

.danger-btn {
    border: none;
    background: #ef4444;
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.danger-btn:hover {
    background: #dc2626;
}

.data-table form {
    margin: 0;
}

.task-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

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

.secondary-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1f2937;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.secondary-btn:hover {
    background: #f9fafb;
}

.filters-card {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    background: #fff;
    padding: 16px;
    border-radius: 18px;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.task-form-card {
    margin-bottom: 22px;
}

.form-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.task-card {
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    text-decoration: none;
    color: #1f2937;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}

.task-card-top {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.task-card h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.task-card p {
    color: #6b7280;
    line-height: 1.5;
}

.task-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.task-meta span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 4px;
}

.task-meta strong {
    font-size: 14px;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
}

.muted-text {
    color: #6b7280;
}

.danger-text {
    color: #dc2626;
}

.empty-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    color: #6b7280;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.task-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
}

.task-detail-main {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.task-detail-side {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.comments-card h2 {
    margin-top: 0;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-item {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    background: #f9fafb;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 14px;
}

.comment-meta strong {
    color: #1f2937;
}

.comment-text {
    line-height: 1.5;
}

@media (max-width: 1200px) {
    .tasks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .task-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .filters-card {
        grid-template-columns: 1fr;
    }

    .form-grid-two {
        grid-template-columns: 1fr;
    }

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

    .task-meta {
        grid-template-columns: 1fr;
    }
}

.knowledge-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.search-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    background: #fff;
    padding: 16px;
    border-radius: 18px;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.knowledge-layout {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 22px;
}

.knowledge-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.knowledge-main {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-link {
    display: block;
    padding: 14px;
    border-radius: 14px;
    background: #f9fafb;
    text-decoration: none;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.category-link:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.category-link strong {
    display: block;
    margin-bottom: 4px;
}

.category-link span {
    display: block;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 15px;
    border-radius: 14px;
    background: #f9fafb;
    text-decoration: none;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.article-row:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.article-row strong {
    display: block;
    margin-bottom: 5px;
}

.article-row span {
    color: #6b7280;
    font-size: 14px;
}

.article-row small {
    color: #6b7280;
    white-space: nowrap;
}

.knowledge-form-card {
    margin-bottom: 28px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 14px !important;
}

.checkbox-input {
    width: 18px;
    height: 18px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.article-content-card {
    font-size: 16px;
    line-height: 1.7;
}

.article-content {
    white-space: normal;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-link {
    display: block;
    padding: 13px;
    border-radius: 14px;
    background: #f9fafb;
    text-decoration: none;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.file-link:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.file-link strong {
    display: block;
    margin-bottom: 4px;
}

.file-link span {
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 1200px) {
    .knowledge-layout {
        grid-template-columns: 1fr;
    }

    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .search-card {
        grid-template-columns: 1fr;
    }

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

    .article-row {
        flex-direction: column;
    }
}

.calendar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.calendar-select-form {
    margin-bottom: 22px;
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
}

.calendar-main {
    min-width: 0;
}

.calendar-side {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.calendar-weekday {
    background: #111827;
    color: #fff;
    padding: 13px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
}

.calendar-day {
    min-height: 128px;
    padding: 10px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.calendar-day-muted {
    background: #f9fafb;
    color: #9ca3af;
}

.calendar-day-today {
    background: #eff6ff;
}

.calendar-day-number {
    font-weight: 700;
    margin-bottom: 8px;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.calendar-event {
    display: block;
    padding: 6px 7px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.3;
    text-decoration: none;
    font-weight: 700;
}

.calendar-event:hover {
    opacity: 0.85;
}

.calendar-event-info {
    background: #dbeafe;
    color: #1e40af;
}

.calendar-event-success {
    background: #dcfce7;
    color: #166534;
}

.calendar-event-warning {
    background: #fef3c7;
    color: #92400e;
}

.calendar-event-danger {
    background: #fee2e2;
    color: #991b1b;
}

.calendar-event-muted {
    background: #f3f4f6;
    color: #4b5563;
}

.calendar-event-important {
    border: 2px solid currentColor;
}

.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upcoming-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 13px;
    border-radius: 14px;
    background: #f9fafb;
    text-decoration: none;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.upcoming-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.upcoming-item strong {
    display: block;
    margin-bottom: 5px;
}

.upcoming-item span {
    font-size: 13px;
}

.participants-select {
    min-height: 120px;
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participant-item {
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

@media (max-width: 1200px) {
    .calendar-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .calendar-header {
        flex-direction: column;
    }

    .calendar-grid {
        display: block;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    .calendar-weekday {
        display: none;
    }

    .calendar-day {
        min-height: auto;
        margin-bottom: 10px;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    }

    .calendar-day-muted {
        display: none;
    }

    .upcoming-item {
        flex-direction: column;
    }
}


.chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.chat-layout {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 22px;
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.chat-main {
    min-width: 0;
}

.chat-room-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-room-link {
    display: block;
    padding: 14px;
    border-radius: 14px;
    background: #f9fafb;
    text-decoration: none;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.chat-room-link:hover,
.chat-room-link-active {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.chat-room-link strong {
    display: block;
    margin-bottom: 4px;
}

.chat-room-link span {
    color: #6b7280;
    font-size: 14px;
}

.chat-box {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.chat-messages {
    min-height: 520px;
    max-height: 620px;
    overflow-y: auto;
    padding: 22px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-message {
    max-width: 74%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 13px 15px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.chat-message-own {
    align-self: flex-end;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.chat-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6b7280;
}

.chat-message-meta strong {
    color: #1f2937;
}

.chat-message-text {
    line-height: 1.5;
    font-size: 15px;
}

.chat-file-link {
    display: inline-block;
    margin-top: 10px;
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.chat-file-link:hover {
    text-decoration: underline;
}

.chat-send-form {
    padding: 18px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.chat-message-input {
    resize: vertical;
}

.chat-send-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.chat-send-actions .form-input {
    flex: 1;
}

@media (max-width: 1100px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-messages {
        min-height: 420px;
    }
}

@media (max-width: 700px) {
    .chat-header {
        flex-direction: column;
    }

    .chat-message {
        max-width: 100%;
    }

    .chat-send-actions {
        flex-direction: column;
        align-items: stretch;
    }
}


.dashboard-welcome {
    background: linear-gradient(135deg, #111827, #1e3a8a);
    color: #fff;
    border-radius: 22px;
    padding: 28px;
    margin-bottom: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.dashboard-welcome h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.dashboard-welcome p {
    margin: 0;
    color: #dbeafe;
    line-height: 1.6;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.dashboard-link-card {
    text-decoration: none;
    color: #1f2937;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}

.summary-card small {
    display: block;
    color: #6b7280;
    margin-top: 6px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.dashboard-card-header h2 {
    margin: 0 0 5px;
}

.dashboard-card-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.small-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.small-link:hover {
    text-decoration: underline;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-list-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    text-decoration: none;
}

.dashboard-list-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.dashboard-list-item strong {
    display: block;
    margin-bottom: 5px;
}

.dashboard-list-item span {
    color: #6b7280;
    font-size: 14px;
}

.finance-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.finance-mini-grid div {
    background: #f9fafb;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
}

.finance-mini-grid span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.finance-mini-grid strong {
    font-size: 18px;
}

.dashboard-message-item {
    display: block;
    padding: 14px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    text-decoration: none;
}

.dashboard-message-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.dashboard-message-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.dashboard-message-top span {
    color: #6b7280;
    font-size: 13px;
}

.dashboard-message-text {
    color: #374151;
    line-height: 1.5;
    margin-bottom: 5px;
}

.dashboard-message-item small {
    color: #6b7280;
}

.dashboard-knowledge-card {
    margin-bottom: 28px;
}

.dashboard-knowledge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.dashboard-knowledge-grid h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

@media (max-width: 1200px) {
    .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .dashboard-knowledge-grid {
        grid-template-columns: 1fr;
    }

    .finance-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .dashboard-summary-grid,
    .finance-mini-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card-header {
        flex-direction: column;
    }

    .dashboard-list-item {
        flex-direction: column;
    }

    .dashboard-message-top {
        flex-direction: column;
    }
}

.mobile-menu-toggle {
    display: none;
}

.mobile-menu-head {
    display: none;
}

.hamburger-btn {
    display: none;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dashboard-welcome-mobile {
    display: none;
}

.dashboard-mobile-flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.dashboard-block {
    min-width: 0;
}

.dashboard-block-tasks,
.dashboard-block-knowledge {
    grid-column: span 2;
}

.mobile-priority-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-priority-summary div {
    background: #f9fafb;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
}

.mobile-priority-summary span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 7px;
}

.mobile-priority-summary strong {
    font-size: 24px;
}

@media (max-width: 800px) {
    body {
        background: #f3f6fb;
    }

    .app {
        display: block;
        min-height: 100vh;
    }

    .main {
        width: 100%;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 900;
        min-height: 64px;
        height: auto;
        padding: 10px 12px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    }

    .topbar-left {
        min-width: 0;
        flex: 1;
    }

    .page-title {
        font-size: 19px;
        line-height: 1.2;
    }

    .page-subtitle {
        display: none;
    }

    .hamburger-btn {
        width: 44px;
        height: 44px;
        border-radius: 14px;
        background: #111827;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        flex-shrink: 0;
        cursor: pointer;
    }

    .hamburger-btn span {
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 99px;
        display: block;
    }

    .user-box {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .profile-link {
        max-width: 88px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
    }

    .logout-btn {
        padding: 9px 11px;
        border-radius: 12px;
        font-size: 13px;
    }

    .sidebar {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 76px;
        z-index: 1000;
        width: auto;
        max-height: calc(100vh - 92px);
        overflow-y: auto;
        border-radius: 20px;
        padding: 16px;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
        transition: opacity 0.18s ease, transform 0.18s ease;
    }

    .mobile-menu-toggle:checked ~ .app .sidebar {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .mobile-menu-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #fff;
        margin-bottom: 14px;
    }

    .mobile-menu-close {
        background: #374151;
        color: #fff;
        padding: 8px 12px;
        border-radius: 12px;
        font-size: 14px;
        cursor: pointer;
    }

    .sidebar .logo {
        margin-bottom: 18px;
    }

    .menu {
        flex-direction: column;
        gap: 10px;
    }

    .menu-link {
        display: block;
        font-size: 18px;
        padding: 16px;
        border-radius: 16px;
        background: #1f2937;
    }

    .content {
        padding: 14px;
    }

    .dashboard-welcome {
        border-radius: 18px;
        padding: 18px;
        margin-bottom: 16px;
    }

    .dashboard-welcome-full {
        display: none;
    }

    .dashboard-welcome-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
    }

    .dashboard-welcome-mobile span {
        color: #dbeafe;
        font-size: 15px;
    }

    .dashboard-welcome-mobile strong {
        font-size: 22px;
    }

    .dashboard-summary-grid,
    .dashboard-grid,
    .dashboard-knowledge-grid {
        display: block;
    }

    .dashboard-mobile-flow {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .dashboard-block {
        width: 100%;
    }

    .dashboard-block-tasks {
        order: 1;
    }

    .dashboard-block-chat {
        order: 2;
    }

    .dashboard-block-events {
        order: 3;
    }

    .dashboard-block-finance {
        order: 4;
    }

    .dashboard-block-knowledge {
        order: 5;
    }

    .dashboard-block-employees {
        order: 6;
    }

    .table-card,
    .card,
    .form-card,
    .summary-card {
        border-radius: 18px;
        padding: 16px;
    }

    .dashboard-card-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 14px;
    }

    .dashboard-card-header h2 {
        font-size: 21px;
    }

    .dashboard-card-header p {
        font-size: 14px;
        line-height: 1.35;
    }

    .small-link {
        background: #eff6ff;
        color: #1d4ed8;
        padding: 8px 11px;
        border-radius: 11px;
        text-decoration: none;
        font-size: 13px;
    }

    .dashboard-list {
        gap: 10px;
    }

    .dashboard-list-item,
    .dashboard-message-item {
        padding: 14px;
        border-radius: 16px;
    }

    .dashboard-list-item {
        flex-direction: column;
        gap: 10px;
    }

    .dashboard-list-item strong,
    .dashboard-message-top strong {
        font-size: 16px;
    }

    .dashboard-list-item span,
    .dashboard-message-text,
    .dashboard-message-item small {
        font-size: 14px;
    }

    .status-badge {
        font-size: 13px;
        padding: 7px 10px;
    }

    .finance-mini-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .finance-mini-grid div {
        padding: 13px;
        border-radius: 14px;
    }

    .finance-mini-grid strong {
        font-size: 18px;
    }

    .dashboard-knowledge-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

@media (max-width: 430px) {
    .profile-link {
        max-width: 68px;
    }

    .logout-btn {
        padding: 8px 9px;
        font-size: 12px;
    }

    .page-title {
        font-size: 18px;
    }

    .hamburger-btn {
        width: 42px;
        height: 42px;
    }

    .finance-mini-grid,
    .mobile-priority-summary {
        grid-template-columns: 1fr;
    }

    .dashboard-card-header {
        flex-direction: column;
    }

    .small-link {
        align-self: flex-start;
    }
}

.chat-send-form button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.chat-message-input:focus {
    outline: none;
    border-color: #2563eb;
}

.chat-messages {
    scroll-behavior: smooth;
}

.chat-file-link {
    word-break: break-word;
}


.chat-layout {
    grid-template-areas:
        "sidebar main"
        "create main";
    align-items: start;
}

.chat-sidebar {
    grid-area: sidebar;
}

.chat-main {
    grid-area: main;
}

.chat-create-room-panel {
    grid-area: create;
}

.chat-room-link-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.chat-room-type {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-top: 4px;
}

.chat-room-preview {
    margin-top: 8px;
    color: #374151;
    font-size: 14px;
    line-height: 1.35;
}

.chat-room-time {
    margin-top: 8px;
    color: #9ca3af;
    font-size: 12px;
}

.chat-unread-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-room-link-active .chat-room-preview,
.chat-room-link-active .chat-room-time,
.chat-room-link-active .chat-room-type {
    color: #1e40af;
}

@media (max-width: 1100px) {
    .chat-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "sidebar"
            "main"
            "create";
    }

    .chat-create-room-panel {
        width: 100%;
    }
}
