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

/*
 * Tokens copied 1:1 from ateneoceladon.com's own globals.css (Celadon
 * Website Brandbook) so this dashboard reads as the same product, not a
 * generic admin skin bolted on next to it.
 */
:root {
  color-scheme: light;

  --navy: #003078;
  --ink: #18182a;
  --white: #ffffff;

  --on-navy: #c7d2e1;
  --accent: #f09b43;
  --link: #296bff;
  --accent-ink: #b2620e;

  --background: var(--white);
  --foreground: var(--ink);
  --muted: #f4f6fa;
  --muted-foreground: #4a5468;
  --border: #dde3ed;
  --navy-tint: #eef2f8;
  --danger: #b3261e;
  --success: #1e7a3d;

  --shadow-sm: 0 1px 2px rgba(0, 48, 120, 0.06);
  --shadow-md: 0 6px 24px -8px rgba(0, 48, 120, 0.18);
  --shadow-lg: 0 24px 64px -24px rgba(0, 48, 120, 0.28);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
}

::selection { background: var(--navy); color: var(--white); }

.display {
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0;
}

.eyebrow {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

button, input { font-family: inherit; }

/* Pressable: matches the brand's press feedback on every clickable surface. */
.pressable { transition: transform 160ms var(--ease-out); }
.pressable:active { transform: scale(0.97); }

@media (hover: hover) and (pointer: fine) {
  .lift { transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out); }
  .lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
}

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.topbar .brand { display: flex; align-items: center; gap: 0.6rem; }
.topbar .brand img { width: 32px; height: 32px; }
.topbar h1 { font-size: 1.4rem; }

button {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  cursor: pointer;
  border-radius: 999px;
  transition: background-color 200ms var(--ease-out);
}
button:hover { background: #002560; }

button.secondary {
  background: transparent;
  color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
}
button.secondary:hover { background: var(--navy); color: var(--white); }

button.danger { background: var(--danger); }
button.danger:hover { background: #8f1e18; }
button.success { background: var(--success) !important; }

input[type="text"], input[type="url"], input[type="password"] {
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  border-radius: 12px;
  width: 100%;
  color: var(--foreground);
}
input:focus { outline: 2px solid var(--navy); outline-offset: 1px; }

label {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  color: var(--navy);
  margin: 1.1rem 0 0.4rem;
}
label .req {
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--muted-foreground);
}

/* "Double-bezel" surface, lifted straight from the main site's Card
   component: an outer tray with a hairline ring, holding an inner plate. */
.surface {
  border-radius: 1.75rem;
  background: rgba(0, 48, 120, 0.035);
  box-shadow: inset 0 0 0 1px rgba(0, 48, 120, 0.07);
  padding: 0.4rem;
}
.surface > .surface-inner {
  border-radius: 1.375rem;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.5rem 1.75rem;
}

/* Login screen */
#login-screen {
  max-width: 360px;
  margin: 6rem auto;
  text-align: center;
}
#login-screen .surface-inner { padding: 2.5rem; }
#login-screen .brand-mark { width: 56px; height: 56px; margin: 0 auto 1rem; display: block; }
#login-screen h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
#login-screen form { display: flex; flex-direction: column; gap: 0.75rem; }
#login-error { color: var(--danger); font-size: 0.85rem; min-height: 1.2em; }

/* Create form */
#create-form { margin-bottom: 2rem; }
.form-title { font-size: 1.1rem; margin-bottom: 0.35rem; }
.form-hint { font-size: 0.85rem; color: var(--muted-foreground); margin: 0 0 0.25rem; }
.form-hint strong { color: var(--navy); }

.slug-input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}
.slug-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--muted);
  border-right: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.slug-input-group input { border: none; border-radius: 0; }
.slug-input-group input:focus { outline: none; }

#create-form button[type="submit"] { margin-top: 1.25rem; }
#create-error { color: var(--danger); font-size: 0.85rem; margin-top: 0.5rem; min-height: 1em; }

/* Links table */
.table-surface .surface-inner { padding: 0; overflow: hidden; }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.1em; color: var(--navy); background: var(--muted); }
tr:last-child td { border-bottom: none; }

td.short-link { white-space: nowrap; }
.short-link-row { display: flex; align-items: center; gap: 0.5rem; }
.short-link-row a { font-weight: 700; color: var(--ink); text-decoration: none; }
.short-link-row a:hover { color: var(--navy); text-decoration: underline; }

.copy-btn {
  background: transparent;
  color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--border);
  padding: 0.3rem 0.65rem;
  font-size: 0.65rem;
  border-radius: 999px;
}
.copy-btn:hover { background: var(--navy); color: #fff; box-shadow: inset 0 0 0 1px var(--navy); }

td.dest { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-foreground); }
td.actions { display: flex; gap: 0.4rem; white-space: nowrap; }
td.actions button { padding: 0.45rem 0.8rem; font-size: 0.65rem; }

.hidden { display: none !important; }

/* Toast */
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* QR modal */
#qr-modal {
  position: fixed; inset: 0; background: rgba(0, 48, 120, 0.55);
  display: flex; align-items: center; justify-content: center;
}
#qr-modal .qr-box {
  background: var(--white); padding: 2rem; text-align: center; max-width: 320px;
  border-radius: 1.75rem;
  box-shadow: var(--shadow-lg);
}
#qr-modal svg, #qr-modal canvas {
  width: 220px; height: 220px; margin: 0 auto 1rem; display: block;
  border-radius: 14px;
}
#qr-modal .qr-slug { font-size: 0.8rem; margin-bottom: 1rem; word-break: break-all; color: var(--muted-foreground); }
.qr-box-actions { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.qr-box-actions button { flex: 1; }
