/* ============================================================
   VENDARA — Cabinet CSS
   Общие стили для всех страниц личного кабинета.
   Подключается на /cabinet/* страницах через layouts.profile
   ============================================================ */

/* ── Shared card ──────────────────────────────────────────── */
.cab-card {
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}
.cab-card:last-child { margin-bottom: 0; }

.cab-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    border-bottom: 1.5px solid var(--vd-border);
    flex-wrap: wrap;
}
.cab-card__title {
    font-family: var(--vd-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--vd-ink);
    display: flex;
    align-items: center;
    gap: 10px;
}
.cab-card__title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--vd-brand);
    border-radius: 2px;
    flex-shrink: 0;
}
.cab-card__body { padding: 22px; }
.cab-card__foot {
    padding: 14px 22px;
    border-top: 1px solid var(--vd-border);
    background: var(--vd-surface);
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.cab-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--vd-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.cab-breadcrumb a {
    color: var(--vd-muted);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--vd-transition);
}
.cab-breadcrumb a:hover { color: var(--vd-brand); }
.cab-breadcrumb__sep { color: var(--vd-border-dark); }
.cab-breadcrumb__current { color: var(--vd-text); font-weight: 600; }

/* ── Mobile tabs (profile sidebar → horizontal tabs on mobile) */
.cab-mobile-tabs {
    display: none;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-md) var(--vd-radius-md) 0 0;
    margin-bottom: 0;
    border-bottom: none;
}
.cab-mobile-tabs::-webkit-scrollbar { display: none; }
.cab-mobile-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--vd-muted);
    text-decoration: none;
    border-bottom: 2.5px solid transparent;
    white-space: nowrap;
    transition: color var(--vd-transition), border-color var(--vd-transition);
}
.cab-mobile-tab.active,
.cab-mobile-tab:hover { color: var(--vd-brand); border-bottom-color: var(--vd-brand); }

/* ── Alerts ───────────────────────────────────────────────── */
.cab-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--vd-radius-sm);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 20px;
}
.cab-alert--success { background: var(--vd-green-light); border: 1.5px solid #BBF7D0; color: #15803D; }
.cab-alert--error   { background: var(--vd-red-light);   border: 1.5px solid #FECACA; color: #B91C1C; }
.cab-alert--warning { background: #FEF9C3; border: 1.5px solid #FDE68A; color: #92400E; }
.cab-alert--info    { background: var(--vd-accent-light, #EFF6FF); border: 1.5px solid #BFDBFE; color: #1D4ED8; }

/* Form fields, buttons, badges, toggle → см. ui.css (подключается через layout) */

/* ── Data table ───────────────────────────────────────────── */
.cab-table-wrap {
    overflow-x: auto;
    border-radius: var(--vd-radius-md);
    border: 1.5px solid var(--vd-border);
}

.cab-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}
.cab-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--vd-muted);
    background: var(--vd-surface);
    border-bottom: 1.5px solid var(--vd-border);
    white-space: nowrap;
}
.cab-table th:first-child { border-radius: var(--vd-radius-md) 0 0 0; }
.cab-table th:last-child  { border-radius: 0 var(--vd-radius-md) 0 0; }

.cab-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--vd-border);
    color: var(--vd-text);
    font-weight: 600;
    vertical-align: middle;
}
.cab-table tr:last-child td { border-bottom: none; }
.cab-table tr { transition: background var(--vd-transition); }
.cab-table tbody tr:hover { background: var(--vd-surface); }

.cab-table__link {
    color: var(--vd-brand);
    font-weight: 700;
    text-decoration: none;
    transition: color var(--vd-transition);
}
.cab-table__link:hover { color: var(--vd-brand-dark); }

.cab-table__muted { color: var(--vd-muted); font-weight: 600; font-size: 13px; }

/* ── Filter toolbar ───────────────────────────────────────── */
.cab-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.cab-toolbar__select {
    height: 38px;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    padding: 0 32px 0 12px;
    font-family: var(--vd-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--vd-text);
    background: var(--vd-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color var(--vd-transition);
}
.cab-toolbar__select:focus { border-color: var(--vd-brand); }

.cab-toolbar__input {
    height: 38px;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    padding: 0 12px;
    font-family: var(--vd-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--vd-text);
    outline: none;
    transition: border-color var(--vd-transition);
    background: var(--vd-white);
}
.cab-toolbar__input:focus { border-color: var(--vd-brand); }
.cab-toolbar__input::placeholder { font-weight: 400; color: var(--vd-placeholder); }

.cab-toolbar__spacer { flex: 1; }

/* ── Pagination ───────────────────────────────────────────── */
.cab-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px;
    border-top: 1px solid var(--vd-border);
    flex-wrap: wrap;
}
.cab-pagination__info { font-size: 13px; color: var(--vd-muted); font-weight: 600; }
.cab-pagination__btns { display: flex; gap: 4px; }
.cab-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    background: var(--vd-white);
    color: var(--vd-text);
    font-family: var(--vd-font-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--vd-transition);
    text-decoration: none;
}
.cab-page-btn:hover { border-color: var(--vd-brand); color: var(--vd-brand); }
.cab-page-btn--active { background: var(--vd-brand); border-color: var(--vd-brand); color: #fff; }
.cab-page-btn--disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Order timeline ───────────────────────────────────────── */
.order-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    position: relative;
    padding: 8px 0;
    overflow-x: auto;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 80px;
    position: relative;
}
.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: var(--vd-border);
    z-index: 0;
}
.timeline-step--done:not(:last-child)::after { background: var(--vd-brand); }

