/* ═══════════════════════════════════════════════
   Aprazer Russia — Main Stylesheet
   ═══════════════════════════════════════════════ */

:root {
  --brand:        #1a6b4a;
  --brand-light:  #e8f5ee;
  --brand-mid:    #2d8f63;
  --accent:       #0e4d35;
  --admin-color:  #1e3a5f;
  --admin-light:  #e8eef7;

  --bg:           #f7f8fa;
  --surface:      #ffffff;
  --border:       #e2e6ea;
  --text:         #1a1d23;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;

  --status-done:    #16a34a;
  --status-active:  #2563eb;
  --status-pending: #6b7280;
  --status-blocked: #dc2626;

  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07);

  --font:  'Inter', system-ui, -apple-system, sans-serif;
  --nav-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  box-shadow: var(--shadow-sm);
  gap: 8px;
}

.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0; margin-right: 4px;
}
.brand-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; flex-shrink: 0;
}
.brand-text { font-weight: 700; font-size: .95rem; color: var(--text); }
.brand-sub  { color: var(--brand); font-weight: 400; margin-left: 2px; }

/* Desktop links */
.navbar-links {
  display: flex; align-items: center; gap: 2px;
  flex: 1; overflow: hidden;
}
.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .82rem; font-weight: 500;
  white-space: nowrap; text-decoration: none;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.nav-link:hover  { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--brand-light); color: var(--brand); }
.nav-link.nav-admin             { color: var(--admin-color); }
.nav-link.nav-admin:hover       { background: var(--admin-light); }
.nav-link.nav-admin.active      { background: var(--admin-light); color: var(--admin-color); }
.nav-divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

.navbar-right {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto; flex-shrink: 0;
}

/* Lang switcher */
.lang-switcher { display: flex; align-items: center; gap: 3px; }
.lang-btn {
  font-size: .78rem; font-weight: 700; color: var(--text-muted);
  padding: 3px 7px; border-radius: 4px;
  text-decoration: none; transition: all .15s; line-height: 1.4;
}
.lang-btn:hover       { color: var(--brand); text-decoration: none; }
.lang-btn.lang-active { background: var(--brand); color: #fff; }
.lang-sep { color: var(--border); font-size: .7rem; }

/* User badge */
.user-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 500;
  padding: 4px 10px; border-radius: 20px;
}
.badge-partner { background: var(--brand-light); color: var(--brand); }
.badge-admin   { background: var(--admin-light);  color: var(--admin-color); }
.user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-logout {
  color: var(--text-muted); font-size: 1.1rem;
  padding: 4px 6px; border-radius: var(--radius-sm); transition: color .15s;
}
.btn-logout:hover { color: var(--status-blocked); text-decoration: none; }

