/* Вебфронт МИГАН-ПАК — фирменный стиль miganpack.ru (19.10.2026): тёмно-синий, оранжевый акцент, крафт и кремовый фон;
   графика — разрез гофрокартона с бегущей волной гофры и изометрические кубики, как в логотипе */
:root {
  --navy: #0f2a4a; --navy-2: #16406e; --navy-3: #0b1e35; --blue: #1f5fad; --blue-l: #e8f0fb;
  --orange: #f0731a; --orange-h: #d6600f; --orange-l: #fef0e4;
  --kraft: #c8a277; --cream: #f7f3ec; --cream-2: #efe8dd; --lime: #c4cf44;
  --fg: #1a1f26; --muted: #5a6572; --muted-2: #8c96a1; --line: #e3e8ef; --green: #1e8e5a; --danger: #c62828;
  --card: #fff; --radius: 16px; --shadow: 0 10px 30px rgba(15, 42, 74, .10); --shadow-h: 0 18px 40px rgba(15, 42, 74, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--fg); background: var(--cream); min-height: 100vh; }
[hidden] { display: none !important; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 14px; }
a { color: var(--blue); }
.muted { color: var(--muted); }
button { font: inherit; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 14px; cursor: pointer; color: var(--fg); transition: background .15s, border-color .15s; }
.btn:hover { background: var(--blue-l); border-color: #c9d6e6; }
.primary { position: relative; overflow: hidden; background: var(--orange); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; cursor: pointer;
  font-weight: 700; box-shadow: 0 6px 16px rgba(240, 115, 26, .28); transition: background .15s, transform .15s, box-shadow .15s; }
.primary:hover { background: var(--orange-h); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(240, 115, 26, .34); }
.primary:active { transform: translateY(0); }
.primary:disabled { opacity: .6; cursor: default; transform: none; }
.primary::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg); }
.primary:hover::after { animation: shine .8s ease; }
.primary.big { padding: 13px 18px; font-size: 16px; border-radius: 12px; }
.danger { background: #fff; color: var(--danger); border: 1px solid #f0c4c4; border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.danger:hover { background: #fdecec; }
.lnk { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 0; font-weight: 600; }
.lnk:hover { color: var(--orange-h); text-decoration: underline; }
.err { color: var(--danger); min-height: 1.2em; font-size: 13.5px; }
.empty { color: var(--muted); background: #fff; border: 1px dashed #d8cdbb; border-radius: var(--radius); padding: 30px; text-align: center; }
.kicker { display: inline-block; background: var(--orange-l); color: var(--orange-h); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--fg); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 95, 173, .15); }

/* --- графика: кубики и гофрокартон --------------------------------------------------------------------------------- */
.cube { position: absolute; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .25)); animation: float 7s ease-in-out infinite; }
.board { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34px; opacity: .9; }
.flute { animation: flute 2.4s linear infinite; }
@keyframes flute { from { transform: translateX(0); } to { transform: translateX(96px); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-14px) rotate(4deg); } }
@keyframes shine { from { left: -60%; } to { left: 130%; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* --- вход ---------------------------------------------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 56px 56px 90px;
  background: radial-gradient(1200px 500px at 15% 10%, rgba(31, 95, 173, .45), transparent 60%),
              linear-gradient(160deg, var(--navy-2), var(--navy) 55%, var(--navy-3)); display: flex; align-items: center; }
.login-art::before { content: ""; position: absolute; inset: 0; opacity: .07;
  background-image: repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 64px), repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 64px); }
