:root{
  --ink: #1a2332;
  --sea: #2c5f6e;
  --leaf: #3d7a5a;
  --sand: #f7f4ee;
  --glass-bg: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.12);
}

body{
  font-family: 'Source Sans 3', system-ui, sans-serif;
  background:
    radial-gradient(ellipse 120% 70% at 5% -10%, #d8e6e1 0%, transparent 50%),
    radial-gradient(ellipse 90% 50% at 100% 0%, #ebe3d4 0%, transparent 45%),
    var(--sand);
  color: var(--ink);
  min-height: 100vh;
}

.brand-name{
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.brand-mark{
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  display: grid;
  place-items: center;
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 1.35rem;
}
.brand-link{ text-decoration: none; }

.dynpal-header{
  background: linear-gradient(135deg, #2c5f6e 0%, #1e4a56 100%);
  color: #fff;
  padding: 0.85rem 1.1rem;
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(44, 95, 110, 0.25);
}
.dynpal-header .btn{
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
  color: #fff;
}
.dynpal-header .btn:hover{ background: rgba(255,255,255,.24); color: #fff; }
.dynpal-header .btn-primary{
  background: var(--leaf);
  border-color: transparent;
  color: #fff;
}
.dynpal-header .btn-primary:hover{ filter: brightness(1.08); color: #fff; }
.dynpal-header .btn-admin{ background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35); color: #fff; }
.dynpal-header .theme-toggle-link{ color: rgba(255,255,255,.85); text-decoration: none; }
.dynpal-header .theme-toggle-link:hover{ color: #fff; }
.dynpal-header .theme-toggle-on{ background: rgba(255,255,255,.22); color: #fff; }
.dynpal-header .theme-toggle-off{ color: rgba(255,255,255,.7); }

.help-box {
  margin-top: 1.25rem;
  background: #eef5f3;
  border: 1px solid rgba(44, 95, 110, 0.18);
  border-left: 5px solid #2c5f6e;
  border-radius: 0.85rem;
  padding: 1.1rem 1.25rem;
}
.help-box-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: #2c5f6e;
  margin-bottom: 0.5rem;
}
.help-box-body { font-size: 1.05rem; color: #334155; line-height: 1.55; }
.help-steps { margin: 0; padding-left: 1.25rem; }
.help-steps li { margin-bottom: 0.35rem; }

.btn{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.65rem 1.05rem; border-radius:.75rem;
  background:#fff;
  border:1px solid #cbd5e1;
  color:#334155;
  transition:all .2s ease;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover{ background:#f1f5f9; border-color:#94a3b8; transform:translateY(-1px); }
.btn:focus-visible{ outline:2px solid #2c5f6e; outline-offset:2px; }
.btn-primary{ background:#3d7a5a; border-color:#356b4f; color:#fff; }
.btn-primary:hover{ background:#4a8f6a; color:#fff; }
.btn-admin{ background:rgba(44,95,110,.12); border-color:rgba(44,95,110,.3); color:#2c5f6e; }
.btn-admin:hover{ background:rgba(44,95,110,.2); color:#1e4a56; }
.btn-sm{ padding:.35rem .75rem; font-size:.875rem; }
.btn-danger{ background:rgba(239,68,68,.12); border-color:rgba(239,68,68,.35); color:#b91c1c; }
.btn-danger:hover{ background:rgba(239,68,68,.2); color:#b91c1c; }

.badge{ display:inline-block; padding:.2rem .5rem; border-radius:999px; font-size:.75rem; font-weight:600; }
.badge-admin{ background:rgba(44,95,110,.15); color:#2c5f6e; }
.badge-user{ background:#e2e8f0; color:#475569; }

.card-link{
  display:block;
  padding:1.5rem;
  border-radius:1.25rem;
  border:1px solid #e2e8f0;
  background:#fff;
  transition:all .2s ease;
  text-decoration:none;
  color:inherit;
}
.card-link:hover{ background:#f8fafc; border-color:#cbd5e1; transform:translateY(-2px); box-shadow:0 12px 28px rgba(0,0,0,.08); }
.card-icon{ font-size:2rem; margin-bottom:.5rem; opacity:.9; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="url"], select, textarea{
  background:#fff !important;
  color:#1e293b !important;
  border:1px solid #cbd5e1 !important;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder{ color: #64748b; }
input:focus, select:focus, textarea:focus{
  border-color:#2c5f6e !important;
  box-shadow: 0 0 0 3px rgba(44,95,110,.18);
  outline: none;
}

.site-footer {
  text-align: center;
}
@media (min-width: 640px) {
  .site-footer { text-align: left; }
}
.powered-by {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
}
.powered-by a {
  color: #2c5f6e;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.powered-by a:hover { color: #1e4a56; }
.theme-dark .powered-by { color: #94a3b8; }
.theme-dark .powered-by a { color: #9fd0c0; }

html:not(.theme-dark) [class*="bg-white/5"],
html:not(.theme-dark) [class*="bg-white\\/5"]{ background: #fff !important; }
html:not(.theme-dark) [class*="border-white/10"]{ border-color: #e2e8f0 !important; }

/* Tumma teema */
.theme-dark body{
  background:
    radial-gradient(1200px 600px at 5% -5%, rgba(44,95,110,.25), transparent 50%),
    radial-gradient(800px 500px at 95% 5%, rgba(61,122,90,.12), transparent 50%),
    linear-gradient(180deg, #0f1720 0%, #0a1018 100%);
  color:#e5e7eb;
}

.theme-dark .dynpal-header{
  background: linear-gradient(135deg, #1e4a56 0%, #163840 100%) !important;
}
.theme-dark .help-box{ background: #1a2e34; border-color: rgba(255,255,255,.1); color: #e2e8f0; }
.theme-dark .help-box-title{ color: #9fd0c0; }
.theme-dark .help-box-body{ color: #cbd5e1; }

.theme-dark .btn{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
  color: #e2e8f0;
}
.theme-dark .btn:hover{ background: rgba(255,255,255,.14); color: #fff; }
.theme-dark .btn-primary{ background: rgba(61,122,90,.55); border-color: rgba(61,122,90,.7); color: #fff; }
.theme-dark .btn-admin{ background: rgba(44,95,110,.35); border-color: rgba(44,95,110,.5); color: #b6d4dc; }
.theme-dark .btn-danger{ background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.4); color: #fca5a5; }

.theme-dark .card-link{
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: #e5e7eb;
}
.theme-dark .text-slate-100,
.theme-dark .text-gray-900,
.theme-dark .text-gray-800,
.theme-dark .text-gray-700,
.theme-dark .text-gray-600,
.theme-dark .text-gray-500,
.theme-dark .text-black{ color: #e2e8f0; }
.theme-dark .text-slate-500{ color: #94a3b8; }

.theme-dark .bg-white{ background: #16232e !important; }
.theme-dark .bg-gray-50{ background: #1e2d38 !important; }
.theme-dark .bg-gray-100{ background: #2a3b48 !important; color: #e2e8f0; }
.theme-dark .border-gray-200{ border-color: #2a3b48; }
.theme-dark .bg-red-50{ background: #450a0a !important; }
.theme-dark .text-red-900{ color: #fca5a5; }
.theme-dark .border-red-200{ border-color: #7f1d1d; }
.theme-dark .bg-green-50{ background: #14532d !important; }
.theme-dark .text-green-900,
.theme-dark .text-green-700{ color: #86efac; }
.theme-dark .border-green-200{ border-color: #166534; }
.theme-dark .bg-amber-50{ background: #1e3a5f !important; }
.theme-dark .text-amber-900,
.theme-dark .text-amber-700{ color: #e2e8f0; }
.theme-dark .border-amber-200{ border-color: #334155; }

.theme-dark input[type="text"],
.theme-dark input[type="email"],
.theme-dark input[type="password"],
.theme-dark input[type="number"],
.theme-dark input[type="search"],
.theme-dark input[type="url"],
.theme-dark select,
.theme-dark textarea{
  background: #1e2d38 !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}
.theme-dark input:focus,
.theme-dark select:focus,
.theme-dark textarea:focus{
  border-color: #2c5f6e !important;
  box-shadow: 0 0 0 3px rgba(44,95,110,.35);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin: 1rem 0 0;
  padding: 0.65rem 0.9rem;
  background: rgba(255,255,255,.72);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.98rem;
  line-height: 1.4;
}
.crumb-link {
  color: #2c5f6e;
  font-weight: 600;
  text-decoration: none;
}
.crumb-link:hover { text-decoration: underline; }
.crumb-sep {
  color: #94a3b8;
  font-weight: 600;
  user-select: none;
}
.crumb-current {
  color: #1a2332;
  font-weight: 700;
}
.theme-dark .breadcrumbs {
  background: rgba(255,255,255,.05);
  border-color: #334155;
}
.theme-dark .crumb-link { color: #9fd0c0; }
.theme-dark .crumb-current { color: #e2e8f0; }
.theme-dark .crumb-sep { color: #64748b; }

/* Teemavalinta asetuksissa */
.theme-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.15rem;
  border-radius: 0.75rem;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: #1e293b;
}
.theme-choice input { width: 1.15rem; height: 1.15rem; }
.theme-choice-on {
  border-color: #2c5f6e;
  background: #eef5f3;
  color: #2c5f6e;
}
.theme-dark .theme-choice {
  background: #1e2d38;
  border-color: #475569;
  color: #e2e8f0;
}
.theme-dark .theme-choice-on {
  border-color: #9fd0c0;
  background: #1a2e34;
  color: #9fd0c0;
}
