:root{
  --bg: #EDF5FC;
  --text: #333;
  --muted: #666;
  --card: #ffffff;
  --border: #e5e7eb;

  --primary: #4a90e2;
  --primary-hover: #357ABD;

  --danger: #dc3545;
  --danger-hover: #b02a37;

  --input-bg: #fff;
  --input-border: #ccc;
  --shadow: 0 2px 8px rgba(0,0,0,0.05);
}

body.dark-mode{
  --bg: #0f1216;
  --text: #e6e7e9;
  --muted: #a0a7b3;
  --card: #161a1f;
  --border: #2a2f36;

  --primary: #8ab4f8;
  --primary-hover: #77a0e2;

  --danger: #ff4d4d;
  --danger-hover: #ff6666;

  --input-bg: #1d232b;
  --input-border: #3a414b;
  --shadow: 0 2px 10px rgba(0,0,0,0.25);
}

:root { --header-h: 64px; }

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

h2 {
  text-align: center;
  margin: 28px auto;
  font-weight: 800;
  font-size: 2rem;
  color: var(--primary);
}

html, body{
  min-height:100dvh;
  background: var(--bg);
  color: var(--text);
}

body {
    padding-top: var(--header-h);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
}

.page-container {
  display: block;
  min-height: unset;
  padding: 0;
}

.site-header{
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.welcome-container {
    background: var(--card);
    padding: 18px 25px;
    border-radius: 10px;
    color: var(--text);
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: fadeInUp 0.5s ease-out forwards;
}

.welcome-title {
    font-size: 26px;
    font-weight: 600;
    background: linear-gradient(90deg, #0294DD, #F56F20, #0294DD);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 4s ease infinite;
    text-align: center;
    margin-bottom: 5px;
}

@keyframes gradientFlow {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--muted);
    text-align: center;
    font-weight: 400;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

input, select, textarea {
    width: 100%;
    padding: 8px 12px;
    margin: 4px 0;
    box-sizing: border-box;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    border-radius: 6px;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 5px var(--primary-hover);
}

button,
input[type="submit"] {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

button:hover,
input[type="submit"]:hover {
    background-color: var(--primary-hover);
}

.site-header__left{
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-header__logo{ width:40px; height:40px; object-fit:contain; }
.site-header__title{ margin:0; font-size:18px; font-weight:700; color:#F56F20; }

.site-header__right{ display:flex; align-items:center; gap:10px; }
.site-header__btn{
  border:1px solid var(--border);
  background: var(--card);
  color: var(--text);
  height:36px; padding:0 10px; border-radius:10px; cursor:pointer;
}
.site-header__btn:hover{ background: var(--bg); }

.site-header__select{
  height:36px;
  border:1px solid var(--border);
  border-radius:10px;
  background: var(--card);
  color: var(--text);
  padding:0 10px;
  cursor:pointer;
}

.site-main{
  max-width: 1100px;
  margin: 16px auto;
  padding: 0 16px 32px;
}

.logout-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: var(--danger);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}
.logout-link:hover {
    background-color: var(--danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.welcome-container {
  text-align: center;
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  color: #F56F20;
  margin-bottom: 5px;
}

.welcome-subtitle {
  font-size: 16px;
  color: var(--muted);
}

.dashboard-title-with-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.dashboard-title-with-icon h2 {
  font-size: 26px;
  color: #F56F20;
  margin: 0;
}

.dashboard-logo {
  width: 36px;
  height: 36px;
}

.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.dashboard-grid {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 920px;
    width: 100%;
}

.dashboard-card {
    width: 200px;
    height: 150px;
}

.dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}
.dashboard-link:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-quiet{
  background:#f8fafc;
  color:#374151;
  border:1px solid #e5e7eb;
  box-shadow:none;
}
.btn-quiet:hover{ background:#eef2f7; border-color:#d1d5db; }

.btn-sm{
  padding:.38rem .7rem;
  font-size:.9rem;
  border-radius:.5rem;
  line-height:1.1;
  display:inline-flex;
  align-items:center;
  gap:.45rem;
}

.btn-icon .icon{
  width:16px; height:16px;
  flex-shrink:0;
  display:inline-block;
}

/* === Session expired modal === */
.session-expired-modal {
  position: fixed;
  inset: 0;
  display: none;          /* включаем через JS */
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.session-expired-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.session-expired-content {
  position: relative;
  z-index: 1;
  background: #ffffff;
  padding: 22px 26px;
  border-radius: 14px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  text-align: center;
}

.session-expired-content h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.session-expired-content p {
  margin: 0 0 18px;
  font-size: 14px;
  color: #4b5563;
}

/* Можно накинуть уже существующие классы .btn / .primary-btn */
.session-expired-content .primary-btn {
  min-width: 120px;
}
