/* ============================================================================
   JLO Admin — дизайн-система макета (v1)
   Отдельный светлый/рабочий стиль от публичного сайта, но использует те же
   шрифты для лёгкой узнаваемости бренда (Playfair Display в заголовках,
   Lato в тексте).
   ============================================================================ */

:root {
  /* Нейтральная светлая палитра */
  --bg-app:        #f4f5f7;
  --bg-panel:      #ffffff;
  --bg-panel-alt:  #fafbfc;
  --bg-sidebar:    #1f2430;
  --bg-sidebar-hover: #2a3142;
  --bg-sidebar-active: #343d52;

  --border:        #e2e5ea;
  --border-strong: #cdd2db;

  --text-primary:  #1c1f26;
  --text-secondary:#5b6270;
  --text-muted:    #8a909c;
  --text-on-dark:  #e8eaf0;
  --text-on-dark-muted: #9098ab;

  /* Акцент — приглушённое золото бренда, используется точечно (не заливкой) */
  --accent:        #a9822f;
  --accent-light:  #f3e9d2;
  --accent-dark:   #8a6a24;

  --color-info:    #3b6ea5;
  --color-info-bg: #e8f0f9;
  --color-success: #2f7d4f;
  --color-success-bg: #e6f4ea;
  --color-warning: #b5791b;
  --color-warning-bg: #fbf0dd;
  --color-danger:  #b0392f;
  --color-danger-bg: #faeae8;
  --color-neutral: #5b6270;
  --color-neutral-bg: #eceef1;

  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(20, 24, 34, 0.06);
  --shadow-md: 0 4px 14px rgba(20, 24, 34, 0.08);

  --sidebar-width: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 0.4em;
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  padding: 20px 0 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 14px;
}

.sidebar__brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #2a1f08;
  font-size: 15px;
  flex: none;
}

.sidebar__brand-text {
  line-height: 1.2;
}
.sidebar__brand-text .title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: block;
}
.sidebar__brand-text .subtitle {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sidebar__section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-on-dark-muted);
  padding: 14px 20px 6px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 10px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-size: 14px;
  transition: background 0.12s ease;
}

.sidebar__link:hover {
  background: var(--bg-sidebar-hover);
}

.sidebar__link.is-active {
  background: var(--bg-sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar__link.is-disabled {
  color: var(--text-on-dark-muted);
  cursor: default;
  opacity: 0.6;
}
.sidebar__link.is-disabled:hover { background: none; }

.sidebar__icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.sidebar__badge-soon {
  margin-inline-start: auto;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.08);
  color: var(--text-on-dark-muted);
  padding: 2px 6px;
  border-radius: 20px;
}

/* Main column */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar__breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.topbar__breadcrumbs a:hover { color: var(--text-primary); }
.topbar__breadcrumbs .current { color: var(--text-primary); font-weight: 600; }

.topbar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.topbar__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.content {
  padding: 26px 28px 60px;
  max-width: 1180px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 26px;
  margin-bottom: 4px;
}

.page-header__meta {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Contract header — artist name must be the most prominent thing on the
   page (bigger than the role/production) so it can never be sent to the
   wrong person by mistake. */
.contract-header__artist {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent-dark);
  line-height: 1.15;
  margin-bottom: 2px;
}
.contract-header__role {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.page-header__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.12s ease;
  white-space: nowrap;
}

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

.btn--secondary {
  background: var(--bg-panel);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--bg-panel-alt); border-color: var(--text-muted); }

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn--ghost:hover { background: var(--bg-panel-alt); color: var(--text-primary); }

.btn--danger {
  background: var(--bg-panel);
  color: var(--color-danger);
  border-color: var(--color-danger-bg);
}
.btn--danger:hover { background: var(--color-danger-bg); }

.btn--sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------------------------------------------------------------------------
   Panels / cards
   --------------------------------------------------------------------------- */

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.panel__header h2, .panel__header h3 {
  font-size: 15px;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text-primary);
}

.panel__body { padding: 20px; }
.panel + .panel { margin-top: 18px; }

/* ---------------------------------------------------------------------------
   Filters bar
   --------------------------------------------------------------------------- */

.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-input {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 320px;
}
.search-input input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--bg-panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a90ac' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5.5'/%3E%3Cpath d='M11 11L15 15' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 10px center;
  font-family: var(--font-body);
}
.search-input input:focus { outline: 2px solid var(--accent-light); border-color: var(--accent); }

select.filter-select {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--bg-panel);
  font-family: var(--font-body);
  color: var(--text-primary);
}

