/* ===== Variables & Reset ===== */
:root {
  --color-primary: #4f46e5;
  --color-primary-dark: #4338ca;
  --color-primary-light: #eef2ff;
  --color-secondary: #06b6d4;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-text: #1f2937;
  --color-text-light: #6b7280;
  --color-bg: #f9fafb;
  --color-white: #ffffff;
  --color-border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --font-main: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
  background: var(--color-white);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary-light); }

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover { background: var(--color-bg); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Header ===== */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
}
.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-link {
  font-weight: 500;
  color: var(--color-text-light);
}
.nav-link:hover { color: var(--color-primary); }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #f0f9ff 100%);
  padding: 90px 0;
  text-align: center;
}
.hero-title {
  font-size: 44px;
  font-weight: 800;
  max-width: 800px;
  margin: 0 auto 20px;
  color: var(--color-text);
}
.hero-subtitle {
  font-size: 19px;
  color: var(--color-text-light);
  max-width: 620px;
  margin: 0 auto 36px;
}

/* ===== Sections ===== */
.section-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 48px;
}

.benefits { padding: 80px 0; }
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.benefit-card {
  background: var(--color-white);
  padding: 36px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.benefit-icon { font-size: 40px; margin-bottom: 16px; }
.benefit-card h3 { font-size: 19px; margin-bottom: 12px; }
.benefit-card p { color: var(--color-text-light); font-size: 15px; }

.how-it-works { background: var(--color-white); padding: 80px 0; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.step-card { text-align: center; padding: 20px; }
.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  margin: 0 auto 16px;
}
.step-card h3 { margin-bottom: 10px; font-size: 18px; }
.step-card p { color: var(--color-text-light); font-size: 15px; }

.cta-section {
  background: var(--color-primary);
  color: #fff;
  padding: 70px 0;
  text-align: center;
}
.cta-inner h2 { font-size: 30px; margin-bottom: 12px; }
.cta-inner p { font-size: 17px; margin-bottom: 28px; opacity: 0.9; }
.cta-section .btn-primary {
  background: #fff;
  color: var(--color-primary);
}
.cta-section .btn-primary:hover { background: var(--color-bg); }

/* ===== Footer ===== */
.site-footer {
  background: #111827;
  color: #9ca3af;
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: #fff; }

/* ===== Auth Pages ===== */
.auth-main {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}
.auth-box {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
}
.auth-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 28px;
  text-align: center;
}
.auth-form .form-group { margin-bottom: 20px; }
.auth-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}
.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color 0.2s ease;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.form-error {
  background: #fef2f2;
  color: var(--color-danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
}
.form-success {
  background: #f0fdf4;
  color: var(--color-success);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
}
.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--color-text-light);
}
.auth-switch a { color: var(--color-primary); font-weight: 600; }

/* ===================================================== */
/* ===== Dashboard Layout (для личного кабинета) ===== */
/* ===================================================== */

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: #111827;
  color: #d1d5db;
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar-logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  padding: 0 24px 24px;
  display: block;
}
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-link {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  color: #9ca3af;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-link.active {
  color: #fff;
  background: rgba(79,70,229,0.2);
  border-left-color: var(--color-primary);
}

.dashboard-main {
  flex: 1;
  padding: 32px;
  max-width: 100%;
  overflow-x: auto;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.dashboard-topbar h1 { font-size: 26px; font-weight: 700; }
.user-menu {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-light);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.tab-btn:hover { color: var(--color-primary); }
.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Stat Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
}
.stat-card .stat-change {
  font-size: 13px;
  margin-top: 6px;
}
.stat-change.positive { color: var(--color-success); }
.stat-change.negative { color: var(--color-danger); }

/* ===== Cards ===== */
.card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.card-header h3 { font-size: 18px; font-weight: 700; }

/* ===== Tables ===== */
.table-wrapper { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.data-table th {
  font-weight: 700;
  color: var(--color-text-light);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.4px;
}
.data-table tr:hover { background: var(--color-bg); }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-low { background: #e0f2fe; color: #0369a1; }
.badge-medium { background: #fef3c7; color: #b45309; }
.badge-high { background: #fee2e2; color: #b91c1c; }
.badge-planned { background: #e5e7eb; color: #374151; }
.badge-in_progress { background: #dbeafe; color: #1d4ed8; }
.badge-done { background: #dcfce7; color: #15803d; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }
.badge-active { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }

/* ===== Forms (dashboard) ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group-inline { margin-bottom: 16px; }
.form-group-inline label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}
.form-group-inline input,
.form-group-inline select,
.form-group-inline textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}
.form-group-inline textarea { resize: vertical; min-height: 80px; }

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--color-text-light);
}

/* ===== Project color dots ===== */
.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--color-text-light);
}
.empty-state .empty-icon { font-size: 44px; margin-bottom: 14px; }

/* ===== Pricing / subscription ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.pricing-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
}
.pricing-card.featured { border-color: var(--color-primary); }
.pricing-card .price { font-size: 36px; font-weight: 800; margin: 16px 0; }
.pricing-card .price span { font-size: 15px; color: var(--color-text-light); font-weight: 500; }

/* ===== Notification list ===== */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--color-primary-light); border-radius: var(--radius-sm); padding: 14px; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  margin-top: 6px;
  flex-shrink: 0;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-text);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 2000;
  font-size: 14px;
  animation: fadeIn 0.3s ease;
}
.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-danger); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .benefits-grid, .steps-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 32px; }
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}
</style>