/* ==========================================================================
 * Тема «Автоцентр»: светло-голубой фон, белые карточки, красные акценты,
 * тёмно-синие заголовки, синие кнопки. Шрифт Inter.
 * ========================================================================== */

:root {
  --navy: #17304f;      /* заголовки/текст */
  --blue: #2349b5;      /* основные кнопки, активные элементы */
  --blue-dark: #1d3fa0;
  --red: #e5253d;       /* акцент (CST, брови, ошибки) */
  --red-dark: #c81d33;
  --muted: #8b97ab;     /* второстепенный текст */
  --line: #e4eaf4;      /* разделители */
  --hover: #f6f9ff;     /* ховер строк */
  --tint: #eef2fb;      /* мягкая синяя подложка */
  --page: #eef2f8;      /* фон страницы */
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
}

/* ---- Фоновые дуги, как на референсе ------------------------------------- */

.deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.deco::before {
  content: "";
  position: absolute;
  width: 68vmax; height: 68vmax;
  right: -20vmax; top: -26vmax;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}
.deco::after {
  content: "";
  position: absolute;
  width: 55vmax; height: 55vmax;
  right: -12vmax; top: -15vmax;
  border-radius: 50%;
  border: 1.5px solid rgba(35, 73, 181, 0.09);
  background: transparent;
}

/* ---- Карточки и элементы бренда ----------------------------------------- */

.card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 14px 44px -14px rgba(23, 48, 79, 0.14);
}

.dash {
  display: inline-block;
  width: 26px; height: 3px;
  border-radius: 99px;
  background: var(--red);
  flex: none;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

/* ---- Вход ---------------------------------------------------------------- */

.field {
  height: 3rem;
  border: 1px solid #d7e0ee;
  border-radius: 0.75rem;
  background: #fff;
  padding-left: 2.75rem;
  font-size: 0.9rem;
  color: var(--navy);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(35, 73, 181, 0.12);
}
.field::placeholder { color: #9aa7ba; }

.btn-blue {
  height: 3rem;
  border-radius: 0.75rem;
  background: var(--blue);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.btn-blue:hover { background: var(--blue-dark); }
.btn-blue:active { transform: translateY(1px); }
.btn-blue:disabled { opacity: 0.55; }

.btn-logout {
  display: inline-flex;
  height: 2.25rem;
  align-items: center;
  gap: 0.45rem;
  border-radius: 0.6rem;
  padding: 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-logout:hover { background: #fdf0f2; color: var(--red); }

.h-4_5 { height: 1.125rem; }
.w-4_5 { width: 1.125rem; }

/* ---- Строки списка ------------------------------------------------------ */

.row {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto; /* мобильный: иконка, имя+мета, действие */
  align-items: center;
  column-gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  transition: background-color 0.12s ease;
}
.row:last-child { border-radius: 0 0 1.25rem 1.25rem; }
.row:not(.row-header):hover { background-color: var(--hover); }

.row-header {
  display: none;
  padding: 0.7rem 0.85rem;
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--muted);
  background: #fafbfe;
}

.th-btn { display: inline-flex; align-items: center; gap: 0.3rem; }
.th-btn:hover { color: var(--navy); }
.th-btn.sort-active { color: var(--blue); }
.sort-mark { font-size: 0.62rem; width: 0.9em; display: inline-block; }

.col-icon { display: flex; align-items: center; justify-content: center; }
.col-actions { display: flex; align-items: center; justify-content: flex-end; }

.crumb { color: var(--muted); transition: color 0.12s ease; }
.crumb:hover { color: var(--blue); }
.crumb-current { color: var(--navy); font-weight: 600; }
.crumb-sep { color: #c4cfdf; }

.entry-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.entry-meta {
  margin-top: 1px;
  font-size: 0.75rem;
  color: #9aa7ba;
  display: flex;
  gap: 0.75rem;
}

.col-size, .col-modified { display: none; text-align: right; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }

.download-btn {
  display: inline-flex; height: 2.25rem; width: 2.25rem;
  align-items: center; justify-content: center; border-radius: 0.6rem;
  color: #a9b4c6; transition: background-color 0.12s ease, color 0.12s ease;
}
.download-btn:hover { background-color: var(--tint); color: var(--blue); }

.icon-badge {
  display: flex; height: 2.25rem; width: 2.25rem; align-items: center; justify-content: center;
  border-radius: 0.7rem;
}
.icon-badge svg { height: 1.25rem; width: 1.25rem; }

/* Цветовые бейджи по типу файла (в фирменной гамме) */
.ib-folder  { background: #dbe6fb; color: var(--blue); }
.ib-doc     { background: #e0edfb; color: #2f6fb8; }
.ib-archive { background: #fdeee6; color: #c07a2c; }
.ib-image   { background: #e2f6ec; color: #1d8f61; }
.ib-audio   { background: #ede9fa; color: #7a4fc9; }
.ib-video   { background: #fbe9ee; color: #d5325c; }
.ib-other   { background: #edf1f7; color: #64748b; }

/* от 640px */
@media (min-width: 640px) {
  .row { grid-template-columns: 2.75rem minmax(0, 1fr) 6rem 2.75rem; }
}
/* от 768px: полная таблица */
@media (min-width: 768px) {
  .row { grid-template-columns: 2.75rem minmax(0, 1fr) 6.5rem 9rem 2.75rem; padding: 0.45rem 0.85rem; }
  .row-header { display: grid; }
  .entry-meta { display: none; }
  .col-size, .col-modified { display: block; }
}

/* ---- Тост --------------------------------------------------------------- */

.toast-box {
  border-radius: 0.9rem;
  padding: 0.7rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 14px 34px rgba(23, 48, 79, 0.28);
  animation: toast-in 0.2s ease;
}
.toast-info { background: var(--navy); color: #fff; }
.toast-error { background: var(--red); color: #fff; }
#toast.show { opacity: 1; }

/* ---- Анимации ----------------------------------------------------------- */

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
.shake { animation: shake 0.4s ease; }

@keyframes pulse-bg { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.25; } }
.skeleton { animation: pulse-bg 1.4s ease-in-out infinite; border-radius: 0.5rem; background-color: #e7edf5; }
