/*
 * Path: /public/css/app-orders-dashboard.css
 * File: app-orders-dashboard.css (v2.1 - Cleaned: Removed duplicates for Modals/Tabs/Summary)
 */

/* ==========================================================================
   MASTER SUMMARY BLOCK (Dashboard Overview)
   ========================================================================== */

.master-summary-block {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: var(--space-4);
    background-color: var(--background-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-5);
}

/* Digital Soul Ring Wrapper (левая колонка) */
.ds-ring-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.ds-ring-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    z-index: 1;
}

.ds-segment {
    stroke-width: 5;
    fill: none;
    stroke-linecap: butt;
    transition: stroke-dashoffset 1s ease-out;
}

.ds-segment-bg {
    stroke: #e2e8f0;
    stroke-width: 5;
    fill: none;
}

.summary-avatar-container {
    width: 100px;
    height: 100px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
}

.summary-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Summary Info (правая колонка) */
.summary-info {
    text-align: left;
}

.summary-info h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--space-1);
    display: flex;
    align-items: center;
}

.summary-role {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: var(--space-1);
}

.summary-ds-score {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

/* Tariff Badge */
.summary-tariff-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 15px;
    font-size: 1.5rem;
    line-height: 1;
}

.summary-tariff-badge.is-pro i {
    color: var(--primary-color, #4f46e5);
    text-shadow: 0 0 5px rgba(79, 70, 229, 0.6);
}

.summary-tariff-badge.is-premium i {
    color: #f59e0b;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

/* Кнопка «что такое Digital Soul?» */
.digital-soul-trigger {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1rem;
    margin-left: 5px;
    padding: 0;
}

.digital-soul-trigger:hover {
    color: var(--text-regular);
}

.ds-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Адаптив для summary-блока */
@media (max-width: 768px) {
    .master-summary-block {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-info {
        width: 100%;
    }

    .summary-info h2 {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   DASHBOARD HOME (index.php)
   ========================================================================== */

.dashboard-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    margin-top: 30px;
}

.dashboard-sidebar-col {
    /* колонка под сайдбар */
}

.dashboard-content-col {
    /* контент справа */
}

/* Шапка дашборда */
.dashboard-header {
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.dash-profile-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dash-avatar-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.dash-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #f1f5f9;
}

.dash-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.dash-user-details h1 {
    margin: 0 0 6px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-meta-row {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #64748b;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.dash-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-verified {
    color: #10b981;
    font-size: 1rem;
}

.badge-tariff {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rating-star {
    color: #f59e0b;
}

.rating-val {
    font-weight: 700;
    color: #1e293b;
}

/* Кнопки справа в шапке */
.dash-actions {
    display: flex;
    gap: 10px;
}

.btn-dash-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
}

.btn-dash-action:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-dash-logout {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

.btn-dash-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.bg-green-light { background: #dcfce7; }
.text-green      { color: #166534; }
.bg-yellow-light { background: #fef9c3; }
.text-yellow     { color: #854d0e; }
.bg-blue-light   { background: #dbeafe; }
.text-blue       { color: #1e40af; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    display: block;
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
}

.stat-link {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.stat-link:hover {
    text-decoration: underline;
}

.border-primary-light {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

/* Утилиты */
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.h-100 { height: 100%; }

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Клиентский hero-блок */
.dashboard-client-hero {
    background: linear-gradient(135deg, #5D3EFF 0%, #3b82f6 100%);
    color: #ffffff;
    border: none;
}

.dashboard-client-hero__title {
    color: #ffffff;
    margin-bottom: 10px;
}

.dashboard-client-hero__text {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.dashboard-client-hero__actions {
    display: flex;
    gap: 10px;
}

.dashboard-client-hero__btn {
    background: #ffffff;
    color: #5D3EFF;
    border: none;
}

/* Заказы клиента */
.dashboard-client-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-client-orders-header__link {
    text-decoration: none;
    font-size: 0.875rem;
    color: var(--primary-color, #3b82f6);
}

/* Публичный профиль (ссылка) */
.dashboard-public-profile-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.dashboard-public-profile-link {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-public-profile-link__input {
    background-color: #f8f9fa;
    color: #334155;
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.dashboard-copy-message {
    display: none;
}

.dashboard-master-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 991px) {
    .dashboard-wrapper {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar-col {
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard-master-bottom-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-header {
        padding: 16px;
    }
}

/* ==========================================================================
   DASHBOARD PROFILE (profile.php)
   ========================================================================== */

.avatar-section {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: flex-start;
}

@media (max-width: 992px) {
    .avatar-section {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.current-avatar-preview {
    text-align: center;
}

.current-avatar-preview img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.current-avatar-preview .form-label {
    margin-bottom: 12px;
    color: var(--text-dark);
    font-weight: 600;
}

/* Specializations Grid */
.specialization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem 1rem;
    padding: 1rem;
    background-color: var(--background-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-lg);
}

.spec-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.spec-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
    margin: 0;
}

.spec-checkbox input[type="checkbox"]:hover {
    border-color: var(--primary-color);
}

.spec-checkbox input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.spec-checkbox input[type="checkbox"]:checked::after {
    content: '\2713';
    font-size: 14px;
    color: #ffffff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.spec-checkbox label {
    color: var(--text-regular);
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0;
}

.helper-text code {
    background-color: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    color: var(--text-dark);
}

/* ==========================================================================
   DASHBOARD SERVICES - PRICE LIST
   ========================================================================== */

.price-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    transition: background-color 0.2s ease, opacity 0.3s ease, transform 0.2s ease;
}
.price-item.is-deleting {
    opacity: 0;
    transform: scale(0.95);
}
.price-item:last-child {
    border-bottom: none;
}
.price-item:hover {
    background-color: #f8fafc;
}

.drag-handle {
    cursor: grab;
    color: #94a3b8;
    padding: 0.5rem;
    margin-left: -0.5rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}
.price-item:hover .drag-handle {
    opacity: 1;
}

.price-item__info {
    overflow: hidden;
}
.price-item__name {
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-item__price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4f46e5;
    white-space: nowrap;
    text-align: right;
}
.price-item__price .price-prefix,
.price-item__price .price-unit {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
}

.price-item__actions {
    display: flex;
    gap: 0.5rem;
}

/* Файлы прайса */
.file-upload-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border: 2px dashed #e2e8f0;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s;
    background: #f9fafb;
}
.file-upload-area:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.file-upload-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.file-upload-status {
    font-size: 0.9rem;
    color: #475569;
    margin-left: 0.5rem;
}

.file-list {
    padding: 0;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease, opacity 0.3s ease;
    background: #ffffff;
}
.file-item:last-child {
    border-bottom: none;
}
.file-item:hover {
    background-color: #f8fafc;
}

.file-item .drag-handle {
    margin-right: 0.5rem;
    margin-left: -0.5rem;
    cursor: grab;
    color: #94a3b8;
    opacity: 0.6;
    padding: 0.5rem;
}

.file-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
    width: 30px;
    text-align: center;
}

.file-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: #334155;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

#file-list-sortable .sortable-ghost {
    opacity: 0.4;
    background: #e0e7ff;
}

/* Лимиты и хедер */
.services-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.limit-status-bar {
    flex-grow: 1;
    max-width: 520px;
    background: #f8fafc;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.limit-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.9rem;
}

.limit-count {
    font-weight: 600;
}

.mt-2 {
    margin-top: 0.5rem;
}

.progress-bar-container {
    width: 100%;
    background-color: #e2e8f0;
    border-radius: 999px;
    height: 8px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#file-upload-spinner .fa-spinner {
    animation: spin 1s linear infinite;
}

#save-service-btn .spinner {
    display: none;
    margin-right: 0.5rem;
}
#save-service-btn.is-loading .spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}
#save-service-btn.is-loading .button-text {
    opacity: 0.7;
}

.limit-warning {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.5rem;
}
.limit-warning strong {
    color: #0f172a;
}

/* Сегментный переключатель (тип услуги) */
.segmented-control {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 999px;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.segmented-control label {
    flex: 1;
    position: relative;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
    margin-bottom: 0;
    z-index: 1;
}

.segmented-control input {
    display: none;
}

.segmented-control__text {
    display: block;
    padding: 8px 18px;
    border-radius: 999px;
    line-height: 1.2;
    font-size: 0.9rem;
    white-space: nowrap;
}

.segmented-control input:checked + .segmented-control__text {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
    font-weight: 600;
}

/* Чистые табы в модалке (UK/RU) */
.clean-tabs {
    display: none;
    gap: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.clean-tab-item {
    padding: 0.5rem 0;
    cursor: pointer;
    color: #64748b;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.clean-tab-item.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}
.clean-tab-item:hover {
    color: #1e293b;
}

/* Формы внутри модалки (общие стили) */
#service-modal .form-group {
    margin-bottom: 1rem;
}
#service-modal .form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 0.35rem;
}
#service-modal .form-control {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    background-color: #f9fafb;
}
#service-modal .form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.4);
    background-color: #ffffff;
}
#service-modal select.form-control {
    background-image:
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 3px),
        calc(100% - 11px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
}
#service-modal textarea.form-control {
    resize: vertical;
    min-height: 70px;
}
#service-modal .clean-separator {
    border: 0;
    border-top: 1px dashed #e2e8f0;
}
#service-modal .btn--primary.btn--block {
    margin-top: 0.75rem;
    height: 44px;
    border-radius: 999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#form-errors {
    font-size: 0.9rem;
    border-radius: 10px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Адаптив сервисов */
@media (max-width: 768px) {
    .services-header-actions {
        flex-direction: column;
    }
    .limit-status-bar {
        max-width: 100%;
        width: 100%;
    }
    .price-item {
        grid-template-columns: auto 1fr auto;
        padding: 1rem;
    }
    .price-item__price {
        grid-column: 2 / 3;
        text-align: left;
        margin-top: 0.25rem;
    }
    .price-item__info {
        grid-column: 2 / 3;
    }
    .price-item__actions {
        grid-column: 3 / 4;
        grid-row: 1 / 3;
    }
    .drag-handle {
        grid-row: 1 / 3;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   PORTFOLIO MANAGEMENT
   ========================================================================== */

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.alert--warning {
    background-color: var(--warning-color-light, #fffbeb);
    border: 1px solid var(--warning-color, #f59e0b);
    color: var(--warning-color-dark, #92400e);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
}
.alert--warning a {
    color: var(--warning-color-dark, #92400e);
    text-decoration: underline;
    font-weight: 600;
}
.alert--danger {
    background-color: #fef2f2;
    border: 1px solid #ef4444;
    color: #b91c1c;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
}
.alert--danger a {
    color: #b91c1c;
    text-decoration: underline;
    font-weight: 600;
}

.portfolio-management-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.portfolio-management-item {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color-light);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.portfolio-management-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}
.portfolio-management-item.fading-out {
    opacity: 0;
    transform: scale(0.9);
}
.portfolio-management-item .item-thumbnail {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}
.portfolio-management-item .item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
}
.portfolio-management-item .item-actions {
    margin-top: 0.25rem;
    display: flex;
    gap: 0.5rem;
}
.upload-zone.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .action-buttons {
        width: 100%;
    }
    .action-buttons .btn {
        width: 100%;
    }
    .portfolio-management-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 480px) {
    .portfolio-management-list {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   MASTER ORDERS LIST
   ========================================================================== */

.order-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.order-tab-link {
    padding: 0.75rem 1.25rem;
    margin-bottom: -1px;
    border: 1px solid transparent;
    border-bottom: none;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.order-tab-link:hover {
    color: var(--primary-color);
    background-color: var(--primary-color-light);
}

.order-tab-link.active {
    color: var(--primary-color);
    font-weight: 600;
    border-color: var(--border-color);
    background-color: #ffffff;
    border-bottom-color: #ffffff;
}

.tab-count {
    background-color: var(--border-color-light);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 99px;
    min-width: 20px;
    text-align: center;
}
.order-tab-link.active .tab-count {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Список заказов */
.master-order-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.master-order-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.master-order-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
}
.master-order-item.is-new {
    border-left: 4px solid var(--primary-color);
    background: #f7f5ff;
}

.order-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color-light);
}

.client-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.client-info__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.client-info__name {
    font-weight: 600;
    color: var(--text-dark);
}
.client-info__date {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.order-item-body {
    padding: 1.5rem 0;
}
.order-item-body p {
    margin: 0 0 0.5rem 0;
    color: var(--text-regular);
}
.order-item-body strong {
    color: var(--text-dark);
}

.order-attachments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color-light);
}
.attachments-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    display: block;
}
.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.attachment-item a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-regular);
    transition: all 0.2s ease;
}
.attachment-item a:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-color-light);
    color: var(--primary-color);
}
.attachment-item img.thumbnail {
    width: 40px;
    height: 30px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color-light);
}
.attachment-item span.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.client-contact-info {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color-light);
    font-size: 0.9rem;
}
.client-contact-info span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-regular);
}

.order-item-actions {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color-light);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.btn--danger-outline {
    background: transparent;
    border: 1px solid var(--error-color, #ef4444);
    color: var(--error-color, #ef4444);
}
.btn--danger-outline:hover:not(:disabled) {
    background: var(--error-color-light, #fef2f2);
}
.btn--secondary-outline {
    background: transparent;
    border: 1px solid var(--text-light, #64748b);
    color: var(--text-light, #64748b);
}
.btn--secondary-outline:hover:not(:disabled) {
    background: var(--border-color-light, #f1f5f9);
    border-color: var(--text-regular, #334155);
    color: var(--text-regular, #334155);
}

/* Статусы заказов */
.order-item__status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}
.status--success {
    background-color: var(--success-color-light);
    color: var(--success-color);
}
.status--danger {
    background-color: var(--error-color-light);
    color: var(--error-color);
}
.status--warning {
    background-color: var(--warning-color-light);
    color: var(--warning-color);
}
.status--pending {
    background-color: var(--border-color-light);
    color: var(--text-light);
}

.card--plain {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}
.card--empty-state {
    padding: 3rem 1rem;
}
.master-orders-empty-icon {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.load-more-container {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 1.5rem;
}
#load-more-orders-btn .spinner {
    display: none;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}
#load-more-orders-btn.is-loading .spinner {
    display: inline-block;
}
#load-more-orders-btn.is-loading .button-text {
    opacity: 0.7;
}

/* Заказы клиента (список) */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.order-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    background: var(--background-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}
.order-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.order-item__avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.order-item__details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}
.order-item__info {
    max-width: 100%;
}
.order-item__master-name {
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
}
.order-item__master-name:hover {
    color: var(--primary-color);
    text-decoration: none;
}
.order-item__date {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
}
.order-item__contact {
    font-size: 0.9rem;
    color: var(--text-regular);
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.order-item__contact strong {
    color: var(--text-dark);
}
.order-item__actions {
    text-align: right;
    flex-shrink: 0;
}

/* REVIEW FORM */
.review-form-rating {
    display: flex;
    gap: 0.5rem;
    font-size: 1.75rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}
.review-form-rating .star {
    cursor: pointer;
    transition: color 0.2s ease;
}
.review-form-rating .star:hover,
.review-form-rating .star.selected {
    color: #f59e0b;
}

/* ALERTS CLIENT DASHBOARD */
.alert.alert--warning {
    background-color: var(--warning-color-light);
    color: #b45309;
    border: 1px solid #fde68a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert.alert--warning .icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}
.alert.alert--warning a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .order-item {
        grid-template-columns: 40px 1fr;
    }
    .order-item__details {
        flex-direction: column;
        align-items: flex-start;
    }
    .order-item__actions {
        width: 100%;
        text-align: left;
    }
}  