* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --background: #f7f4f1;
    --surface: #ffffff;
    --text: #2d2927;
    --muted: #918983;
    --border: #ebe5e0;
    --accent: #9a8175;
    --accent-light: #eee6e1;
}


body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);
    color: var(--text);
}


.app {
    display: flex;
    min-height: 100vh;
}


/* SIDEBAR */

.sidebar {
    width: 250px;
    min-height: 100vh;

    background: var(--surface);

    border-right:
        1px solid var(--border);

    display: flex;
    flex-direction: column;

    padding: 28px 18px;
}


.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 10px;
}


.brand-mark {
    width: 42px;
    height: 42px;

    border-radius: 13px;

    background: var(--text);
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
    font-weight: 700;
}


.brand-title {
    font-size: 16px;
    font-weight: 700;
}


.brand-subtitle {
    margin-top: 2px;

    font-size: 11px;
    color: var(--muted);
}


/* NAVIGATION */

.navigation {
    margin-top: 45px;

    display: flex;
    flex-direction: column;

    gap: 6px;
}


.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 14px;

    border-radius: 10px;

    color: var(--muted);

    text-decoration: none;

    font-size: 14px;
    font-weight: 500;

    transition: 0.2s;
}


.nav-item:hover {
    background: var(--background);
    color: var(--text);
}


.nav-item.active {
    background: var(--accent-light);
    color: var(--text);
}


.nav-item span {
    width: 20px;
    text-align: center;
}


/* FOOTER */

.sidebar-footer {
    margin-top: auto;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 12px 14px;

    font-size: 12px;
    color: var(--muted);
}


.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #7c9c81;
}


/* CONTENT */

.content {
    flex: 1;

    padding: 48px 55px;

    max-width: 1500px;
}


.page-header {
    margin-bottom: 38px;
}


.eyebrow {
    margin-bottom: 9px;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 2px;

    color: var(--accent);
}


.page-header h1 {
    font-size: 32px;
    line-height: 1.2;

    letter-spacing: -0.7px;
}


.page-header p {
    margin-top: 8px;

    color: var(--muted);

    font-size: 14px;
}


/* STATS */

.stats {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;

    margin-bottom: 38px;
}


.stat-card {
    position: relative;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 16px;

    padding: 22px;

    min-height: 130px;
}


.stat-label {
    font-size: 13px;
    color: var(--muted);
}


.stat-value {
    margin-top: 14px;

    font-size: 30px;
    font-weight: 700;

    letter-spacing: -1px;
}


.stat-icon {
    position: absolute;

    top: 20px;
    right: 20px;

    width: 35px;
    height: 35px;

    border-radius: 10px;

    background: var(--accent-light);

    color: var(--accent);

    display: flex;
    align-items: center;
    justify-content: center;
}


/* APPLICATIONS */

.applications-section {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 18px;

    overflow: hidden;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 25px 27px;

    border-bottom: 1px solid var(--border);
}


.section-header h2 {
    font-size: 18px;
}


.section-header p {
    margin-top: 5px;

    color: var(--muted);

    font-size: 13px;
}


.total-badge {
    background: var(--background);

    border-radius: 20px;

    padding: 7px 12px;

    font-size: 12px;
    color: var(--muted);
}


/* TABLE */

.table-wrapper {
    overflow-x: auto;
}


table {
    width: 100%;

    border-collapse: collapse;

    font-size: 13px;
}


th {
    padding: 15px 22px;

    text-align: left;

    font-size: 11px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.5px;

    color: var(--muted);

    background: #fcfbfa;

    border-bottom:
        1px solid var(--border);
}


td {
    padding: 17px 22px;

    border-bottom:
        1px solid var(--border);

    vertical-align: middle;
}


tbody tr:last-child td {
    border-bottom: none;
}


tbody tr:hover {
    background: #fcfbfa;
}


.application-id {
    font-weight: 600;
    color: var(--accent);
}


.client {
    display: flex;
    align-items: center;

    gap: 10px;
}


.avatar {
    width: 34px;
    height: 34px;

    border-radius: 10px;

    background: var(--accent-light);
    color: var(--accent);

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 700;
}


.client-name {
    font-weight: 600;
}


