/* ============================================================
   pages.css – СТРАНИЦЫ: ДАШБОРД, ЗАКАЗЫ, ПРОЕКТЫ, ФИНАНСЫ
   ============================================================ */

/* ---- 1. ДАШБОРД ---- */
.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: transparent;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 20px;
}
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
.dashboard-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}
.card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 8px;
}
.card-label {
  font-size: 14px;
  color: var(--text-secondary);
}
.dashboard-chart-block {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.chart-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}
.chart-period-selector {
  display: flex;
  gap: 8px;
}
.period-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: 0.2s;
  color: var(--text-primary);
}
.period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.period-btn:hover:not(.active) {
  background: rgba(0,0,0,0.05);
}
body.dark-theme .period-btn:hover:not(.active) {
  background: rgba(255,255,255,0.1);
}
.chart-container {
  min-height: 300px;
  width: 100%;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* ---- 2. ПРИВЕТСТВЕННЫЙ БЛОК ---- */
.welcome-block {
  background: var(--card-bg);
  border-radius: var(--border-radius-card);
  padding: var(--spacing-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.welcome-left {
  flex: 1;
}
.welcome-greeting {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}
.verification-status .verified {
  color: #10b981;
}
.verification-status .unverified {
  color: #f59e0b;
}
.welcome-right {
  display: flex;
  gap: 30px;
  align-items: flex-end;
  min-width: 300px;
}
.balance-item {
  text-align: right;
  min-width: 100px;
}
.balance-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  white-space: nowrap;
}
.balance-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.withdraw-item {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.withdraw-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.withdraw-button:hover {
  background: var(--accent-hover);
}

/* ---- 3. ЗАКАЗЫ, ПРОЕКТЫ, ФИНАНСЫ (общая структура) ---- */
.orders-section,
.projects-section,
.finance-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.orders-header,
.projects-header,
.finance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.orders-title,
.projects-title,
.finance-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.orders-block,
.projects-block,
.finance-block {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.orders-filters,
.finance-filters {
  margin-bottom: 16px;
  flex-shrink: 0;
}
.orders-filters .filter-input,
.finance-filters .filter-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.orders-filters .filter-input:focus,
.finance-filters .filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139,92,246,0.2);
}
#sectionContent {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* ---- 4. КОММЕРЧЕСКИЕ ПРЕДЛОЖЕНИЯ (вкладка в заказах) ---- */
.proposals-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.proposals-filters .filter-select,
.proposals-filters .filter-input {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
}
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.template-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.template-card-header h3 {
  margin: 0;
  font-size: 18px;
}
.template-card-body {
  flex: 1;
}
.template-card-body p {
  margin: 8px 0;
  color: var(--text-secondary);
}
.template-card-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}
.template-card-footer {
  margin-top: 16px;
  text-align: right;
}
.template-card-footer .action-button {
  width: 100%;
}
.badge-status.template {
  background: #fef3c7;
  color: #92400e;
}
body.dark-theme .badge-status.template {
  background: #78350f;
  color: #fcd34d;
}

/* ---- 5. РАЗДЕЛ "ЗАКАЗЫ" (детали) ---- */
.order-detail-content .order-meta {
  margin-bottom: 16px;
}
.order-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.order-meta-item {
  display: flex;
  flex-direction: column;
}
.order-meta-item .meta-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.order-meta-item .meta-value {
  font-size: 15px;
  font-weight: 500;
}
.order-docs-section {
  margin-top: 16px;
}
.order-docs-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.order-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.order-tab {
  background: none;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}
.order-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.order-tab-content .tab-pane {
  display: none;
}
.order-tab-content .tab-pane.active {
  display: block;
}
.empty-docs {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}
.doc-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Стили для вкладок документов в панели проекта */
.project-doc-tab {
  background: none;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}
.project-doc-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.project-doc-pane {
  display: none;
}
.project-doc-pane.active {
  display: block;
}