/* ── Mobile hamburger ── */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 36px; height: 36px; cursor: pointer;
  border: none; background: none; padding: 4px; border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-muted); border-radius: 2px;
  transition: all .2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  display: none; position: fixed;
  top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: var(--surface); z-index: 199;
  flex-direction: column; overflow-y: auto;
  padding: 12px 16px 32px;
  border-top: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link {
  padding: 12px 14px; font-size: .95rem;
  border-radius: var(--radius); border-bottom: 1px solid var(--border);
}
.mobile-menu .nav-link:last-of-type { border-bottom: none; }
.mobile-menu .nav-divider { width: 100%; height: 1px; margin: 8px 0; }
.mobile-menu-footer {
  margin-top: auto; padding-top: 20px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.page-wrapper {
  max-width: 1140px; margin: 0 auto;
  padding: 28px 24px 64px;
}

/* ── Flash ── */
.flash-container { margin-bottom: 16px; }
.flash {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: .875rem; margin-bottom: 8px; line-height: 1.5;
}
.flash i { flex-shrink: 0; margin-top: 2px; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-danger  { background: #fee2e2; color: #991b1b; }
.flash-warning { background: #fef9c3; color: #854d0e; }
.flash-info    { background: #dbeafe; color: #1e40af; }

/* ── Page header ── */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-bottom: 28px; padding-bottom: 20px;
  border-bottom: 2px solid var(--brand-light);
}
.page-header-admin { border-bottom-color: var(--admin-light); }

.page-title {
  font-size: 1.5rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.page-title i { color: var(--brand); }
.page-header-admin .page-title i { color: var(--admin-color); }
.page-subtitle { color: var(--text-muted); margin-top: 4px; font-size: .88rem; line-height: 1.5; }

.progress-summary { display: flex; gap: 10px; flex-wrap: wrap; }
.progress-stat {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px; min-width: 72px;
}
.stat-num   { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .72rem; color: var(--text-muted); margin-top: 3px; text-align: center; }
.stat-active .stat-num  { color: var(--status-active); }
.stat-done .stat-num    { color: var(--status-done); }
.stat-blocked .stat-num { color: var(--status-blocked); }

/* Badges */
.phase-status-badge {
  font-size: .7rem; font-weight: 700;
  padding: 2px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.badge-done    { background: #dcfce7; color: var(--status-done); }
.badge-active  { background: #dbeafe; color: var(--status-active); }
.badge-pending { background: #f3f4f6; color: var(--text-muted); }
.badge-blocked { background: #fee2e2; color: var(--status-blocked); }

/* ══════════════════════════════════════════
   LOGIN
══════════════════════════════════════════ */
.login-page { background: linear-gradient(135deg, #0e4d35 0%, #1a6b4a 55%, #2d8f63 100%); }
.login-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  background: var(--surface); border-radius: 16px;
  padding: 36px 32px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28); position: relative;
}
.login-lang { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 4px; }
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.logo-icon {
  width: 50px; height: 50px; border-radius: 12px; background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; flex-shrink: 0;
}
.logo-main { display: block; font-size: 1.05rem; font-weight: 700; }
.logo-sub  { display: block; font-size: .78rem; color: var(--text-muted); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: .84rem; font-weight: 600; color: var(--text); }
.input-wrap { position: relative; }
.input-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1rem; pointer-events: none;
}
.form-input {
  width: 100%; padding: 11px 12px 11px 34px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .9rem; color: var(--text);
  transition: border-color .15s; outline: none; background: var(--surface);
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--brand); }
.btn-login {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 13px; font-size: .95rem; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: background .15s; margin-top: 4px;
  -webkit-appearance: none;
}
.btn-login:hover { background: var(--accent); }
.login-footer {
  margin-top: 20px; text-align: center; font-size: .78rem; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ══════════════════════════════════════════
   ROADMAP TIMELINE
══════════════════════════════════════════ */
.roadmap-timeline { display: flex; flex-direction: column; }

.timeline-item { display: flex; align-items: flex-start; }
.timeline-connector {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; width: 44px;
}
.timeline-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--surface); color: var(--text-muted); z-index: 1;
}
.status-done   .timeline-dot { background: var(--status-done);   border-color: var(--status-done);   color: #fff; }
.status-active .timeline-dot { background: var(--status-active); border-color: var(--status-active); color: #fff; }

.timeline-line { width: 2px; flex: 1; min-height: 24px; background: var(--border); margin: 3px 0; }

.timeline-card {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin: 0 0 14px 12px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s;
}
.timeline-card:hover { box-shadow: var(--shadow); }
.status-active .timeline-card { border-left: 3px solid var(--status-active); }
.status-done   .timeline-card { border-left: 3px solid var(--status-done); opacity: .85; }

.timeline-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.phase-period { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }

.timeline-title {
  font-size: 1rem; font-weight: 700;
  display: flex; align-items: flex-start; gap: 8px; color: var(--text); line-height: 1.4;
}
.timeline-title i { color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.timeline-description {
  margin-top: 8px; color: var(--text-muted); font-size: .85rem; line-height: 1.7;
}
.phase-cost-badge {
  display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap;
  background: var(--brand-light); color: var(--brand);
  border-radius: var(--radius-sm); padding: 4px 10px;
  font-size: .78rem; font-weight: 600; margin-top: 10px;
}
.phase-cost-usd { color: var(--text-muted); font-weight: 400; }

.roadmap-note {
  margin-top: 20px; padding: 12px 16px;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius-sm); font-size: .8rem; color: #92400e;
  display: flex; align-items: flex-start; gap: 8px; line-height: 1.6;
}
.roadmap-note i { flex-shrink: 0; margin-top: 2px; }

/* ══════════════════════════════════════════
   START DATE PANEL
══════════════════════════════════════════ */
.start-date-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px;
}
.start-date-panel .sdp-label {
  font-size: .84rem; font-weight: 600; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.sdp-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sdp-select {
  padding: 7px 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font);
  font-size: .85rem; color: var(--text); background: var(--surface);
  cursor: pointer; outline: none; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
.sdp-select:focus { border-color: var(--brand); }
.sdp-btn {
  padding: 7px 16px; background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius-sm); font-family: var(--font);
  font-size: .85rem; font-weight: 600; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.sdp-btn:hover { background: var(--accent); }
.sdp-current {
  font-size: .82rem; color: var(--brand); font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}

/* ══════════════════════════════════════════
   BUDGET SUMMARY
══════════════════════════════════════════ */
.budget-summary {
  background: linear-gradient(135deg, #0e4d35 0%, #1a6b4a 100%);
  border-radius: var(--radius); padding: 20px;
  color: #fff; margin-bottom: 24px;
  display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start;
}
.budget-main h3      { font-size: .82rem; font-weight: 500; opacity: .75; margin-bottom: 4px; }
.budget-total-rub    { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.budget-total-usd    { font-size: 1rem; font-weight: 600; opacity: .85; margin-top: 3px; }
.budget-rate         { font-size: .72rem; opacity: .6; margin-top: 3px; }
.budget-divider      { width: 1px; background: rgba(255,255,255,.2); align-self: stretch; min-height: 48px; }
.budget-phases       { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; }
.budget-phase-item   {
  background: rgba(255,255,255,.12); border-radius: 8px;
  padding: 8px 12px; min-width: 130px; flex: 1;
}
.bpi-title { font-size: .7rem; opacity: .7; margin-bottom: 3px; line-height: 1.3; }
.bpi-rub   { font-size: .9rem; font-weight: 700; }
.bpi-usd   { font-size: .72rem; opacity: .7; }

/* ══════════════════════════════════════════
   GANTT
══════════════════════════════════════════ */
.gantt-section        { margin: 28px 0; }
.gantt-section h2     { font-size: 1rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.gantt-wrap           { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); }
.gantt-table          { width: 100%; border-collapse: collapse; min-width: 600px; }
.gantt-table th {
  font-size: .68rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 7px 3px; background: var(--bg);
  border-bottom: 2px solid var(--border); text-align: center; white-space: nowrap;
}
.gantt-table th.th-phase { text-align: left; min-width: 150px; padding-left: 12px; }
.gantt-table td       { padding: 4px 3px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.gantt-table td.td-phase {
  font-size: .78rem; font-weight: 600; padding-left: 12px;
  white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.td-phase .phase-icon { margin-right: 5px; color: var(--brand); }
.gantt-q-header       { background: var(--bg); font-weight: 800; border-left: 2px solid var(--border); font-size: .75rem; }
.gantt-bar {
  height: 20px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: #fff;
}
.gantt-bar.bar-done    { background: var(--status-done); }
.gantt-bar.bar-active  { background: var(--status-active); }
.gantt-bar.bar-pending { background: #9ca3af; }
.gantt-bar.bar-blocked { background: var(--status-blocked); }
.gantt-empty           { height: 20px; }

/* ══════════════════════════════════════════
   PORTFOLIO
══════════════════════════════════════════ */
.portfolio-filters {
  display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px;
}
.filter-btn {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: all .15s; font-family: var(--font);
  -webkit-appearance: none;
}
.filter-btn:hover  { border-color: var(--brand); color: var(--brand); }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.portfolio-section { margin-bottom: 36px; }
.section-label {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .83rem; font-weight: 700;
  padding: 8px 14px; border-radius: var(--radius-sm); margin-bottom: 14px;
}
.section-hint { font-weight: 400; opacity: .75; }
.wave-1 { background: #fef9c3; color: #854d0e; }
.wave-2 { background: #f0fdf4; color: #166534; }

.drug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.drug-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.drug-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.drug-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 9px; gap: 6px; }
.drug-category  { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--brand-light); color: var(--brand); }
.wave-badge-1   { font-size: .68rem; color: #854d0e; background: #fef9c3; padding: 2px 7px; border-radius: 4px; font-weight: 700; white-space: nowrap; }
.wave-badge-2   { font-size: .68rem; color: #166534; background: #dcfce7; padding: 2px 7px; border-radius: 4px; font-weight: 700; white-space: nowrap; }
.drug-brand     { font-size: .92rem; font-weight: 700; margin-bottom: 2px; }
.drug-inn       { font-size: .78rem; color: var(--text-muted); margin-bottom: 9px; line-height: 1.4; }
.drug-details   { display: flex; gap: 10px; flex-wrap: wrap; font-size: .76rem; color: var(--text-muted); margin-bottom: 7px; }
.drug-details i { margin-right: 2px; }
.drug-market    { font-size: .76rem; color: var(--brand); font-weight: 600; margin-bottom: 9px; line-height: 1.4; }
.drug-status-row{ margin-top: auto; }

.reg-status     { font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.reg-not_started  { background: #f3f4f6; color: var(--text-muted); }
.reg-dossier_prep { background: #fef9c3; color: #854d0e; }
.reg-submitted    { background: #dbeafe; color: #1e40af; }
.reg-review       { background: #ede9fe; color: #5b21b6; }
.reg-registered   { background: #dcfce7; color: var(--status-done); }

/* ══════════════════════════════════════════
   ABOUT
══════════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.about-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.about-card-main { grid-column: 1 / -1; }
.about-card-icon {
  width: 42px; height: 42px; border-radius: 10px; background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-size: 20px; margin-bottom: 12px;
}
.about-card h2  { font-size: 1.15rem; margin-bottom: 10px; }
.about-card h3  { font-size: .95rem; margin-bottom: 10px; }
.about-card p   { color: var(--text-muted); font-size: .85rem; line-height: 1.7; margin-bottom: 8px; }
.about-list     { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.about-list li  { font-size: .85rem; color: var(--text-muted); display: flex; align-items: flex-start; gap: 6px; }
.about-list i   { color: var(--brand); flex-shrink: 0; margin-top: 2px; }

/* ══════════════════════════════════════════
   WORKSPACE (ADMIN)
══════════════════════════════════════════ */
.workspace-phases    { display: flex; flex-direction: column; gap: 14px; }
.ws-phase-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.ws-phase-card.status-active  { border-left: 3px solid var(--status-active); }
.ws-phase-card.status-done    { border-left: 3px solid var(--status-done); }
.ws-phase-card.status-blocked { border-left: 3px solid var(--status-blocked); }

.ws-phase-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px; margin-bottom: 12px;
}
.ws-phase-left  { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.ws-phase-icon  {
  width: 38px; height: 38px; border-radius: 8px; background: var(--admin-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--admin-color); font-size: 17px; flex-shrink: 0;
}
.ws-phase-title  { font-size: .95rem; font-weight: 700; line-height: 1.3; }
.ws-phase-period { font-size: .76rem; color: var(--text-muted); margin-top: 2px; display: block; }
.ws-phase-right  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }

.phase-cost-inline {
  font-size: .78rem; font-weight: 700; color: var(--admin-color);
  background: var(--admin-light); padding: 3px 9px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
}
.btn-open-phase {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--admin-light); color: var(--admin-color);
  font-size: .8rem; font-weight: 600; text-decoration: none; transition: background .15s;
  white-space: nowrap;
}
.btn-open-phase:hover { background: #d0ddf0; text-decoration: none; }

.ws-phase-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.progress-bar-wrap { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--brand); border-radius: 3px; transition: width .4s; }
.progress-label    { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }

.ws-task-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.task-chip {
  width: 24px; height: 24px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center; font-size: .72rem;
}
.chip-done    { background: #dcfce7; color: var(--status-done); }
.chip-active  { background: #dbeafe; color: var(--status-active); }
.chip-pending { background: #f3f4f6; color: var(--text-muted); }
.chip-blocked { background: #fee2e2; color: var(--status-blocked); }

/* ══════════════════════════════════════════
   PHASE DETAIL (ADMIN)
══════════════════════════════════════════ */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; color: var(--text-muted); margin-bottom: 8px; text-decoration: none;
}
.back-link:hover { color: var(--admin-color); text-decoration: none; }

.tasks-list  { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.task-done    { opacity: .7; }
.task-blocked { border-left: 3px solid var(--status-blocked); }
.task-active  { border-left: 3px solid var(--status-active); }

.task-header        { display: flex; align-items: flex-start; gap: 12px; }
.task-status-icon   { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.status-icon-done    { color: var(--status-done); }
.status-icon-active  { color: var(--status-active); }
.status-icon-blocked { color: var(--status-blocked); }
.status-icon-pending { color: var(--text-light); }
.task-title-wrap    { flex: 1; min-width: 0; }
.task-title         { font-size: .92rem; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.task-meta          { display: flex; flex-wrap: wrap; gap: 10px; }
.task-meta-item     { font-size: .76rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.task-status-form   { flex-shrink: 0; }
.status-select {
  padding: 5px 9px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  font-family: var(--font); font-size: .78rem; cursor: pointer; outline: none;
  -webkit-appearance: none; appearance: none; background: var(--surface);
}
.status-select-done    { border-color: var(--status-done);    color: var(--status-done); }
.status-select-active  { border-color: var(--status-active);  color: var(--status-active); }
.status-select-blocked { border-color: var(--status-blocked); color: var(--status-blocked); }

.task-body {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px;
}
.task-notes {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: .8rem; color: var(--text-muted); line-height: 1.6;
}
.task-notes i { flex-shrink: 0; margin-top: 2px; }
.task-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 600; color: var(--brand);
  padding: 5px 12px; border-radius: var(--radius-sm);
  background: var(--brand-light); width: fit-content;
  transition: background .15s;
}
.task-link:hover { text-decoration: none; background: #d1ead9; }

/* ══════════════════════════════════════════
   DRUGS TABLE (ADMIN) — mobile cards
══════════════════════════════════════════ */
.drugs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.drugs-table {
  width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 700px;
}
.drugs-table th {
  text-align: left; padding: 10px 12px;
  background: var(--bg); border-bottom: 2px solid var(--border);
  font-size: .72rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.drugs-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.drug-row:hover td  { background: var(--bg); }
.drug-wave-1 td:first-child { border-left: 3px solid #ca8a04; }
.drug-wave-2 td:first-child { border-left: 3px solid var(--brand); }
.drug-brand-cell  { font-weight: 700; }
.drug-inn-cell    { color: var(--text-muted); font-size: .8rem; }
.drug-market-cell { font-size: .78rem; color: var(--text-muted); }
.drug-notes-cell details summary { cursor: pointer; color: var(--brand); font-size: .85rem; }
.notes-popup {
  margin-top: 6px; padding: 8px 10px;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius-sm); font-size: .76rem; color: #78350f;
  line-height: 1.6; max-width: 320px;
}
.status-select-reg-not_started  { border-color: var(--border); }
.status-select-reg-dossier_prep { border-color: #ca8a04;            color: #854d0e; }
.status-select-reg-submitted    { border-color: var(--status-active); color: var(--status-active); }
.status-select-reg-review       { border-color: #7c3aed;             color: #5b21b6; }
.status-select-reg-registered   { border-color: var(--status-done);  color: var(--status-done); }

/* ══════════════════════════════════════════
   MISC
══════════════════════════════════════════ */
.error-page {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh; text-align: center; gap: 16px;
}
.error-page h1 { font-size: 2.5rem; color: var(--text-muted); }
.error-page p  { color: var(--text-muted); }

/* ══════════════════════════════════════════
   RESPONSIVE — Tablet 768px
══════════════════════════════════════════ */
@media (max-width: 900px) {
  .budget-divider { display: none; }
  .budget-phases  { width: 100%; }
  .budget-phase-item { min-width: 100px; }
}

@media (max-width: 768px) {
  :root { --nav-h: 56px; }

  .navbar { padding: 0 14px; }
  .navbar-links { display: none; }
  .nav-hamburger { display: flex; }

  .page-wrapper { padding: 16px 14px 48px; }

  .page-header { gap: 12px; margin-bottom: 20px; padding-bottom: 16px; }
  .page-title  { font-size: 1.3rem; }

  .progress-summary { gap: 8px; }
  .progress-stat    { padding: 8px 12px; min-width: 64px; }
  .stat-num         { font-size: 1.5rem; }

  /* Budget */
  .budget-summary { padding: 16px; gap: 14px; }
  .budget-total-rub { font-size: 1.4rem; }
  .budget-phase-item { min-width: 0; flex: 0 0 calc(50% - 5px); }

  /* Start date panel */
  .start-date-panel { padding: 12px 14px; }
  .sdp-form { width: 100%; }
  .sdp-select { flex: 1; }

  /* Timeline */
  .timeline-connector { width: 32px; }
  .timeline-dot  { width: 28px; height: 28px; font-size: .75rem; }
  .timeline-line { min-height: 16px; }
  .timeline-card { padding: 14px 14px; margin-left: 10px; }
  .timeline-title { font-size: .95rem; }

  /* Portfolio */
  .drug-grid         { grid-template-columns: 1fr 1fr; gap: 10px; }
  .portfolio-filters { gap: 6px; }
  .filter-btn        { padding: 5px 10px; font-size: .76rem; }
  .section-hint      { display: none; }

  /* About */
  .about-grid      { grid-template-columns: 1fr; }
  .about-card-main { grid-column: auto; }

  /* Workspace */
  .ws-phase-header  { flex-direction: column; gap: 10px; }
  .ws-phase-right   { flex-direction: row; flex-wrap: wrap; }
  .phase-cost-inline{ font-size: .75rem; }
  .btn-open-phase   { font-size: .78rem; padding: 5px 10px; }

  /* Phase detail */
  .task-header { flex-wrap: wrap; gap: 8px; }
  .task-status-form { order: -1; width: 100%; }
  .task-status-form .status-select { width: 100%; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — Mobile 480px
══════════════════════════════════════════ */
@media (max-width: 480px) {
  .drug-grid         { grid-template-columns: 1fr; }
  .user-name         { display: none; }
  .user-badge        { padding: 4px 8px; }

  .budget-phase-item { flex: 0 0 100%; }

  .page-title { font-size: 1.15rem; }
  .progress-stat { padding: 7px 10px; min-width: 56px; }
  .stat-num { font-size: 1.3rem; }

  .timeline-card  { padding: 12px 12px; }
  .timeline-title { font-size: .9rem; }

  .login-card { padding: 28px 20px; }

  /* Gantt hint */
  .gantt-section h2 { font-size: .9rem; }
}
