/* ═══════════════════════════════════════════════════════════
   Общие стили для панели администратора и календаря
   ═══════════════════════════════════════════════════════════ */

/* ── Базовые переменные ────────────────────────────────────── */
:root {
  --bg:           #f0ede8;
  --paper:        #faf8f5;
  --green:        #3a7d5c;
  --green-light:  #e8f4ee;
  --blue:         #3a5f8a;
  --red:          #c0392b;
  --gold:         #b8963e;
  --gray:         #9a9a9a;
  --text:         #2c2c2c;
  --shadow:       0 4px 24px rgba(0,0,0,0.10);
  --radius:       16px;
}

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

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 15%, #d6ead9 0%, transparent 45%),
    radial-gradient(ellipse at 85% 85%, #d9e8f0 0%, transparent 45%);
  min-height: 100vh;
  font-family: 'Raleway', sans-serif;
  color: var(--text);
}

.app { max-width: 860px; margin: 0 auto; }

/* ── Экран загрузки ────────────────────────────────────────── */
#loadingScreen, #ldg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-size: 14px;
  color: var(--gray);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ── Экран входа ───────────────────────────────────────────── */
#loginScreen, #lw {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card, .lcard {
  background: var(--paper);
  border-radius: 28px;
  padding: 48px 44px 40px;
  width: 420px;
  max-width: 100%;
  box-shadow: 0 8px 48px rgba(0,0,0,0.10);
}

.login-card h1, .lcard h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  margin-bottom: 6px;
}

.login-icon { font-size: 48px; margin-bottom: 14px; display: block; }

.login-sub, .lsub {
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.field, .lf { margin-bottom: 16px; }

.field label, .lf label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 7px;
}

.field input, .lf input {
  width: 100%;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 13px 16px;
  font-family: 'Raleway', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus, .lf input:focus { border-color: var(--green); }

.btn-login, .lbtn {
  width: 100%;
  background: var(--green);
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: white;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
  box-shadow: 0 4px 18px rgba(58,125,92,0.25);
}

.btn-login:hover, .lbtn:hover { background: #2d6349; }
.btn-login:disabled, .lbtn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-error, .lerr {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  display: none;
  text-align: center;
}

/* ── Верхняя панель ────────────────────────────────────────── */
.user-badge, .ubadge {
  background: var(--green-light);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-tag, .rtag {
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: white;
  font-weight: 700;
}

.role-tag.admin, .rtag.admin   { background: #6c5ce7; }
.role-tag.editor, .rtag.editor { background: var(--green); }
.role-tag.viewer, .rtag.viewer { background: var(--blue); }

.btn-logout, .blout {
  background: none;
  border: 1.5px solid #e0dbd4;
  border-radius: 10px;
  padding: 7px 14px;
  font-family: 'Raleway', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover, .blout:hover { border-color: var(--red); color: var(--red); }

.btn-chpwd, .bchpwd {
  background: none;
  border: 1.5px solid #c2d0e4;
  border-radius: 10px;
  padding: 7px 14px;
  font-family: 'Raleway', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-chpwd:hover, .bchpwd:hover { background: #e8eef6; }

/* ── Секции ────────────────────────────────────────────────── */
.section {
  background: var(--paper);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}

.section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  margin-bottom: 20px;
}

.sec-sub {
  font-size: 12px;
  color: var(--gray);
  margin-top: -14px;
  margin-bottom: 18px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.section-header h2 { margin-bottom: 0; }

.sec-toggle {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* ── Модальное окно смены пароля ───────────────────────────── */
.pwd-modal, .pwdov {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,30,30,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.pwd-modal.open, .pwdov.open { display: flex; }

.pwd-card, .pwdcard {
  background: var(--paper);
  border-radius: 22px;
  padding: 32px;
  width: 380px;
  max-width: 95vw;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}

.pwd-card h3, .pwdcard h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  margin-bottom: 6px;
}

.pwd-card .psub, .pwdsub {
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.pwd-field, .pwdf { margin-bottom: 14px; }

.pwd-field label, .pwdf label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 6px;
}

.pwd-field input, .pwdf input {
  width: 100%;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 11px 14px;
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.pwd-field input:focus, .pwdf input:focus { border-color: var(--green); }

.pwd-actions, .pwdact {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.pwd-cancel, .pwdbcan {
  background: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: var(--gray);
}

.pwd-save, .pwdbsav {
  background: var(--green);
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: white;
}

.pwd-save:disabled, .pwdbsav:disabled { opacity: 0.6; cursor: not-allowed; }

.pwd-err, .pwderr {
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: none;
}

/* ── Легенда ───────────────────────────────────────────────── */
.legend-wrap {
  background: var(--paper);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.legend-ttl {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 600;
}

.legend-tog {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--gray);
  padding: 0;
}

.legend-items { display: flex; flex-wrap: wrap; gap: 8px; }

.leg-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  border-radius: 20px;
  padding: 5px 13px 5px 8px;
  font-size: 13px;
  font-weight: 500;
}

.leg-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }

/* ── Flash уведомление ─────────────────────────────────────── */
.flash {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  z-index: 9999;
}

.flash.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Уведомление просмотра ─────────────────────────────────── */
.vn {
  background: #e8eef6;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 16px;
}

/* ── Мобильная адаптация ───────────────────────────────────── */
@media (max-width: 600px) {
  .login-card, .lcard { padding: 32px 24px; }
  .section { padding: 20px; }
}
