:root{
  --bg: #0b1220;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --faint: rgba(255,255,255,.40);
  --border: rgba(255,255,255,.10);
  --shadow: 0 18px 60px rgba(0,0,0,.35);

  --accent: #7c5cff;
  --good: #2ee59d;
  --warn: #ffcc66;
  --bad:  #ff5c7a;

  --radius: 18px;
  --radius2: 14px;

  --tap: 48px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

html, body {
  height: 100%;
  background: radial-gradient(1200px 700px at 20% 0%, rgba(124,92,255,.22), transparent 60%),
              radial-gradient(900px 700px at 110% 30%, rgba(46,229,157,.16), transparent 55%),
              var(--bg);
  color: var(--text);
  margin: 0;
  font-family: var(--font);
}

* { box-sizing: border-box; }
button, input { font-family: inherit; }

.app-header{
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 14px 10px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(11,18,32,.88), rgba(11,18,32,.52));
  border-bottom: 1px solid var(--border);
}

.header-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

.logo{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(46,229,157,.92));
  color: rgba(8,10,16,.95);
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(124,92,255,.18);
  user-select:none;
}

.title{
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.1;
}
.subtitle{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68vw;
}

.header-actions{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items:center;
}

.search-wrap{ position: relative; }
.search{
  width: 100%;
  height: var(--tap);
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
}
.search::placeholder{ color: rgba(255,255,255,.45); }
.search:focus{
  border-color: rgba(124,92,255,.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}

.btn{
  height: var(--tap);
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-weight: 700;
  letter-spacing: .2px;
  touch-action: manipulation;
  transition: transform .12s ease, background .18s ease, border-color .18s ease;
}
.btn:active{ transform: scale(.98); }
.btn:hover{ background: rgba(255,255,255,.10); }
.btn.secondary{ color: rgba(255,255,255,.85); }
.btn.full{ width:100%; }

.icon-btn{
  width: var(--tap);
  height: var(--tap);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: var(--text);
  display:grid;
  place-items:center;
  transition: transform .12s ease, background .18s ease;
}
.icon-btn:active{ transform: scale(.98); }
.icon{ font-size: 18px; }

.chips{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip{
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.82);
  font-size: 13px;
  display:flex;
  align-items:center;
  gap: 8px;
  user-select:none;
}
.chip .pill{
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,.16);
}

.app-main{
  padding: 12px 14px 90px;
}

.notice{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 12px 12px;
  margin-bottom: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.16);
}
.notice-title{ font-weight: 800; }
.notice-body{ color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.35; }

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.04));
  box-shadow: 0 14px 45px rgba(0,0,0,.22);
  overflow: hidden;
  transform: translateY(6px);
  opacity: 0;
  animation: pop .35s ease forwards;
}
@keyframes pop{
  to { transform: translateY(0); opacity: 1; }
}

.card-head{
  padding: 12px 12px 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.card-title{
  font-weight: 900;
  letter-spacing: .2px;
}
.card-badge{
  font-size: 12px;
  color: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

.card-body{
  padding: 8px 12px 10px;
}
.row{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(255,255,255,.10);
}
.row:last-child{ border-bottom: none; }
.k{
  color: var(--muted);
  font-size: 13px;
  min-width: 42%;
}
.v{
  color: rgba(255,255,255,.90);
  font-weight: 650;
  font-size: 13px;
  text-align: right;
  word-break: break-word;
}

.card-actions{
  padding: 10px 12px 12px;
  display:flex;
  gap: 10px;
}
.card-actions:empty{ display:none; }

.small{
  height: 40px;
  border-radius: 14px;
  font-size: 13px;
}

.app-footer{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  background: linear-gradient(to top, rgba(11,18,32,.90), rgba(11,18,32,.55));
  border-top: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.footer-left, .footer-right{
  color: var(--muted);
  font-size: 12px;
  display:flex;
  align-items:center;
  gap: 8px;
}
.dot{
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(255,204,102,.15);
}

/* Bottom sheet (teman) */
.sheet-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sheet{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  background: rgba(18,24,38,.95);
  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  transform: translateY(105%);
  transition: transform .22s ease;
  padding: 10px 14px 14px;
  z-index: 30;
}
.sheet.open{ transform: translateY(0); }
.sheet-handle{
  width: 56px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.28);
  margin: 4px auto 10px;
}
.sheet-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}
.sheet-title{ font-weight: 900; }
.theme-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.theme-card{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 10px;
  min-height: 80px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap: 10px;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}
.theme-card:active{ transform: scale(.99); }
.theme-card.selected{
  border-color: rgba(124,92,255,.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,.14);
}
.theme-name{ font-weight: 850; }
.theme-samples{
  display:flex;
  gap: 6px;
}
.sample{
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
}
.sheet-footer{ margin-top: 12px; }

/* Tablet / större */
@media (min-width: 760px){
  .app-main{ max-width: 960px; margin: 0 auto; }
  .grid{ grid-template-columns: 1fr 1fr; }
  .subtitle{ max-width: 520px; }
  .theme-grid{ grid-template-columns: 1fr 1fr 1fr; }
}

/* Themes via data-theme on html */
html[data-theme="midnight"]{
  --bg: #070a12;
  --accent: #7c5cff;
}
html[data-theme="arctic"]{
  --bg: #071622;
  --panel: rgba(255,255,255,.08);
  --accent: #3aa0ff;
  --good: #16d6a2;
  --warn: #ffd166;
}
html[data-theme="sunset"]{
  --bg: #140a12;
  --accent: #ff4d8d;
  --good: #2ee59d;
  --warn: #ffcc66;
}
html[data-theme="mint"]{
  --bg: #061413;
  --accent: #2ee59d;
  --good: #2ee59d;
  --warn: #ffcc66;
}
html[data-theme="paper"]{
  --bg: #f7f7fb;
  --text: rgba(10,12,18,.92);
  --muted: rgba(10,12,18,.62);
  --faint: rgba(10,12,18,.38);
  --border: rgba(10,12,18,.10);
  --panel: rgba(10,12,18,.06);
  --panel2: rgba(10,12,18,.08);
  --accent: #4b63ff;
  --good: #0aa36b;
  --warn: #b26b00;
  --bad: #c8183a;
  background: radial-gradient(1200px 700px at 20% 0%, rgba(75,99,255,.18), transparent 60%),
              radial-gradient(900px 700px at 110% 30%, rgba(10,163,107,.12), transparent 55%),
              var(--bg);
}
html[data-theme="paper"] .sheet{
  background: rgba(255,255,255,.92);
}
