/* PMIS РВК.Экосервис — стартовая страница */

:root {
  --blue-deep: #0a3d62;
  --blue-mid: #1e5f8a;
  --blue-light: #3d8fd1;
  --accent: #00a8e8;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #1a2b3c;
  --muted: #6b7c93;
  --border: #d8e2ec;
  --error: #c0392b;
  --success: #27ae60;
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

/* Login page only — do NOT apply flex-centering to dashboards */
body:not(.dashboard) {
  background: linear-gradient(135deg, #0a3d62 0%, #1e5f8a 45%, #2980b9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dashboard {
  display: block;
  background: var(--bg);
  align-items: initial;
  justify-content: initial;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 24px;
}

.login-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.login-header {
  background: linear-gradient(180deg, var(--blue-deep), var(--blue-mid));
  color: #fff;
  padding: 32px 32px 28px;
  text-align: center;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.login-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.login-header .subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 400;
}

.login-header .org {
  margin-top: 12px;
  font-size: 0.75rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-body {
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.15);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(180deg, var(--blue-light), var(--blue-mid));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 8px;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(10, 61, 98, 0.35);
}

.btn-login:active {
  transform: translateY(0);
}

.error-msg {
  background: #fdf0ef;
  border: 1px solid #f5c6cb;
  color: var(--error);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.login-footer {
  padding: 16px 32px 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.login-footer a {
  color: var(--blue-mid);
  text-decoration: none;
}

/* Dashboard */
.dashboard {
  min-height: 100vh;
  background: var(--bg);
}

.dashboard-nav {
  background: var(--blue-deep);
  color: #fff;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-nav .brand {
  font-weight: 700;
  font-size: 1rem;
}

.dashboard-nav .user-info {
  font-size: 0.85rem;
  opacity: 0.9;
}

.dashboard-nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.85rem;
  opacity: 0.85;
}

.dashboard-nav a:hover {
  opacity: 1;
}

.dashboard-nav a.brand-link {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
}

.dashboard-nav a.brand-link:hover {
  opacity: 0.9;
}

.dashboard-nav a.nav-home {
  font-weight: 600;
  opacity: 1;
  margin-right: 4px;
}

.dashboard-main {
  max-width: 1280px;
  margin: 32px auto;
  padding: 0 28px 48px;
}

.dashboard-main-wide {
  max-width: 1440px;
}

.welcome-card {
  background: var(--card);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.welcome-card h2 {
  font-size: 1.5rem;
  color: var(--blue-deep);
  margin-bottom: 8px;
}

.welcome-card .role-badge {
  display: inline-block;
  background: #e8f4fc;
  color: var(--blue-mid);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 12px 0 24px;
}

.welcome-card p {
  color: var(--muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 24px;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
  text-align: left;
}

@media (max-width: 1100px) {
  .modules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.module-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.module-tile h3 {
  font-size: 0.9rem;
  color: var(--blue-deep);
  margin-bottom: 6px;
}

.module-tile span {
  font-size: 0.75rem;
  color: var(--muted);
}

.module-tile.disabled {
  opacity: 0.5;
}

.env-badge {
  position: fixed;
  bottom: 12px;
  right: 12px;
  background: #f39c12;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* PMIS web — mobile layout (appended to style.css) */

html { -webkit-text-size-adjust: 100%; }

@media (max-width: 900px) {
  .dashboard-nav {
    height: auto;
    min-height: 56px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .dashboard-nav > div {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    align-items: center;
  }
  .dashboard-nav a {
    margin-left: 0;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.82rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
  .dashboard-nav .user-info {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .dashboard-main,
  .dashboard-main-wide {
    margin: 16px auto;
    padding: 0 12px;
    max-width: 100%;
  }
  .welcome-card {
    padding: 20px 16px;
    border-radius: 10px;
  }
  .welcome-card h2 { font-size: 1.25rem; }
  .welcome-card p { margin-bottom: 16px; }
  .modules-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
  }
  .module-tile {
    padding: 16px;
    min-height: 72px;
  }
  .module-tile h3 { font-size: 1rem; }
  .module-tile span { font-size: 0.8rem; }
  .login-wrapper { padding: 16px; }
  .login-card { width: 100%; max-width: 100%; margin: 0; }
  .env-badge { bottom: 8px; right: 8px; }
}

@media (max-width: 720px) {
  .dashboard-nav a.brand-link { font-size: 0.95rem; }
  .welcome-card .role-badge { margin: 8px 0 16px; }
  input, select, textarea, button {
    font-size: 16px;
  }
  button, .btn, a.btn {
    min-height: 44px;
  }
}

/* Переход в модуль контроля ведения проекта с входного дашборда */
a.module-tile,
a.module-tile.active {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow .2s, border-color .2s;
}
a.module-tile:hover,
a.module-tile.active:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  border-color: #3b82f6;
}
#tile-project-control {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, var(--bg, #fff) 100%);
}

/* restored: clickable module tiles */
a.module-tile,
a.module-tile.active {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
a.module-tile:hover,
a.module-tile.active:hover {
  filter: brightness(1.03);
}
a.leadership-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
}

/* Desktop layout restore (2026-07-20) */
body.dashboard .dashboard-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  gap: 16px;
}
body.dashboard .dashboard-nav > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  overflow: visible;
}
body.dashboard .leadership-quick,
body.dashboard .module-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
body.dashboard .leadership-section .leadership-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1100px) {
  body.dashboard .leadership-section .leadership-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  body.dashboard .leadership-section .leadership-grid {
    grid-template-columns: 1fr;
  }
  body.dashboard .modules-grid {
    grid-template-columns: 1fr;
  }
}

/* PMIS home dashboards — contrast fix for leadership cards & module tiles
 * Problem: a.leadership-card { color: inherit } pulled dark page text onto navy cards.
 * Solution: keep brand navy cards; titles light-blue/white; KPI gold-yellow.
 */

/* --- Leadership / dashboard cards (тёмный бренд-фон) --- */
.leadership-card,
a.leadership-card,
a.leadership-card:visited {
  background: linear-gradient(145deg, #0b4a73 0%, #1a6a9c 55%, #2580b8 100%) !important;
  color: #f5fbff !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 20px rgba(10, 61, 98, 0.28);
}

.leadership-card:hover,
a.leadership-card:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 28px rgba(10, 61, 98, 0.4);
  color: #ffffff !important;
}

.leadership-title {
  color: #b8e0f5 !important; /* светло-голубой */
  opacity: 1 !important;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.leadership-kpi {
  color: #f5d76e !important; /* золото-жёлтый */
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.leadership-sub {
  color: #e8f4fc !important; /* почти белый с голубым */
  opacity: 1 !important;
}

.leadership-section h3 {
  color: var(--blue-deep, #0a3d62);
}

/* --- Module tiles (светлые плитки модулей) --- */
.module-tile,
a.module-tile,
a.module-tile.active {
  background: #ffffff !important;
  border: 1px solid #c5d6e6 !important;
  color: #12324a !important;
  box-shadow: 0 2px 10px rgba(15, 55, 90, 0.06);
}

.module-tile h3,
a.module-tile h3 {
  color: #0a3d62 !important;
  font-weight: 700;
}

.module-tile span,
a.module-tile span {
  color: #4a6780 !important;
}

a.module-tile:hover,
a.module-tile.active:hover {
  border-color: #3d8fd1 !important;
  background: linear-gradient(180deg, #f3f9ff 0%, #ffffff 70%) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.14);
}

#tile-project-control {
  border-color: #2563eb !important;
  background: linear-gradient(180deg, #eef5ff 0%, #ffffff 75%) !important;
}

#tile-project-control h3 {
  color: #1d4ed8 !important;
}
