/* ── reset & base ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #080b14;
    font-family: 'Inter', sans-serif;
    color: #f1f5f9;
    min-height: 100vh;
    display: flex;
}

/* Единая основная кнопка для самостоятельных страниц и панелей инструментов. */
.crm-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 22px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 10px;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 5px 18px rgba(37, 99, 235, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.crm-primary-button:hover {
    background: linear-gradient(145deg, #60a5fa, #2563eb);
    box-shadow: 0 7px 22px rgba(37, 99, 235, 0.34);
    transform: translateY(-1px);
}

.crm-primary-button:active {
    transform: translateY(0);
}

.crm-primary-button:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.4);
    outline-offset: 2px;
}

.crm-primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
    width: 270px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0b1222, #070b14);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .logo {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    display: block;
    flex-shrink: 0;
    width: 100%;
}

.sidebar .logo a {
    display: block;
}

.sidebar .logo img {
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    padding: 0 18px;
    margin-top: 0;
    padding-top: 0;
}

.nav-menu .nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 14px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    position: relative;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.nav-menu .nav-item:hover {
    background: rgba(59, 130, 246, 0.12);
    color: #f0f4ff;
    transform: translateX(4px);
}

.nav-menu .nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.05));
    color: #60a5fa;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.nav-menu .nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    border-radius: 2px;
}

.nav-menu .nav-item:hover::after {
    transform: scaleX(1);
}

.nav-menu .nav-item.active::after {
    transform: scaleX(0);
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 6px 12px 6px;
}

.sidebar-user {
    margin-top: auto;
    padding: 16px 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user .info .name {
    font-weight: 600;
    font-size: 13px;
    color: #e8edf5;
}

.sidebar-user .info .role {
    font-size: 12px;
    color: #94a3b8;
}

/* ═══ MAIN CONTENT ═══ */
.main {
    flex: 1;
    padding: 24px 32px 28px;
    max-width: calc(100% - 270px);
    background: radial-gradient(ellipse at 20% 0%, #0f1a2e, #060a14 75%);
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 12px;
}

.header .search {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 16px;
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 14px;
    width: 220px;
    outline: none;
    transition: 0.2s;
    flex-shrink: 0;
}

.header .search:focus {
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.9);
}

.header .search::placeholder {
    color: #64748b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 18px;
    color: #94a3b8;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
}

.profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 14px 4px 4px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.profile-badge .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.profile-badge .info {
    line-height: 1.2;
}

.profile-badge .info .name {
    font-size: 13px;
    font-weight: 600;
}

.profile-badge .info .role {
    font-size: 11px;
    color: #94a3b8;
}

.dash-title {
    margin: 18px 0 20px;
}

.dash-title h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.dash-title p {
    color: #94a3b8;
    font-size: 14px;
    margin-top: 2px;
}

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

.card {
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 18px 20px 16px;
    transition: 0.2s;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(17, 24, 39, 0.8);
}

.card .top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card .top .icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.card .top .icon.blue {
    background: rgba(59, 130, 246, 0.18);
}
.card .top .icon.green {
    background: rgba(34, 197, 94, 0.18);
}
.card .top .icon.orange {
    background: rgba(245, 158, 11, 0.18);
}
.card .top .icon.purple {
    background: rgba(139, 92, 246, 0.18);
}

.card .top h4 {
    font-weight: 500;
    font-size: 14px;
    color: #cbd5e1;
    margin: 0;
}

.card .value {
    font-size: 32px;
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: -0.5px;
}

.card .change {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.card .change.up {
    color: #4ade80;
}
.card .change.down {
    color: #f87171;
}

.card .change .label {
    color: #94a3b8;
    font-weight: 400;
}

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

.block {
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 14px 18px 12px;
    display: flex;
    flex-direction: column;
}

.block h4 {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
    color: #e2e8f0;
    flex-shrink: 0;
}

.block-chart {
    padding-bottom: 12px;
}

.chart-container {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
    flex: 1;
}

.chart-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    line-height: 1.2;
}

.chart-center-text .number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #f1f5f9;
}

.chart-center-text .label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    flex: 1;
}

.chart-legend .item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    justify-content: space-between;
    padding: 2px 0;
}

.chart-legend .item .dot {
    width: 10px;
    height: 10px;
    border-radius: 4px;
    flex-shrink: 0;
}

.chart-legend .item .label-text {
    flex: 1;
}

.chart-legend .item .pct {
    color: #94a3b8;
    font-size: 11px;
}

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

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #e2e8f0;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.task-item .date {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 12px;
}

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

.notif-item {
    font-size: 13px;
    color: #e2e8f0;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    line-height: 1.4;
}

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

