/* === CSS Reset === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === Базовая типографика (Apple Style) === */
html {
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    color: #1d1d1f;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Контейнер === */
.container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
}

/* === Навигация === */
.nav {
    padding: 16px 0;
    border-bottom: 1px solid #d2d2d7;
    background-color: #fff;
}

.nav__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 400;
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav__link::before {
    content: '‹';
    font-size: 18px;
    transition: transform 0.2s ease;
}

.nav__link:hover {
    text-decoration: underline;
}

.nav__link:hover::before {
    transform: translateX(-2px);
}

/* === Main === */
.main {
    flex: 1;
    padding: 48px 0;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: #1d1d1f;
    margin-bottom: 16px;
    line-height: 1.125;
}

.page-subtitle {
    font-size: 14px;
    color: #86868b;
    margin-bottom: 32px;
}

/* === Таблица запросов === */
.requests-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 32px;
}

.requests-table th,
.requests-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #d2d2d7;
}

.requests-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #86868b;
    background-color: #f5f5f7;
}

.requests-table td {
    font-size: 14px;
    color: #1d1d1f;
    vertical-align: top;
}

.requests-table tr:hover td {
    background-color: #f5f5f7;
}

.requests-table__date {
    white-space: nowrap;
    min-width: 100px;
}

.requests-table__request {
    max-width: 400px;
    word-wrap: break-word;
}

.requests-table__status {
    white-space: nowrap;
}

/* === Статусы === */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}

.status-badge--new {
    background-color: #007aff;
}

.status-badge--review {
    background-color: #ff9500;
}

.status-badge--done {
    background-color: #34c759;
}

/* === Карточки (мобильная версия) === */
.requests-cards {
    display: none;
}

.request-card {
    padding: 20px;
    margin-bottom: 16px;
    background-color: #f5f5f7;
    border-radius: 12px;
}

.request-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.request-card__date {
    font-size: 12px;
    color: #86868b;
}

.request-card__text {
    font-size: 14px;
    color: #1d1d1f;
    line-height: 1.5;
}

/* === Сворачиваемый текст === */
.truncated-text__short {
    display: inline;
}

.truncated-text__full {
    display: none;
}

.truncated-text--expanded .truncated-text__short {
    display: none;
}

.truncated-text--expanded .truncated-text__full {
    display: inline;
}

.truncated-text__toggle {
    display: inline;
    margin-left: 4px;
    font-size: 13px;
    color: #0066cc;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.truncated-text__toggle:hover {
    text-decoration: underline;
}

/* === Фильтр статусов === */
.status-filter {
    position: relative;
    display: inline-block;
}

.status-filter__btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #86868b;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.status-filter__btn::after {
    content: '▼';
    font-size: 8px;
    transition: transform 0.2s ease;
}

.status-filter__btn:hover {
    color: #0066cc;
}

.status-filter__btn--active::after {
    transform: rotate(180deg);
}

.status-filter__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    min-width: 180px;
    z-index: 100;
    display: none;
}

.status-filter__dropdown--visible {
    display: block;
}

.status-filter__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.status-filter__item:hover {
    color: #0066cc;
}

.status-filter__checkbox {
    width: 18px;
    height: 18px;
    accent-color: #0066cc;
    cursor: pointer;
}

.status-filter__reset {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #0066cc;
    background: #f5f5f7;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

.status-filter__reset:hover {
    background: #e8e8ed;
}

/* Мобильный фильтр */
.filter-bar {
    display: none;
    margin-bottom: 16px;
    position: relative;
}

.filter-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    color: #1d1d1f;
    background: #f5f5f7;
    border: none;
    border-radius: 980px;
    cursor: pointer;
    font-family: inherit;
}

.filter-bar__btn::after {
    content: '▼';
    font-size: 8px;
    transition: transform 0.2s ease;
}

.filter-bar__btn--open::after {
    transform: rotate(180deg);
}

.filter-bar__btn--active {
    background: #0066cc;
    color: #fff;
}

.filter-bar__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
}

@media (max-width: 733px) {
    .filter-bar {
        display: block;
    }
}

/* === Загрузка === */
.loading {
    text-align: center;
    padding: 48px 0;
    color: #86868b;
}

.error {
    text-align: center;
    padding: 48px 0;
    color: #ff3b30;
}

/* === Footer === */
.footer {
    padding: 20px 0;
    border-top: 1px solid #d2d2d7;
    background-color: #f5f5f7;
}

.footer__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 400;
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer__link::before {
    content: '‹';
    font-size: 18px;
    transition: transform 0.2s ease;
}

.footer__link:hover {
    text-decoration: underline;
}

.footer__link:hover::before {
    transform: translateX(-2px);
}

/* === Media Queries === */
@media (max-width: 733px) {
    .requests-table {
        display: none;
    }

    .requests-cards {
        display: block;
    }
}

@media (min-width: 734px) {
    .container {
        padding: 0 44px;
    }

    .nav {
        padding: 20px 0;
    }

    .nav__link {
        font-size: 17px;
    }

    .main {
        padding: 64px 0;
    }

    .page-title {
        font-size: 48px;
        margin-bottom: 20px;
    }

    .page-subtitle {
        font-size: 17px;
        margin-bottom: 40px;
    }

    .footer {
        padding: 24px 0;
    }

    .footer__link {
        font-size: 17px;
    }
}
