@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --deep: #0F4D2A;
  --accent: #2E8B45;
  --leaf: #7BC47F;
  --bg: #F4F8F1;
  --paper: #FFFFFF;
  --ink: #14231A;
  --muted: #4A6152;
  --line: #D5E3D7;
  --danger: #A3261B;
  --danger-bg: #FBEAE8;
  --ok-bg: #E3F0E4;
  --radius: 14px;
  --display: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--deep); }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; }

/* Кириш саҳифаси */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.brand { background: var(--deep); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.logo b { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: 1px; line-height: 1; }
.logo small { display: block; font-size: 13px; font-weight: 600; opacity: .85; margin-top: 4px; }
.brand h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.12; margin: 0; max-width: 14ch; }
.brand p { margin: 0; color: #CFE6D3; max-width: 34ch; }
.panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.card h2 { font-family: var(--display); font-weight: 800; font-size: 1.6rem; margin: 0; color: var(--deep); }
.card .lead { margin: -8px 0 0; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); }
input[type=text], input[type=password], select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 48px; width: 100%;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(46,139,69,.18); }

.btn { font: inherit; font-weight: 700; border-radius: 999px; min-height: 48px; padding: 0 24px; cursor: pointer; border: 2px solid var(--deep); background: var(--deep); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: #0B3A20; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--deep); }
.btn.ghost:hover { background: var(--ok-bg); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.danger:hover { background: var(--danger-bg); }

.msg { border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.msg.error { background: var(--danger-bg); color: var(--danger); }
.msg.ok { background: var(--ok-bg); color: var(--deep); }

.modules { display: flex; flex-direction: column; gap: 10px; }
.module { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); text-decoration: none; color: var(--ink); }
.module:hover { border-color: var(--accent); }
.module strong { font-family: var(--display); color: var(--deep); }
.module span { color: var(--muted); font-size: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Админ */
.top { background: var(--deep); color: #fff; }
.top .in { max-width: 1100px; margin: 0 auto; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.top .btn.ghost { color: #fff; border-color: #fff; }
.top .btn.ghost:hover { background: rgba(255,255,255,.12); }
main.admin { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 32px; }
.admin h2 { font-family: var(--display); font-weight: 800; color: var(--deep); margin: 0 0 12px; font-size: 1.35rem; }
.box { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; align-items: end; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 48px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.users { display: flex; flex-direction: column; gap: 12px; }
.user { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.user.off { opacity: .65; }
.user header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.user header strong { font-family: var(--display); font-size: 1.05rem; }
.user header code { color: var(--muted); font-family: var(--body); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--deep); }
.tag.warn { background: #FFF3D6; color: #7A5300; }
.tag.off { background: var(--danger-bg); color: var(--danger); }

.secret { font-family: var(--display); font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; color: var(--deep); background: var(--ok-bg); border-radius: 10px; padding: 12px 16px; user-select: all; }

@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .brand { padding: 28px 24px; gap: 16px; }
  .brand h1 { font-size: 1.5rem; max-width: none; }
  .panel { padding: 32px 20px 48px; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.span-all { grid-column: 1 / -1; }
.hint { font-size: .85rem; color: var(--muted); }
