:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1c2230;
  --muted: #6b7385;
  --line: #e3e7ef;
  --accent: #2459e0;
  --accent-2: #1d4bc2;
  --word: #2b6ae6;
  --excel: #1e8a4c;
  --slides: #d4572a;
  --danger: #d23b3b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 6px 20px rgba(20, 30, 60, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* шапка */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo i { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #2b6ae6, #1e8a4c); display: inline-block; position: relative; }
.logo i::after { content: ""; position: absolute; inset: 8px 9px; border: 2px solid #fff; border-radius: 2px; border-top-width: 5px; }
.top .grow { flex: 1; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: #eef2fb; color: var(--muted); white-space: nowrap; }
.badge.pro { background: #e6f5ec; color: #17733f; }

.btn { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn:hover { border-color: #c9d0de; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef1f7; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn[disabled] { opacity: .6; cursor: default; }

/* кабинет: создать */
h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 28px 0 12px; }
.create { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: left; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s, transform .15s; color: var(--text); }
.tile:hover { border-color: #c5cee0; box-shadow: var(--shadow); transform: translateY(-1px); }
.tile b { font-size: 15px; }
.tile span { color: var(--muted); font-size: 13px; }
.ficon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.ficon.doc { background: var(--word); }
.ficon.sheet { background: var(--excel); }
.ficon.slides { background: var(--slides); }
.ficon.up { background: #eef1f7; color: var(--accent); font-size: 20px; }

/* список файлов */
.listhead { display: flex; align-items: center; gap: 12px; margin: 30px 0 10px; }
.listhead h2 { margin: 0; flex: 1; }
.search { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; width: 260px; max-width: 50vw; background: var(--card); }
.files { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row:hover { background: #f8f9fc; }
.row .ficon { width: 32px; height: 32px; font-size: 13px; }
.row .name { flex: 1; min-width: 0; color: var(--text); }
.row .name b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .name small { color: var(--muted); }
.row .name:hover { text-decoration: none; }
.row .name:hover b { color: var(--accent); }
.row .acts { display: flex; gap: 2px; }
.row .acts button { border: 0; background: transparent; border-radius: 8px; padding: 6px 9px; color: var(--muted); font-size: 13px; }
.row .acts button:hover { background: #eef1f7; color: var(--text); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* перетаскивание файла */
.drop { position: fixed; inset: 0; background: rgba(36, 89, 224, .08); border: 3px dashed var(--accent); display: none; place-items: center; z-index: 50; font-size: 20px; color: var(--accent); font-weight: 600; }
.drop.on { display: grid; }

/* окна */
.modal { position: fixed; inset: 0; background: rgba(15, 20, 35, .45); display: none; place-items: center; z-index: 100; padding: 16px; }
.modal.on { display: grid; }
.dialog { background: var(--card); border-radius: 18px; padding: 26px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); position: relative; }
.dialog h3 { margin: 0 0 8px; font-size: 20px; }
.dialog p { margin: 0 0 14px; color: var(--muted); }
.dialog .x { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; font-size: 22px; color: var(--muted); width: 34px; height: 34px; border-radius: 8px; }
.dialog .x:hover { background: #eef1f7; }
.field { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-bottom: 12px; font-size: 16px; }
.field:focus, .search:focus { outline: 2px solid rgba(36, 89, 224, .25); border-color: var(--accent); }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin-bottom: 6px; }
.price { font-size: 34px; font-weight: 700; margin: 6px 0 2px; }
.price small { font-size: 16px; color: var(--muted); font-weight: 400; }
.checks { list-style: none; padding: 0; margin: 14px 0 18px; }
.checks li { padding-left: 26px; position: relative; margin: 7px 0; }
.checks li::before { content: "✓"; position: absolute; left: 4px; color: var(--excel); font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.check input { margin-top: 3px; }
.dialog .btn.primary { width: 100%; justify-content: center; padding: 12px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1c2230; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 200; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }

.menu { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; min-width: 200px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; color: var(--text); }
.menu button:hover { background: #eef1f7; }
.menu button.danger { color: var(--danger); }

.foot { color: var(--muted); font-size: 13px; padding: 40px 0; }

@media (max-width: 760px) {
  .create { grid-template-columns: repeat(2, 1fr); }
  .search { width: 150px; }
  .row .acts .wide { display: none; }
  .top .hide-m { display: none; }
}
