/* RestoConsult — стили по new.html */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #edf2f9 0%, #e2eaf5 100%);
    color: #1e293b;
}

.app { display: flex; min-height: 100vh; position: relative; }

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e2b3c 0%, #121d2b 100%);
    color: #e0e7ff;
    padding: 2rem 1.2rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.2s ease, padding 0.2s ease;
    z-index: 1000;
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.15), inset -1px 0 0 rgba(255, 255, 255, 0.05);
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 76px;
    padding: 1.5rem 0.75rem 4.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    padding-left: 0.5rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.logo i { font-size: 2rem; color: #60a5fa; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3)); }
.logo, .logo:hover { text-decoration: none; color: white; }

.sidebar-logo {
    padding-left: 0.5rem;
}

.sidebar.collapsed .logo {
    justify-content: center;
    padding-left: 0;
}
.sidebar.collapsed .logo span { display: none; }

.sidebar-footer {
    margin-top: 0;
    padding-top: 0;
    display: flex;
    position: absolute;
    left: 1.2rem;
    right: 1.2rem;
    bottom: 1rem;
    justify-content: flex-end;
}

.sidebar-arrow {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #d9e6ff;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.sidebar-arrow:hover { background: rgba(255, 255, 255, 0.10); }

.sidebar.collapsed .sidebar-footer { justify-content: center; }
.sidebar.collapsed .sidebar-footer {
    left: 0.75rem;
    right: 0.75rem;
}

.nav { display: flex; flex-direction: column; gap: 0.3rem; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    color: #b0c4e0;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #d9e6ff; text-decoration: none; box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2); }
.nav-item.active { background: rgba(255, 255, 255, 0.12); color: white; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.nav-item.active i { color: #60a5fa; }
.nav-item i { width: 24px; font-size: 1.2rem; color: #7f9bc0; }
.nav-item span { font-size: 1rem; }

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.8rem 0.75rem;
    gap: 0;
}
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item i { width: auto; }

.bottom-nav { margin-top: auto; padding-top: 2rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }

.main {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
}

.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.page-title h1 { font-size: 2rem; font-weight: 700; color: #0b2b4f; letter-spacing: -0.02em; }
.page-title p { color: #5f6d84; font-size: 0.95rem; margin-top: 0.3rem; }

.user-profile { display: flex; align-items: center; gap: 1.8rem; }
.notifications { font-size: 1.3rem; color: #3f506e; cursor: default; }
.avatar {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 40px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600; font-size: 1.2rem;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.4), 0 2px 0 rgba(255,255,255,0.2) inset;
}

.burger {
    display: none;
    font-size: 1.8rem;
    color: #1d4ed8;
    cursor: pointer;
    margin-right: 1rem;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    background: white;
    border-radius: 28px;
    padding: 1.5rem 1.5rem;
    box-shadow: 0 20px 35px -10px rgba(0, 20, 40, 0.2), 0 1px 3px rgba(0,0,0,0.02), inset 0 1px 0 rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.metric-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 30px 45px -12px rgba(0, 30, 60, 0.3), 0 1px 3px rgba(0,0,0,0.02), inset 0 1px 0 rgba(255,255,255,0.7);
}

.metric-icon {
    width: 48px; height: 48px;
    background: #e0edff;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: #1d4ed8; font-size: 1.4rem;
}

.metric-info h4 { font-weight: 500; font-size: 0.8rem; text-transform: uppercase; color: #697a94; }
.metric-info .value { font-size: 1.6rem; font-weight: 700; color: #13294e; line-height: 1.2; }
.metric-info .unit { font-size: 0.8rem; color: #2563eb; font-weight: 500; margin-left: 0.2rem; }
.trend-up { color: #10b981; font-size: 0.8rem; margin-left: 0.5rem; }

.modules-section { margin-bottom: 3rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.section-header h2 { font-size: 1.4rem; font-weight: 600; color: #142c52; letter-spacing: -0.01em; }
.section-header i { color: #8b9bb5; font-size: 1.1rem; }

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.module-card {
    background: white;
    border-radius: 24px;
    padding: 1.2rem 1rem 1rem 1rem;
    box-shadow: 0 10px 22px -8px rgba(0, 30, 60, 0.12), 0 1px 2px rgba(0,0,0,0.02), inset 0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid #f0f4fa;
    border-left: 4px solid;
    display: flex;
    flex-direction: column;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
}
.module-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 25px 35px -12px rgba(0, 40, 80, 0.2), 0 1px 3px rgba(0,0,0,0.02);
    border-color: #d0e0f5;
    color: inherit;
    text-decoration: none;
}

.module-icon { font-size: 1.6rem; margin-bottom: 0.8rem; color: #1e3a8a; }
.module-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.3rem; color: #0f2b4f; }
.module-desc { font-size: 0.8rem; color: #667c99; line-height: 1.3; margin-bottom: 0.5rem; }

.border-rest { border-left-color: #16a34a; }
.border-zakup { border-left-color: #d97706; }
.border-fkpod { border-left-color: #7c3aed; }
.border-control { border-left-color: #b91c1c; }
.border-other { border-left-color: #6b7280; }

footer {
    margin-top: 3rem;
    text-align: right;
    color: #8899b2;
    font-size: 0.8rem;
    border-top: 1px solid #dee7f2;
    padding-top: 1.5rem;
}

@media (max-width: 700px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 20px rgba(0,0,0,0.1);
        padding: 1.5rem 1rem;
    }
    .sidebar.collapsed {
        width: 260px;
        padding: 1.5rem 1rem;
    }
    .sidebar.open { transform: translateX(0); }
    .main { padding: 1rem; margin-left: 0; }
    .burger { display: inline-block; }
    .sidebar-footer { display: none; }
    .page-title h1 { font-size: 1.4rem; }
    .page-title p { font-size: 0.8rem; }
    .avatar { width: 36px; height: 36px; font-size: 0.9rem; }
    .metrics-row { grid-template-columns: 1fr; gap: 0.8rem; }
    .metric-card { padding: 0.8rem 1rem; }
    .metric-icon { width: 40px; height: 40px; font-size: 1.2rem; }
    .metric-info .value { font-size: 1.3rem; }
    .module-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .module-card { padding: 0.8rem; }
    .module-icon { font-size: 1.3rem; margin-bottom: 0.4rem; }
    .module-title { font-size: 0.95rem; }
    .module-desc { font-size: 0.75rem; }
    .section-header h2 { font-size: 1.2rem; }
    footer { font-size: 0.7rem; margin-top: 2rem; padding-top: 1rem; }

    .header {
        align-items: flex-start;
        gap: 0.6rem;
        margin-bottom: 1.2rem;
    }
    .header > div:first-child {
        min-width: 0;
        flex: 1 1 auto;
    }
    .user-profile {
        gap: 0.6rem;
        flex: 0 0 auto;
    }
    .page-title h1 {
        line-height: 1.2;
        word-break: break-word;
    }
    .page-title p {
        line-height: 1.35;
        word-break: break-word;
    }

    /* Единое поведение таблиц и скролла на мобильных */
    .table-wrap,
    .hoz-table-wrap,
    .um-table-wrapper,
    .kln-table-wrap,
    .ttk-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .rating-table,
    .hoz-table,
    .um-table,
    .kln-table,
    .ttk-table,
    .data-table {
        min-width: 680px;
    }
    .status-line,
    .status {
        line-height: 1.35;
        word-break: break-word;
    }
}

@media (max-width: 400px) {
    .main { padding: 0.8rem; }
    .metric-card { flex-wrap: wrap; gap: 0.5rem; }
    .metric-icon { width: 36px; height: 36px; font-size: 1rem; }
    .metric-info .value { font-size: 1.1rem; }
}