.client-phone {
    margin-top: 3px;

    font-size: 11px;

    color: var(--muted);
}


.date {
    white-space: nowrap;

    color: var(--muted);
    font-size: 12px;
}


/* STATUSES */

.status {
    display: inline-flex;

    align-items: center;

    padding: 6px 9px;

    border-radius: 8px;

    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;
}


.status-new {
    background: #f4eee5;
    color: #8b6f48;
}


.status-progress {
    background: #eee8e4;
    color: #79675d;
}


.status-confirmed {
    background: #e9f0e9;
    color: #637b67;
}


.status-cancelled {
    background: #f1e9e8;
    color: #896d69;
}


/* EMPTY */

.empty {
    text-align: center;

    padding: 70px 20px;
}


.empty-icon {
    width: 50px;
    height: 50px;

    margin: 0 auto 18px;

    border-radius: 15px;

    background: var(--accent-light);
    color: var(--accent);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
}


.empty h3 {
    font-size: 16px;
}


.empty p {
    max-width: 420px;

    margin: 8px auto 0;

    color: var(--muted);

    font-size: 13px;

    line-height: 1.5;
}


/* RESPONSIVE */

@media (max-width: 1000px) {

    .sidebar {
        width: 210px;
    }

    .content {
        padding: 35px;
    }

    .stats {
        grid-template-columns:
            repeat(2, 1fr);
    }
}


@media (max-width: 700px) {

    .sidebar {
        display: none;
    }

    .content {
        padding: 25px 16px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 27px;
    }
}

/* DASHBOARD GRID */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.4fr)
        minmax(300px, 0.6fr);

    gap: 18px;

    margin-bottom: 38px;
}


.chart-card,
.quick-card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 18px;

    overflow: hidden;
}


.chart-header {
    padding: 25px 27px;

    margin: 0;
}


.chart-container {
    height: 280px;

    padding: 15px 30px 5px;
}


.chart-legend {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 10px;

    padding: 15px 27px 25px;
}


.legend-item {
    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 12px;

    color: var(--muted);
}


.legend-item strong {
    margin-left: auto;

    color: var(--text);
}


.legend-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    flex-shrink: 0;
}


.dot-new {
    background: #b89b72;
}


.dot-progress {
    background: #9a8175;
}


.dot-confirmed {
    background: #7c9c81;
}


.dot-cancelled {
    background: #9a7772;
}


/* SUMMARY */

.summary-list {
    padding: 8px 27px 20px;
}


.summary-item {
    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 17px 0;

    border-bottom:
        1px solid var(--border);

    font-size: 13px;

    color: var(--muted);
}


.summary-item:last-child {
    border-bottom: none;
}


.summary-item strong {
    font-size: 18px;

    color: var(--text);
}


/* RESPONSIVE */

@media (max-width: 900px) {

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .chart-legend {
        grid-template-columns: 1fr;
    }

}
/* =========================================
   APPLICATION PAGE
========================================= */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 20px;

    color: var(--muted);

    font-size: 13px;
    font-weight: 500;

    text-decoration: none;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.back-link:hover {
    color: var(--text);
    transform: translateX(-2px);
}


/* LAYOUT */

.application-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        350px;

    gap: 20px;

    align-items: start;
}


/* MAIN CARD */

.application-card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 20px;

    overflow: hidden;
}


.application-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 25px;

    padding: 30px;
}


.customer {
    display: flex;

    align-items: center;

    gap: 17px;

    min-width: 0;
}


.customer-avatar {
    width: 62px;
    height: 62px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--background);

    border: 1px solid var(--border);

    color: var(--text);

    font-size: 22px;
    font-weight: 600;
}


.customer-label {
    margin-bottom: 7px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.14em;
}


.customer h2 {
    margin: 0;

    color: var(--text);

    font-size: 24px;
    font-weight: 600;
}


.customer-username {
    margin-top: 5px;

    color: var(--muted);

    font-size: 12px;
}


/* DIVIDER */

.application-divider {
    height: 1px;

    background: var(--border);

    margin: 0 30px;
}


/* DETAILS */

.application-details {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0;

    padding: 8px 30px;
}


.detail {
    display: flex;

    flex-direction: column;

    gap: 8px;

    padding: 22px 20px 22px 0;
}