.filters-bar__spacer { flex: 1; }
.filters-bar__count { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

/* ---------------------------------------------------------------------------
   Tabs (status)
   --------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tabs__item {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tabs__item:hover { color: var(--text-primary); }

.tabs__item.is-active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}

.tabs__count {
  background: var(--color-neutral-bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}
.tabs__item.is-active .tabs__count {
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* Detail-page section tabs (person / contract cards) */
.section-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 18px;
  width: fit-content;
}
.section-tabs__item {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.section-tabs__item:hover { color: var(--text-primary); }
.section-tabs__item.is-active {
  background: var(--bg-panel);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------------------
   Table
   --------------------------------------------------------------------------- */

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.1s ease;
}

.data-table tbody tr.is-clickable { cursor: pointer; }
.data-table tbody tr.is-clickable:hover { background: var(--bg-panel-alt); }

.data-table tbody tr:last-child td { border-bottom: none; }

.cell-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  flex: none;
}

.cell-person__name { font-weight: 700; color: var(--text-primary); }
.cell-person__sub { font-size: 12px; color: var(--text-muted); }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ---------------------------------------------------------------------------
   Badges / pills
   --------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge--neutral { background: var(--color-neutral-bg); color: var(--color-neutral); }
.badge--info    { background: var(--color-info-bg); color: var(--color-info); }
.badge--success { background: var(--color-success-bg); color: var(--color-success); }
.badge--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--danger  { background: var(--color-danger-bg); color: var(--color-danger); }

.chip {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--color-neutral-bg);
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   Person / contract detail
   --------------------------------------------------------------------------- */

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.profile-header__avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  flex: none;
}

.profile-header__info { flex: 1; min-width: 200px; }
.profile-header__name { font-size: 22px; margin-bottom: 3px; }
.profile-header__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field__label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}
.field__value {
  font-size: 14.5px;
  color: var(--text-primary);
}
.field__value.is-empty { color: var(--text-muted); font-style: italic; font-weight: 400; }

.field--wide { grid-column: 1 / -1; }

.field__value textarea, .field__value input, .field__value select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-panel);
}
.field__value textarea { resize: vertical; min-height: 60px; }
.field__value input[type="checkbox"] { width: auto; margin-inline-end: 6px; }
.checkbox-row { display: flex; align-items: center; font-size: 14px; }

/* Status stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.stepper__step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
}
.stepper__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-neutral-bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex: none;
}
.stepper__step.is-done .stepper__dot { background: var(--color-success); color: #fff; }
.stepper__step.is-done { color: var(--color-success); }
.stepper__step.is-current .stepper__dot { background: var(--accent); color: #fff; }
.stepper__step.is-current { color: var(--accent-dark); }
.stepper__step:not(:last-child)::after {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--border-strong);
  margin-inline-start: 8px;
}
.stepper__step.is-done:not(:last-child)::after { background: var(--color-success); opacity: 0.4; }

/* Timeline / activity */
.timeline { display: flex; flex-direction: column; }
.timeline__item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.timeline__item:last-child { border-bottom: none; padding-bottom: 0; }
.timeline__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex: none;
}
.timeline__date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.timeline__text { color: var(--text-primary); }

/* Info banner */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 18px;
}
.banner--info { background: var(--color-info-bg); color: #274a6e; }
.banner--warning { background: var(--color-warning-bg); color: #6e4c10; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.empty-state__icon { font-size: 32px; margin-bottom: 10px; }

/* Utility */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   Participant header — name + status + re-uploadable photo
   --------------------------------------------------------------------------- */

.participant-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.participant-header__main { flex: 1; min-width: 200px; }

.photo-box-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
}
.photo-box {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-box__placeholder {
  color: var(--text-muted);
  font-size: 10.5px;
  text-align: center;
  padding: 6px;
  line-height: 1.3;
}

/* ---------------------------------------------------------------------------
   Applied / accepted role lists (studio applications)
   --------------------------------------------------------------------------- */

.role-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-panel-alt);
  flex-wrap: wrap;
}
.role-list__item.is-accepted {
  background: var(--color-success-bg);
  border-color: transparent;
}
.role-list__info { display: flex; flex-direction: column; gap: 4px; }
.role-list__title { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.role-list__meta { font-size: 12.5px; color: var(--text-secondary); display: flex; gap: 12px; flex-wrap: wrap; }
.role-list__meta a { color: var(--color-info); text-decoration: underline; }
.role-list__actions { flex: none; display: flex; align-items: center; gap: 14px; }
.role-list__empty { color: var(--text-muted); font-size: 13px; font-style: italic; padding: 8px 2px; }

.role-list__cover {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.role-list__cover input { margin: 0; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
