:root {
  --blue: #073b78;
  --green: #0f8f4f;
  --amber: #d99a16;
  --red: #c92a2a;
  --bg: #f7f9fc;
  --panel: #ffffff;
  --input: #ffffff;
  --text: #152033;
  --muted: #58657b;
  --line: #d9e2ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 10;
  padding: 18px;
}

.login-screen.hidden { display: none; }

.login-box {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  text-align: center;
}

.login-box img {
  width: 180px;
  max-width: 70%;
}

.login-box button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 700;
}

.login-box button.google-login {
  margin-top: 10px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
}

.app {
  width: min(940px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.top {
  text-align: center;
  padding: 12px 0 18px;
}

.top img {
  max-width: 210px;
  width: 58%;
  height: auto;
}

h1, h2, p { margin: 0; }
h1 { text-transform: uppercase; font-size: 28px; }
h2 { font-size: 24px; margin: 22px 0 12px; }
.top p, .hint { color: var(--muted); margin-top: 6px; }
.sync {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  background: #eaf1fb;
  color: var(--blue);
}

.apk-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.login-apk {
  margin-top: 12px;
}

.cloud {
  margin: 12px auto 0;
  max-width: 620px;
  text-align: left;
}

.cloud summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
  text-align: center;
}

.cloud form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 10px;
  padding: 10px;
}

body[data-online="online"] .sync {
  background: #e8f5ec;
  color: var(--green);
}

body[data-online="offline"] .sync {
  background: #fff4db;
  color: var(--amber);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}

.tabs button, .panel button, .card a {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(16, 24, 40, 0.06);
}

.tabs button.active, .panel button, .card a {
  background: var(--blue);
  color: white;
}

.panel button.secondary {
  background: var(--input);
  color: var(--text);
  margin-top: 8px;
}

.view { display: none; }
.view.active { display: block; }

.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 10px 0;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

input, textarea, select {
  width: 100%;
  min-height: 48px;
  margin: 7px 0;
  border: 1px solid #b8c5d8;
  background: var(--input);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.search {
  background: var(--input);
  border-color: #b8c5d8;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.summary .card {
  margin: 0;
  text-align: center;
}

.summary strong {
  display: block;
  color: var(--blue);
  font-size: 24px;
}

textarea { min-height: 104px; resize: vertical; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 8px 0;
  padding: 10px;
}

legend { font-weight: 700; color: var(--blue); }
label { display: block; margin: 10px 0; }
label input { width: auto; min-height: auto; margin-right: 8px; }

.card h3 { margin: 0 0 8px; }
.card p { color: var(--muted); margin: 4px 0; }
.card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 14px;
  margin-top: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.actions button, .actions a {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 700;
}

.actions button {
  background: var(--input);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.actions button.danger {
  color: var(--red);
}

@media (max-width: 720px) {
  .tabs { grid-template-columns: 1fr 1fr; }
  .summary { grid-template-columns: 1fr; }
  h1 { font-size: 23px; }
}