.notif-item .time {
    color: #94a3b8;
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

/* ── общий стиль для кнопок-ссылок внизу блоков ── */
.block-footer {
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
}

.block-footer .link {
    color: #60a5fa;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.block-footer .link:hover {
    color: #93bbfc;
}

/* ── table ── */
.table-wrap {
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 14px 18px 12px;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
}

.table-wrap .head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.table-wrap .head-row h4 {
    font-weight: 600;
    font-size: 15px;
    color: #e2e8f0;
}

/* прижимаем кнопку к низу */
.table-wrap .block-footer {
    margin-top: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead th {
    text-align: left;
    padding: 6px 6px 4px 6px;
    color: #94a3b8;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tbody td {
    padding: 6px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    font-size: 12px;
}

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

.status-badge {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 40px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.work {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}
.status-badge.new {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}
.status-badge.done {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}
.status-badge.approval {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}
.status-badge.cancelled {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

/* ── calendar events ── */
.calendar-wrap {
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 14px 18px 12px;
    display: flex;
    flex-direction: column;
}

.calendar-wrap .head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-wrap .head-row h4 {
    font-weight: 600;
    font-size: 15px;
    color: #e2e8f0;
}

/* прижимаем кнопку к низу */
.calendar-wrap .block-footer {
    margin-top: auto;
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.event-item {
    font-size: 13px;
    color: #e2e8f0;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.event-item .time {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
}

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

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    flex-wrap: wrap;
    gap: 10px;
}

.footer-row .user-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-row .user-block .avatar-lg {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.footer-row .user-block .name {
    font-weight: 600;
    font-size: 15px;
}

.footer-row .user-block .role {
    font-size: 13px;
    color: #94a3b8;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    .grid-3 .block:last-child {
        grid-column: 1 / -1;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .chart-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .chart-wrapper {
        width: 120px;
        height: 120px;
    }
    .chart-legend {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 72px;
        padding: 0;
    }
    .sidebar .logo {
        display: flex;
        justify-content: center;
        padding: 0 !important;
        margin: 0 !important;
    }
    .sidebar .logo img {
        width: 40px;
        height: 40px;
        object-fit: contain;
        border-radius: 0;
    }
    .nav-menu {
        padding: 0 10px;
    }
    .nav-menu .nav-item {
        justify-content: center;
        padding: 12px;
        font-size: 0;
    }
    .nav-menu .nav-item .label {
        display: none;
    }
    .sidebar-user {
        padding: 16px 10px 0;
        justify-content: center;
    }
    .sidebar-user .info {
        display: none;
    }
    .main {
        max-width: calc(100% - 72px);
        padding: 16px 18px;
    }
    .cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 0;
    }
    .sidebar .logo img {
        width: 34px;
        height: 34px;
    }
    .nav-menu {
        padding: 0 6px;
    }
    .nav-menu .nav-item {
        padding: 10px;
    }
    .sidebar-user {
        padding: 16px 6px 0;
    }
    .main {
        max-width: calc(100% - 60px);
        padding: 12px 14px;
    }
    .cards {
        grid-template-columns: 1fr 1fr;
    }
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .grid-3 .block:last-child {
        grid-column: 1;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .header .search {
        width: 100%;
    }
    .header-right {
        justify-content: flex-end;
    }
    .dash-title h2 {
        font-size: 20px;
    }
    .footer-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .chart-wrapper {
        width: 100px;
        height: 100px;
    }
    .chart-center-text .number {
        font-size: 22px;
    }
    .chart-legend .item {
        font-size: 11px;
    }
    .sidebar {
        width: 52px;
        padding: 0;
    }
    .sidebar .logo img {
        width: 28px;
        height: 28px;
    }
    .nav-menu {
        padding: 0 4px;
    }
    .sidebar-user {
        padding: 16px 4px 0;
    }
    .main {
        max-width: calc(100% - 52px);
        padding: 10px 10px;
    }
}



/* ── СТИЛИ ДЛЯ СТРАНИЦЫ ЗАКАЗОВ ── */

.btn-create-order {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    border: none;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn-create-order:hover {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
    transform: scale(1.02);
}

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 12px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title .title-group h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.4px;
}
.page-title .title-group p {
    color: #94a3b8;
    font-size: 14px;
    margin-top: 2px;
}

.view-switcher {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    background: rgba(15, 23, 42, 0.6);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: fit-content;
}
.view-switcher button {
    background: transparent;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.3s;
}
.view-switcher button.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.view-switcher button:hover {
    color: #e2e8f0;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 14px 20px;
    margin-bottom: 22px;
}
.filters .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filters .filter-group label {
    font-size: 13px;
    color: #94a3b8;
}
.filters .filter-group select,
.filters .filter-group input {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 12px;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 13px;
    outline: none;
    min-width: 100px;
}
.filters .filter-group select:focus,
.filters .filter-group input:focus {
    border-color: #3b82f6;
}
.filters .reset-btn {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    margin-left: auto;
}
.filters .reset-btn:hover {
    background: rgba(248, 113, 113, 0.25);
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    font-size: 13px;
    color: #94a3b8;
}
.pagination .pages {
    display: flex;
    gap: 6px;
    align-items: center;
}
.pagination .pages button {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
}
.pagination .pages button.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.pagination .pages button:hover {
    color: #e2e8f0;
}
.pagination .per-page select {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px 8px;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
}

/* ════════════════════════════════════════════════════════
   КАНБАН-ДОСКА (ГОРИЗОНТАЛЬНАЯ)
   ════════════════════════════════════════════════════════ */

/* Обёртка для Kanban */
.kanban-wrapper {
    display: none;
    overflow-x: auto;
    overflow-y: visible;
    padding: 8px 4px 16px 4px;
    width: 100%;
}

.kanban-wrapper.active {
    display: block;
}

/* Горизонтальный контейнер для колонок — ВАЖНО: display: flex! */
.kanban-board {
    display: flex !important;
    gap: 16px;
    align-items: stretch;
    min-height: 400px;
    width: 100%;
    padding: 4px 0;
    flex-wrap: nowrap;
}

/* Каждая колонка — фиксированная ширина, НЕ растягивается */
.kanban-col {
    flex: 0 0 280px;
    min-width: 260px;
    max-width: 320px;
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    max-height: 600px;
    transition: border-color 0.2s, background 0.2s;
}

/* Заголовок колонки */
.kanban-col h4 {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-shrink: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kanban-col h4 .count {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: #94a3b8;
}

/* Сумма в колонке */
.kanban-col .total-sum {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 10px;
    flex-shrink: 0;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    text-align: right;
}

/* Контейнер для карточек — вертикальный скролл */
.kanban-col .kanban-cards {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Стилизация скролла внутри колонок */
.kanban-col .kanban-cards::-webkit-scrollbar {
    width: 4px;
}

.kanban-col .kanban-cards::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.kanban-col .kanban-cards::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

.kanban-col .kanban-cards::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* При перетаскивании — подсветка колонки */
.kanban-col.drag-over {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* ── КАРТОЧКА ЗАКАЗА ── */

.kanban-card {
    border-radius: 12px;
    padding: 12px 14px;
    transition: all 0.2s ease;
    cursor: grab;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.kanban-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    border-color: rgba(59, 130, 246, 0.4);
}

/* Цвета карточек по статусам */
.kanban-card[data-status="new"],
.kanban-card[data-status="request"] {
    background: rgba(34, 197, 94, 0.10);
    border-color: rgba(34, 197, 94, 0.2);
}

.kanban-card[data-status="work"],
.kanban-card[data-status="technical_proposal"],
.kanban-card[data-status="commercial_proposal"],
.kanban-card[data-status="tender"],
.kanban-card[data-status="production"],
.kanban-card[data-status="sale"],
.kanban-card[data-status="warehouse"] {
    background: rgba(59, 130, 246, 0.10);
    border-color: rgba(59, 130, 246, 0.2);
}

.kanban-card[data-status="approval"],
.kanban-card[data-status="tz_approval"],
.kanban-card[data-status="invoice"] {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.2);
}

.kanban-card[data-status="done"],
.kanban-card[data-status="shipment"],
.kanban-card[data-status="archive"] {
    background: rgba(148, 163, 184, 0.10);
    border-color: rgba(148, 163, 184, 0.2);
}

.kanban-card[data-status="overdue"],
.kanban-card[data-status="rejected"] {
    background: rgba(248, 113, 113, 0.10);
    border-color: rgba(248, 113, 113, 0.2);
}

/* Содержимое карточки */
.kanban-card .order-number {
    font-weight: 600;
    font-size: 14px;
    color: #e2e8f0;
}

.kanban-card .client {
    font-size: 13px;
    color: #cbd5e1;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-card .details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

.kanban-card .details .responsible {
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.kanban-card .details .amount {
    color: #f1f5f9;
    font-weight: 500;
    white-space: nowrap;
}

.kanban-card .card-status-badge {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 40px;
    font-size: 10px;
    font-weight: 500;
    margin-top: 6px;
}

/* Цвета бейджей */
.kanban-card .card-status-badge.new,
.kanban-card .card-status-badge.request {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.kanban-card .card-status-badge.work,
.kanban-card .card-status-badge.technical_proposal,
.kanban-card .card-status-badge.commercial_proposal,
.kanban-card .card-status-badge.tender,
.kanban-card .card-status-badge.production,
.kanban-card .card-status-badge.sale,
.kanban-card .card-status-badge.warehouse {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.kanban-card .card-status-badge.approval,
.kanban-card .card-status-badge.tz_approval,
.kanban-card .card-status-badge.invoice {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.kanban-card .card-status-badge.done,
.kanban-card .card-status-badge.shipment,
.kanban-card .card-status-badge.archive {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.kanban-card .card-status-badge.overdue,
.kanban-card .card-status-badge.rejected {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

/* ── АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ ── */
@media (max-width: 1024px) {
    .main {
        padding: 16px 18px;
    }
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filters .reset-btn {
        margin-left: 0;
    }
    .kanban-col {
        flex: 0 0 240px;
        min-width: 220px;
        max-width: 280px;
    }
}

/* ── АДАПТАЦИЯ ДЛЯ ТЕЛЕФОНОВ ── */
@media (max-width: 768px) {
    .page-title {
        flex-direction: column;
        align-items: stretch;
    }
    .page-title .title-group h2 {
        font-size: 20px;
    }
    .btn-create-order {
        align-self: flex-start;
        font-size: 12px;
        padding: 6px 14px;
    }
    .view-switcher {
        width: 100%;
    }
    .view-switcher button {
        flex: 1;
        text-align: center;
    }

    .kanban-wrapper {
        overflow-x: auto;
        padding: 4px 2px 12px 2px;
    }

    .kanban-board {
        gap: 12px;
        min-height: 300px;
        flex-wrap: nowrap !important;
    }

    .kanban-col {
        flex: 0 0 220px !important;
        min-width: 200px !important;
        max-width: 260px !important;
        padding: 10px 12px !important;
        max-height: 450px;
    }

    .kanban-col h4 {
        font-size: 13px;
    }

    .kanban-col .total-sum {
        font-size: 12px;
    }

    .kanban-card {
        padding: 10px 12px;
    }

    .kanban-card .order-number {
        font-size: 13px;
    }

    .kanban-card .client {
        font-size: 12px;
    }

    .kanban-card .details {
        font-size: 11px;
        flex-wrap: wrap;
        gap: 2px;
    }

    .kanban-card .details .responsible {
        max-width: 80px;
    }
}

/* ── АДАПТАЦИЯ ДЛЯ МАЛЕНЬКИХ ТЕЛЕФОНОВ ── */
@media (max-width: 480px) {
    .table-wrap {
        padding: 10px;
    }
    table {
        font-size: 11px;
    }
    thead th,
    tbody td {
        padding: 6px 4px;
    }

    .kanban-col {
        flex: 0 0 180px !important;
        min-width: 160px !important;
        max-width: 220px !important;
        padding: 8px 10px !important;
        max-height: 350px;
    }

    .kanban-col h4 {
        font-size: 12px;
    }

    .kanban-col .total-sum {
        font-size: 11px;
        padding: 2px 6px;
    }

    .kanban-card {
        padding: 8px 10px;
    }

    .kanban-card .order-number {
        font-size: 12px;
    }

    .kanban-card .client {
        font-size: 11px;
    }

    .kanban-card .details {
        font-size: 10px;
        flex-direction: column;
        gap: 1px;
    }

    .kanban-card .details .responsible {
        max-width: 100%;
    }

    .kanban-card .card-status-badge {
        font-size: 9px;
        padding: 1px 8px;
    }
}

/* ── Модальное окно (универсальное) ── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}
.modal {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 28px 32px 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    position: relative;
    margin: 0 auto;
}
.modal .close-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    transition: 0.2s;
}
.modal .close-btn:hover {
    color: #f1f5f9;
}
.modal h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #f1f5f9;
}
.modal .form-group {
    margin-bottom: 16px;
}
.modal .form-group label {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.modal .form-group input,
.modal .form-group select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
.modal .form-group input:focus,
.modal .form-group select:focus {
    border-color: #3b82f6;
}
.modal .form-group input[type="date"] {
    color-scheme: dark;
}
.modal .form-row {
    display: flex;
    gap: 16px;
}
.modal .form-row .form-group {
    flex: 1;
}
.modal .btn-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 8px;
}
.modal .btn-submit:hover {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
}

/* ── Дополнительные стили для кнопки "Открыть" ── */
.open-link {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-radius: 6px;
    font-weight: 500;
    font-size: 12px;
    text-decoration: none;
    transition: 0.2s;
    border: 1px solid transparent;
}
.open-link:hover {
    background: rgba(59, 130, 246, 0.25);
    color: #93bbfc;
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* ── Стили для textarea в модальных окнах ── */
.modal .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}
.modal .form-group textarea:focus {
    border-color: #3b82f6;
}

/* ── СТИЛИ ДЛЯ СТРАНИЦЫ СЛУЖЕБНЫХ ЗАПИСОК ── */

.btn-create-note {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    border: none;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn-create-note:hover {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
    transform: scale(1.02);
}

/* Статусы для служебных записок */
.status-badge.created {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}
.status-badge.approval {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}
.status-badge.approved {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}
.status-badge.rejected {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.note-type {
    font-size: 12px;
    color: #94a3b8;
}

/* Канбан-карточки для записок */
.kanban-card .note-title {
    font-weight: 600;
    font-size: 14px;
    color: #e2e8f0;
}
.kanban-card .note-meta {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}
.kanban-card .note-meta .initiator {
    color: #94a3b8;
}
.kanban-card .note-meta .amount {
    color: #f1f5f9;
    font-weight: 500;
}
.kanban-card .note-meta .deadline {
    color: #94a3b8;
}
.kanban-card .note-type-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Цвета карточек канбана для записок */
.kanban-card[data-status="created"] {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.3);
}
.kanban-card[data-status="approval"] {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}
.kanban-card[data-status="approved"] {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}
.kanban-card[data-status="rejected"] {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
}

/* Бейджи для карточек канбана */
.kanban-card[data-status="created"] .card-status-badge {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}
.kanban-card[data-status="approval"] .card-status-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}
.kanban-card[data-status="approved"] .card-status-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.kanban-card[data-status="rejected"] .card-status-badge {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

/* ── СТИЛИ ДЛЯ СТРАНИЦЫ ПОЛЬЗОВАТЕЛЕЙ ── */

.btn-create-user {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    border: none;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn-create-user:hover {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
    transform: scale(1.02);
}

/* Бейджи ролей */
.role-badge {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 40px;
    font-size: 11px;
    font-weight: 500;
}
.role-badge.admin {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}
.role-badge.manager {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}
.role-badge.employee {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}
.role-badge.guest {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* Статусы пользователей (переопределяем общий .status-badge) */
.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}
.status-badge.blocked {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

/* Кнопки действий в таблице */
.actions-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    margin: 0 2px;
    transition: 0.2s;
}
.actions-btn:hover {
    color: #e2e8f0;
}
.actions-btn.delete:hover {
    color: #f87171;
}
.actions-btn.block:hover {
    color: #fbbf24;
}
.actions-btn.unblock:hover {
    color: #4ade80;
}

/* Чекбокс в модальном окне */
.modal .checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal .checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}
.modal .checkbox-group label {
    cursor: pointer;
    font-size: 13px;
    color: #e2e8f0;
}

/* Фикс: кнопки действий в одну строку */
.table-wrap td:last-child {
    white-space: nowrap;
}

.actions-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

/* ── СТИЛИ ДЛЯ СТРАНИЦЫ КАЛЕНДАРЯ ── */

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 8px;
}
.calendar-nav .month-year {
    font-size: 18px;
    font-weight: 600;
    color: #e2e8f0;
}
.calendar-nav .nav-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    padding: 0 8px;
    transition: 0.2s;
}
.calendar-nav .nav-btn:hover {
    color: #e2e8f0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 10px 12px;
    margin-bottom: 18px;
}
.calendar-grid .day-name {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-align: center;
    padding: 4px 0;
}
.calendar-grid .day {
    aspect-ratio: 1 / 0.9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    color: #e2e8f0;
    transition: 0.2s;
    cursor: pointer;
    position: relative;
    padding: 2px;
    min-height: 32px;
}
.calendar-grid .day.other-month {
    color: #4a5568;
}
.calendar-grid .day.today {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.calendar-grid .day.has-event::after {
    content: '•';
    position: absolute;
    bottom: 1px;
    font-size: 14px;
    color: #60a5fa;
    line-height: 1;
}
.calendar-grid .day:hover {
    background: rgba(255, 255, 255, 0.06);
}
.calendar-grid .day .event-indicator {
    font-size: 8px;
    color: #60a5fa;
    margin-top: 1px;
}

.events-list {
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 16px 18px;
}
.events-list .events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.events-list h4 {
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
}
.events-list .add-event-btn {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    border: none;
    color: #fff;
    font-weight: 500;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.events-list .add-event-btn:hover {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
    transform: scale(1.02);
}
.events-list .event-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 14px;
    color: #cbd5e1;
}
.events-list .event-item:last-child {
    border-bottom: none;
}
.events-list .event-item .time {
    color: #94a3b8;
    font-size: 13px;
}

/* ── СТИЛИ ДЛЯ СТРАНИЦЫ УВЕДОМЛЕНИЙ ── */

/* Специальные статусы для уведомлений */
.status-badge.read {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}
.status-badge.unread {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

/* Кнопка "Отметить прочитанным" в уведомлениях */
.actions-btn {
    background: transparent;
    border: none;
    color: #60a5fa;
    font-size: 13px;
    cursor: pointer;
    padding: 0 4px;
    transition: 0.2s;
}
.actions-btn:hover {
    color: #93bbfc;
}

/* ── СТИЛИ ДЛЯ СТРАНИЦ ДЕТАЛЕЙ (заказ, задача, записка) ── */

.detail-card {
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 20px 24px;
    margin-bottom: 22px;
}
.detail-card .row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    margin-bottom: 10px;
}
.detail-card .row .item {
    min-width: 140px;
}
.detail-card .row .item .label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.detail-card .row .item .value {
    font-size: 15px;
    font-weight: 500;
    color: #f1f5f9;
    margin-top: 2px;
}
.detail-card .row .item .value .status-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
}
.detail-card .description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.detail-card .description .label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.detail-card .description .text {
    font-size: 14px;
    color: #cbd5e1;
    line-height: 1.5;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 12px;
}
.related-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.related-item .title {
    color: #e2e8f0;
    font-weight: 500;
}
.related-item .meta {
    color: #94a3b8;
    font-size: 13px;
}
.related-item .link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 13px;
}
.related-item .link:hover {
    color: #93bbfc;
}

.history-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
    color: #cbd5e1;
}
.history-item .time {
    color: #94a3b8;
    margin-right: 12px;
}

.actions-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.btn-action {
    padding: 8px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
}
.btn-action.primary {
    background: #3b82f6;
    color: #fff;
}
.btn-action.primary:hover {
    background: #60a5fa;
}
.btn-action.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}
.btn-action.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}
.btn-action.danger {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}
.btn-action.danger:hover {
    background: rgba(248, 113, 113, 0.25);
}

.page-title .back-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 14px;
}
.page-title .back-link:hover {
    color: #93bbfc;
}

/* Бейджи приоритета для детальных страниц */
.priority-badge {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 500;
}
.priority-badge.high {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}
.priority-badge.medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
.priority-badge.low {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

/* Дополнительные стили для детальной страницы служебной записки */
.btn-action.success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.btn-action.success:hover {
    background: rgba(34, 197, 94, 0.3);
}

.approval-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.approval-item .info {
    color: #cbd5e1;
}
.approval-item .info .status {
    font-weight: 500;
}
.approval-item .info .date {
    color: #94a3b8;
    font-size: 13px;
}

.sidebar-user {
    margin-top: auto;
    padding: 16px 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-user a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}
.sidebar-user .avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-user .info .name {
    font-weight: 600;
    font-size: 13px;
    color: #e8edf5;
}
.sidebar-user .info .role {
    font-size: 12px;
    color: #94a3b8;
}

/* ── СТИЛИ ДЛЯ СТРАНИЦЫ ПРОФИЛЯ ── */

.profile-form {
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 24px 28px;
    max-width: 600px;
    margin-top: 8px;
}
.profile-form .form-group {
    margin-bottom: 18px;
}
.profile-form .form-group label {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.profile-form .form-group input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
.profile-form .form-group input:focus {
    border-color: #3b82f6;
}
.profile-form .form-group input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.profile-form .btn-save {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 10px 28px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
    margin-top: 4px;
}
.profile-form .btn-save:hover {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
    transform: scale(1.02);
}
.profile-form hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 20px 0;
}

/* Принудительно убираем стили ссылки для profile-badge */
a.profile-badge {
    text-decoration: none !important;
    color: inherit !important;
}

/* ── СТИЛИ ДЛЯ СТРАНИЦ АВТОРИЗАЦИИ (login, register) ── */

.auth-page {
    background: #080b14;
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}

.auth-box {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 28px 30px 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.auth-box .logo {
    text-align: center;
    margin-bottom: 16px;
}
.auth-box .logo img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
}
.auth-box h2 {
    font-size: 22px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 4px;
    text-align: center;
}
.auth-box p {
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    margin-bottom: 18px;
}
.auth-box .form-group {
    margin-bottom: 14px;
}
.auth-box .form-group label {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.auth-box .form-group input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
.auth-box .form-group input:focus {
    border-color: #3b82f6;
}
.auth-box .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 16px;
}
.auth-box .form-options label {
    color: #94a3b8;
    cursor: pointer;
}
.auth-box .form-options a {
    color: #60a5fa;
    text-decoration: none;
}
.auth-box .form-options a:hover {
    color: #93bbfc;
}
.auth-box .btn-auth {
    width: 100%;
    padding: 10px;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}
.auth-box .btn-auth:hover {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
    transform: scale(1.02);
}
.auth-box .footer-text {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #94a3b8;
}
.auth-box .footer-text a {
    color: #60a5fa;
    text-decoration: none;
}
.auth-box .footer-text a:hover {
    color: #93bbfc;
}

/* ── БУРГЕР-КНОПКА ── */
.burger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
}
.burger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
    transition: 0.3s;
}
.burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.burger-btn.active span:nth-child(2) {
    opacity: 0;
}
.burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── ОВЕРЛЕЙ ── */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
}
.menu-overlay.active {
    display: block;
}

/* ── АДАПТАЦИЯ САЙДБАРА ── */
@media (max-width: 768px) {
    .burger-btn {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
        padding-top: 60px;
        background: #0b1222;
        border-right: 1px solid rgba(255, 255, 255, 0.05);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar .logo {
        padding: 16px 18px !important;
        margin: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: flex !important;
        justify-content: flex-start !important;
    }
    .sidebar .logo img {
        width: 180px !important;
        height: auto !important;
        max-width: 100% !important;
    }

    .nav-menu {
        padding: 8px 14px;
    }
    .nav-menu .nav-item {
        font-size: 15px !important;
        padding: 12px 14px !important;
        justify-content: flex-start !important;
    }
    .nav-menu .nav-item .label {
        display: inline-block !important;
        margin-left: 0;
    }

    .sidebar-user {
        padding: 16px 18px !important;
    }
    .sidebar-user .info {
        display: block !important;
    }

    .main {
        max-width: 100% !important;
        padding: 16px 14px !important;
    }

    .header {
        flex-wrap: nowrap;
        gap: 8px;
    }
    .header .search {
        width: 100%;
        order: 2;
        margin-top: 6px;
    }
    .header-right {
        gap: 10px;
        margin-left: auto;
    }
    .header .burger-btn {
        order: 0;
        flex-shrink: 0;
    }

    .cards {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    .card .value {
        font-size: 26px !important;
    }
    .card .top h4 {
        font-size: 13px !important;
    }

    .grid-3 {
        grid-template-columns: 1fr !important;
    }
    .block {
        padding: 12px 14px !important;
    }
    .block h4 {
        font-size: 14px !important;
    }

    .table-wrap {
        padding: 10px 12px !important;
    }
    table {
        font-size: 12px !important;
    }
    thead th {
        font-size: 10px !important;
        padding: 4px 4px !important;
    }
    tbody td {
        font-size: 11px !important;
        padding: 6px 4px !important;
    }
    .open-link {
        font-size: 11px !important;
        padding: 2px 10px !important;
    }

    .dash-title h2,
    .page-title .title-group h2 {
        font-size: 20px !important;
    }
    .dash-title p,
    .page-title .title-group p {
        font-size: 13px !important;
    }

    .btn-create-order,
    .btn-create-task,
    .btn-create-note,
    .btn-create-user {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 12px !important;
    }
    .pagination .pages button {
        font-size: 12px !important;
        padding: 2px 8px !important;
    }
    .pagination .per-page select {
        font-size: 12px !important;
        padding: 2px 6px !important;
    }

    .filters {
        flex-direction: column !important;
        padding: 12px 14px !important;
        gap: 10px !important;
    }
    .filters .filter-group {
        width: 100%;
    }
    .filters .filter-group select {
        width: 100%;
        min-width: unset !important;
    }
    .filters .reset-btn {
        width: 100%;
        margin-left: 0 !important;
        text-align: center;
    }

    .modal {
        padding: 20px 16px !important;
        width: 95% !important;
        max-width: 95% !important;
    }
    .modal .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }
    .modal h3 {
        font-size: 18px !important;
    }
    .modal .btn-submit {
        font-size: 14px !important;
        padding: 10px !important;
    }

    .calendar-grid {
        padding: 6px 8px !important;
        gap: 2px !important;
    }
    .calendar-grid .day {
        font-size: 11px !important;
        min-height: 24px !important;
    }
    .calendar-grid .day-name {
        font-size: 10px !important;
        padding: 2px 0 !important;
    }
    .events-list {
        padding: 12px 14px !important;
    }
    .events-list h4 {
        font-size: 14px !important;
    }
    .events-list .add-event-btn {
        font-size: 12px !important;
        padding: 4px 12px !important;
    }
    .events-list .event-item {
        font-size: 13px !important;
    }

    .detail-card {
        padding: 14px 16px !important;
    }
    .detail-card .row {
        gap: 10px 20px !important;
    }
    .detail-card .row .item {
        min-width: 100px !important;
    }
    .detail-card .row .item .value {
        font-size: 13px !important;
    }
    .actions-bar {
        gap: 8px !important;
    }
    .btn-action {
        font-size: 12px !important;
        padding: 6px 14px !important;
    }

    .profile-form {
        padding: 16px 18px !important;
    }
    .profile-form .form-group input {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    .profile-form .btn-save {
        font-size: 13px !important;
        padding: 8px 20px !important;
    }

    .status-badge {
        font-size: 10px !important;
        padding: 1px 8px !important;
    }

    .footer-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
    .footer-row .user-block .avatar-lg {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }
    .footer-row .user-block .name {
        font-size: 14px !important;
    }
    .footer-row .user-block .role {
        font-size: 12px !important;
    }
}

/* ── ПЛАНШЕТЫ (ширина 768–1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .main {
        max-width: calc(100% - 220px);
        padding: 18px 22px !important;
    }
    .cards {
        grid-template-columns: 1fr 1fr !important;
    }
    .grid-3 {
        grid-template-columns: 1fr 1fr !important;
    }
    .grid-3 .block:last-child {
        grid-column: 1 / -1;
    }
    .chart-wrapper {
        width: 120px;
        height: 120px;
    }
    .kanban-col {
        min-width: 180px !important;
    }
    .header .search {
        width: 160px;
    }
    .dash-title h2,
    .page-title .title-group h2 {
        font-size: 22px !important;
    }
}

/* ── МАЛЕНЬКИЕ ТЕЛЕФОНЫ (до 480px) ── */
@media (max-width: 480px) {
    .cards {
        grid-template-columns: 1fr !important;
    }
    .header .search {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    .profile-badge .info {
        display: none !important;
    }
    .icon-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 16px !important;
    }
    .page-title {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-create-order,
    .btn-create-task,
    .btn-create-note,
    .btn-create-user {
        align-self: stretch;
        justify-content: center;
    }
}

/* ── МОДАЛЬНОЕ ОКНО ПОДТВЕРЖДЕНИЯ (УЛУЧШЕННОЕ) ── */

#userConfirmModal .modal {
    max-width: 460px;
    padding: 28px 30px 24px;
}

#userConfirmModal .close-btn {
    width: 34px;
    height: 34px;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#userConfirmModal .close-btn:hover {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.25);
    color: #f87171;
    transform: scale(1.04);
}

#userConfirmModal .confirm-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

/* ── КНОПКА ОТМЕНА ── */
#userConfirmModal .confirm-cancel {
    width: auto;
    min-width: 100px;
    padding: 10px 20px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#userConfirmModal .confirm-cancel:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
    color: #f1f5f9;
    transform: translateY(-1px);
}

#userConfirmModal .confirm-cancel:active {
    transform: translateY(0);
}

/* ── КНОПКА ПОДТВЕРЖДЕНИЯ (ОСНОВНАЯ) ── */
#userConfirmModal #confirmModalConfirm {
    width: auto;
    min-width: 130px;
    margin-top: 0;
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: #fff;
}

#userConfirmModal #confirmModalConfirm:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

/* ── ОПАСНОЕ ДЕЙСТВИЕ (блокировка, удаление) ── */
#userConfirmModal #confirmModalConfirm.danger {
    background: linear-gradient(145deg, #ef4444, #dc2626);
}

#userConfirmModal #confirmModalConfirm.danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

/* ── АДАПТАЦИЯ ДЛЯ ТЕЛЕФОНА ── */
@media (max-width: 600px) {
    #userConfirmModal .modal {
        padding: 24px 18px 20px;
    }

    #userConfirmModal .confirm-actions {
        flex-direction: column-reverse;
        width: 100%;
        gap: 10px;
    }

    #userConfirmModal .confirm-cancel,
    #userConfirmModal #confirmModalConfirm {
        width: 100%;
        min-width: 0;
        text-align: center;
        justify-content: center;
    }

    #userConfirmModal .confirm-cancel {
        padding: 12px 20px;
    }

    #userConfirmModal #confirmModalConfirm {
        padding: 12px 20px;
    }
}
.ui-state {
    padding: 24px;
    color: #94a3b8;
    text-align: center;
}

.ui-state--error {
    color: #fca5a5;
}

.ui-state--loading {
    opacity: 0.8;
}