.timeline-step__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--vd-border);
    border: 2px solid var(--vd-white);
    box-shadow: 0 0 0 2px var(--vd-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 1;
    transition: all var(--vd-transition);
    margin-bottom: 8px;
    flex-shrink: 0;
}
.timeline-step--done .timeline-step__dot {
    background: var(--vd-brand);
    box-shadow: 0 0 0 2px var(--vd-brand-mid);
    color: #fff;
}
.timeline-step--active .timeline-step__dot {
    background: var(--vd-brand);
    box-shadow: 0 0 0 4px var(--vd-brand-mid);
    color: #fff;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 4px var(--vd-brand-mid); }
    50% { box-shadow: 0 0 0 7px rgba(255,107,43,0.15); }
}

.timeline-step__label {
    font-size: 11px;
    font-weight: 700;
    color: var(--vd-muted);
    text-align: center;
    line-height: 1.3;
    max-width: 80px;
}
.timeline-step--done .timeline-step__label,
.timeline-step--active .timeline-step__label { color: var(--vd-brand); }

.timeline-step__date {
    font-size: 10px;
    color: var(--vd-muted);
    text-align: center;
    margin-top: 2px;
    font-weight: 600;
}

/* ── Order items mini table ───────────────────────────────── */
.order-items { display: flex; flex-direction: column; gap: 0; }

.order-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--vd-border);
    align-items: center;
}
.order-item:first-child { padding-top: 0; }
.order-item:last-child { border-bottom: none; padding-bottom: 0; }

.order-item__img {
    width: 52px;
    height: 52px;
    border-radius: var(--vd-radius-sm);
    background: var(--vd-surface);
    border: 1px solid var(--vd-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}
.order-item__img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

.order-item__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--vd-ink);
    line-height: 1.4;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.order-item__name a { color: inherit; text-decoration: none; }
.order-item__name a:hover { color: var(--vd-brand); }
.order-item__qty { font-size: 12px; color: var(--vd-muted); font-weight: 600; }

.order-item__price {
    font-family: var(--vd-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--vd-ink);
    white-space: nowrap;
    text-align: right;
}

/* ── Company card ─────────────────────────────────────────── */
.company-card {
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-md);
    overflow: hidden;
    transition: box-shadow var(--vd-transition);
}
.company-card:hover { box-shadow: var(--vd-shadow); }

.company-card__head {
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--vd-border);
}
.company-card__name {
    font-family: var(--vd-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--vd-ink);
    margin-bottom: 4px;
}
.company-card__bin { font-size: 12px; color: var(--vd-muted); font-weight: 600; }

.company-card__body {
    padding: 16px 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}
.company-field__label { font-size: 11px; font-weight: 700; color: var(--vd-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.company-field__val   { font-size: 13px; font-weight: 600; color: var(--vd-text); line-height: 1.4; }

.company-card__foot {
    padding: 12px 22px;
    border-top: 1px solid var(--vd-border);
    background: var(--vd-surface);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Empty state ──────────────────────────────────────────── */
.cab-empty {
    padding: 56px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.cab-empty__icon { font-size: 52px; margin-bottom: 14px; opacity: 0.5; }
.cab-empty__title {
    font-family: var(--vd-font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--vd-ink);
    margin-bottom: 6px;
}
.cab-empty__sub { font-size: 14px; color: var(--vd-muted); margin-bottom: 22px; line-height: 1.6; max-width: 360px; }

/* Toggle switch → см. ui.css */

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .cab-mobile-tabs { display: flex; }
    .vd-form-row     { grid-template-columns: 1fr; }
    .vd-form-row--3  { grid-template-columns: 1fr; }
    .cab-card__body  { padding: 16px; }
    .cab-card__head  { padding: 14px 16px; }
    .vd-form-actions { flex-direction: column; align-items: stretch; }
    .company-card__body { grid-template-columns: 1fr; }
    .cab-toolbar { gap: 8px; }
    .cab-toolbar__spacer { display: none; }
}

@media (max-width: 480px) {
    .order-timeline { gap: 0; }
    .timeline-step__label { font-size: 10px; max-width: 64px; }
}