.art-text { position: relative; max-width: 520px; animation: rise .7s ease both; }
.art-text h2 { font-size: 40px; line-height: 1.15; margin: 18px 0 14px; }
.art-text h2 em { font-style: normal; color: #ffb477; }
.art-text p { color: #d7e1ee; font-size: 17px; margin: 0; }
.login-art .cube.c1 { width: 120px; height: 120px; right: 9%; top: 12%; }
.login-art .cube.c2 { width: 70px; height: 70px; right: 30%; top: 62%; animation-delay: -2s; animation-duration: 8s; }
.login-art .cube.c3 { width: 46px; height: 46px; right: 12%; top: 66%; animation-delay: -4s; animation-duration: 6s; opacity: .85; }
.login-art .cube.c4 { width: 34px; height: 34px; left: 8%; top: 9%; animation-delay: -1s; opacity: .55; }
.login-art .board { height: 46px; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 24px; }
.card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
.login-card { width: min(400px, 100%); padding: 34px 32px 26px; display: flex; flex-direction: column; gap: 15px; animation: rise .6s .1s ease both; }
.logo-img { width: 220px; max-width: 100%; height: auto; margin-bottom: 4px; }
.login-head b { display: block; font-size: 22px; }
.login-head span { color: var(--muted); font-size: 14px; }
.login-foot { margin: 2px 0 0; color: var(--muted-2); font-size: 12.5px; text-align: center; }

/* --- шапка и приветствие ------------------------------------------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 24px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.brand-sub { color: var(--muted); font-size: 13px; border-left: 1px solid var(--line); padding-left: 12px; }
.user-btn { font-weight: 600; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-h); min-width: 220px; padding: 6px; z-index: 20; animation: rise .18s ease both; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--orange-l); color: var(--orange-h); }
.hero { position: relative; overflow: hidden; color: #fff; padding: 34px 24px 70px;
  background: radial-gradient(900px 300px at 85% 0%, rgba(31, 95, 173, .5), transparent 60%), linear-gradient(160deg, var(--navy-2), var(--navy) 60%, var(--navy-3)); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .06;
  background-image: repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 64px), repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 64px); }
.hero-in { position: relative; max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 20px; animation: rise .6s ease both; }
.hero h1 { font-size: 32px; margin: 12px 0 6px; }
.hero-sub { margin: 0; color: #d7e1ee; font-size: 16px; }
.hero .kicker { background: rgba(255, 180, 119, .16); color: #ffb477; }
.hero-cubes { position: relative; width: 230px; height: 120px; flex: none; }
.hero-cubes .h1c { width: 96px; height: 96px; right: 20px; top: -6px; }
.hero-cubes .h2c { width: 56px; height: 56px; right: 130px; top: 48px; animation-delay: -3s; animation-duration: 8s; }
.hero-cubes .h3c { width: 36px; height: 36px; right: 0; top: 86px; animation-delay: -5s; opacity: .8; }
.hero-board { height: 30px; }
main { max-width: 1180px; margin: 0 auto; padding: 0 24px 50px; }
#home { margin-top: -34px; position: relative; }

/* --- плитки сервисов ----------------------------------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile { --c: var(--blue); position: relative; overflow: hidden; display: flex; gap: 16px; align-items: flex-start; background: #fff; border-radius: var(--radius);
  padding: 22px 20px 44px; text-decoration: none; color: var(--fg); box-shadow: var(--shadow); border: 1px solid rgba(227, 232, 239, .8);
  transition: transform .2s ease, box-shadow .2s ease; animation: rise .55s ease both; animation-delay: calc(var(--i, 0) * 80ms + 150ms); }
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 40%, #fff)); }
.tile::after { content: "Открыть →"; position: absolute; left: 82px; bottom: 16px; color: var(--orange); font-weight: 700; font-size: 13.5px;
  opacity: 0; transform: translateX(-8px); transition: opacity .2s, transform .2s; }
.tile:hover, .tile:focus-visible { transform: translateY(-5px); box-shadow: var(--shadow-h); outline: none; }
.tile:hover::after, .tile:focus-visible::after { opacity: 1; transform: none; }
.tile .ic { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none;
  background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); font-weight: 800; transition: transform .3s ease; }
.tile:hover .ic { transform: rotate(-8deg) scale(1.08); }
.tile b { display: block; font-size: 17.5px; margin-bottom: 4px; color: var(--navy); }
.tile span { color: var(--muted); font-size: 14px; }
.tile .host { display: block; margin-top: 8px; font-size: 12px; color: var(--muted-2); }

/* --- администрирование --------------------------------------------------------------------------------------------- */
#admin { padding-top: 28px; animation: fadein .3s ease both; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-head h1 { margin: 0; color: var(--navy); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #ddd3c4; margin: 12px 0 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 16px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; transition: color .15s; }
.tabs button:hover { color: var(--navy); }
.tabs button.on { color: var(--navy); border-bottom-color: var(--orange); }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bar .sp { flex: 1; }
.tbl-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); animation: rise .35s ease both; }
table.tbl { border-collapse: collapse; width: 100%; min-width: 640px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12.5px; color: var(--muted); font-weight: 700; background: var(--cream); text-transform: uppercase; letter-spacing: .03em; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #fbf9f5; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.off td { color: #9aa0a8; }
.tbl td.act { text-align: right; white-space: nowrap; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--blue-l); color: var(--navy-2); font-size: 12.5px; margin: 1px 3px 1px 0; white-space: nowrap; font-weight: 600; }
.chip.adm { background: var(--orange-l); color: var(--orange-h); }
.chip.off { background: #eef0f3; color: #7b8590; }
.note { color: var(--muted); font-size: 13px; }

/* --- окна, уведомления, подвал ------------------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; background: rgba(11, 30, 53, .45); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center;
  padding: 50px 16px; overflow: auto; z-index: 50; animation: fadein .15s ease both; }
.modal-box { position: relative; background: #fff; border-radius: 18px; padding: 24px 26px; width: min(580px, 100%); box-shadow: 0 24px 60px rgba(11, 30, 53, .35); animation: rise .22s ease both; }
.modal-box h2 { margin: 0 0 16px; font-size: 19px; color: var(--navy); }
.modal-box .x { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted-2); }
.modal-box .x:hover { color: var(--orange); }
.form { display: flex; flex-direction: column; gap: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fcfbf8; }
.checks label, label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); font-size: 14px; font-weight: 400; }
.checks .none { color: var(--muted); font-size: 13px; }
input[type=checkbox] { width: 17px; height: 17px; padding: 0; accent-color: var(--orange); }
input[type=color] { padding: 3px; height: 42px; }
.fs-title { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: -6px; }
.form-btns { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 6px; }
.form-btns .sp { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px;
  border-radius: 12px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 10px 28px rgba(11, 30, 53, .35); border-left: 4px solid var(--orange); animation: rise .2s ease both; }
.toast.bad { background: var(--danger); border-left-color: #ffcdd2; }
.foot { text-align: center; color: var(--muted-2); font-size: 12.5px; padding: 10px 16px 26px; }

/* --- телефон и планшет --------------------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 34px 24px 70px; min-height: 0; }
  .art-text h2 { font-size: 28px; }
  .art-text p { font-size: 15px; }
  .login-art .cube.c1 { width: 58px; height: 58px; right: 7%; top: auto; bottom: 62px; }
  .login-art .cube.c2, .login-art .cube.c4 { display: none; }
  .login-art .cube.c3 { width: 34px; height: 34px; right: 28%; top: auto; bottom: 58px; }
  .login-side { padding: 0 16px 30px; margin-top: -40px; position: relative; }
}
@media (max-width: 600px) {
  .row2 { grid-template-columns: 1fr; }
  .top { padding: 8px 14px; }
  .brand img { height: 22px; }
  .brand-sub { display: none; }
  .hero { padding: 24px 16px 60px; }
  .hero h1 { font-size: 25px; }
  .hero-cubes { display: none; }
  main { padding: 0 14px 40px; }
  .tiles { grid-template-columns: 1fr; gap: 14px; }
  .login-card { padding: 26px 20px 22px; }
}
/* на сенсорных экранах наведения нет — «Открыть →» виден всегда */
@media (hover: none) {
  .tile::after { opacity: 1; transform: none; }
}
/* кому движение мешает (настройка системы) — без анимаций */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