.detail:nth-child(even) {
    padding-left: 25px;

    border-left: 1px solid var(--border);
}


.detail span {
    color: var(--muted);

    font-size: 12px;
}


.detail strong {
    color: var(--text);

    font-size: 14px;
    font-weight: 600;

    word-break: break-word;
}


.detail .price {
    font-size: 17px;
}


/* FOOTER */

.application-footer {
    display: flex;

    align-items: center;

    gap: 50px;

    padding: 20px 30px;

    background: var(--background);

    border-top: 1px solid var(--border);
}


.application-footer > div {
    display: flex;

    flex-direction: column;

    gap: 5px;
}


.application-footer span {
    color: var(--muted);

    font-size: 11px;
}


.application-footer strong {
    color: var(--text);

    font-size: 12px;
    font-weight: 600;
}


/* ACTION CARD */

.application-actions {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 20px;

    padding: 27px;
}


.actions-header {
    padding-bottom: 23px;

    border-bottom: 1px solid var(--border);
}


.actions-header h2 {
    margin: 0 0 7px;

    color: var(--text);

    font-size: 19px;
    font-weight: 600;
}


.actions-header p {
    margin: 0;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.6;
}


/* STATUS */

#current-status {
    flex-shrink: 0;
}


.status {
    display: inline-flex;

    align-items: center;

    padding: 7px 12px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
}


.status-new {
    background: #f3eadf;
    color: #866b48;
}


.status-progress {
    background: #eee7e3;
    color: #79655c;
}


.status-confirmed {
    background: #e5eee7;
    color: #5d7863;
}


.status-cancelled {
    background: #eee4e2;
    color: #80615d;
}


/* BUTTONS */

.status-actions {
    display: flex;

    flex-direction: column;

    gap: 10px;

    padding-top: 22px;
}


.action-button {
    width: 100%;

    display: flex;

    align-items: center;

    gap: 13px;

    min-height: 58px;

    padding: 10px 14px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: var(--background);

    color: var(--text);

    font-family: inherit;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease,
        opacity 0.2s ease;
}


.action-button:hover {
    background: var(--surface);

    border-color: #c9c0ba;
}


.action-button:active {
    transform: scale(0.985);
}


.action-button:disabled {
    cursor: wait;

    opacity: 0.55;
}


.action-icon {
    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 9px;

    background: var(--surface);

    border: 1px solid var(--border);

    font-size: 16px;
}


.action-button strong {
    display: block;

    margin-bottom: 3px;

    font-size: 13px;
    font-weight: 600;
}


.action-button small {
    display: block;

    color: var(--muted);

    font-size: 10px;
}


.action-confirm:hover {
    border-color: #9eb5a2;
}


.action-confirm:hover .action-icon {
    color: #5d7863;
}


.action-cancel:hover {
    border-color: #b9a09c;
}


.action-cancel:hover .action-icon {
    color: #80615d;
}


.action-progress:hover {
    border-color: #b5aaa4;
}


/* LOADING */

.action-button.loading .action-icon {
    animation: button-spin 0.8s linear infinite;
}


@keyframes button-spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


/* TELEGRAM STATUS */

.notification-status {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 20px;

    padding-top: 18px;

    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 10px;

    line-height: 1.4;
}


.notification-dot {
    width: 7px;
    height: 7px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #7c9c81;
}


.notification-dot.error {
    background: #9a7772;
}


/* MOBILE */

@media (max-width: 850px) {

    .application-layout {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .application-header {
        align-items: flex-start;

        flex-direction: column;
    }


    .application-details {
        grid-template-columns: 1fr;
    }


    .detail:nth-child(even) {
        padding-left: 0;

        border-left: none;

        border-top: 1px solid var(--border);
    }


    .application-footer {
        flex-direction: column;

        align-items: flex-start;

        gap: 15px;
    }

}

.application-row {
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.application-row td {
    transition: color 0.15s ease;
}

.application-row:hover {
    background: var(--background);
}

.application-row:hover td:first-child {
    color: var(--primary);
}

/* Показываем, что строку можно открыть */
.application-row::after {
    content: "→";
    opacity: 0;
    transition: opacity 0.15s ease;
}

.application-row:hover::after {
    opacity: 1;
}