* {
  box-sizing: border-box;
}

:root {
  --bg: #0b0b0b;
  --panel: rgba(22, 22, 22, 0.72);
  --text: #f4f4f4;
  --muted: #aaa;
  --border: rgba(255,255,255,0.08);
  --input: rgba(0,0,0,0.28);
  --accent: #ff9f1c;
}

body.light {
  --bg: #f4f4f4;
  --panel: rgba(255,255,255,0.82);
  --text: #111;
  --muted: #555;
  --border: rgba(0,0,0,0.12);
  --input: rgba(255,255,255,0.88);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top, #252525, var(--bg) 65%);
  color: var(--text);
  overflow-x: hidden;
}

body.light {
  background: radial-gradient(circle at top, #ffffff, #e9e9e9 65%);
}

.hidden,
.lock-screen.hidden,
.palette.hidden {
  display: none !important;
}

.bg-glow {
  position: fixed;
  right: -120px;
  bottom: -180px;
  width: 420px;
  height: 420px;
  background: var(--accent);
  filter: blur(120px);
  opacity: 0.22;
  animation: floatGlow 6s ease-in-out infinite alternate;
  pointer-events: none;
}

.lock-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #252525, #080808 70%);
  z-index: 1000;
}

.lock-card {
  width: min(360px, 92vw);
  padding: 28px;
  border-radius: 24px;
  background: rgba(20,20,20,0.9);
  border: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  box-shadow: 0 30px 100px rgba(0,0,0,0.45);
  animation: fadeIn 0.5s ease forwards;
}

.lock-card img {
  width: 130px;
  background: white;
  padding: 10px;
  border-radius: 18px;
  margin-bottom: 14px;
}

.lock-card input {
  width: 100%;
  margin: 18px 0 10px;
}

.lock-card small {
  display: block;
  margin-top: 12px;
  color: #888;
}

.app {
  max-width: 1180px;
  margin: auto;
  padding: 32px;
}

header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
}

.logo {
  width: 140px;
  background: rgba(255,255,255,0.95);
  padding: 10px;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: logoPulse 3s ease-in-out infinite;
}

.badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,159,28,0.15);
  color: #ffb347;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -2px;
}

h2,
p {
  margin: 0;
}

header p {
  margin-top: 6px;
  color: var(--muted);
}

.staff-panel {
  margin-left: auto;
  text-align: right;
}

#liveClock {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.status-btn {
  border-radius: 999px;
  padding: 8px 14px;
}

.status-btn.off {
  background: #2a2a2a;
  color: #aaa;
}

.status-btn.on {
  background: #34c759;
  color: black;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

button {
  border: 0;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #ffb347, #ff7a18);
  color: #111;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255,122,24,0.25);
}

button:active {
  transform: scale(0.97);
}

button.danger {
  background: #2a2a2a;
  color: #ff6b6b;
}

.workspace {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 22px 80px rgba(0,0,0,0.28);
}

#searchInput,
#pinInput,
#noteTitle,
#noteBody,
#commandInput {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  outline: none;
  transition: 0.2s ease;
}

#searchInput,
#pinInput {
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 14px;
}

#notesList {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.note-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  color: var(--text);
  transition: 0.2s ease;
  animation: notePop 0.25s ease;
}

body.light .note-item {
  background: rgba(0,0,0,0.05);
}

.note-item:hover,
.note-item.active {
  background: rgba(255,159,28,0.16);
  transform: translateX(4px);
}

.note-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.editor {
  display: grid;
  gap: 12px;
}

#noteTitle:focus,
#noteBody:focus,
#searchInput:focus,
#pinInput:focus,
#commandInput:focus {
  border-color: rgba(255,159,28,0.65);
  box-shadow: 0 0 0 4px rgba(255,159,28,0.08);
}

#noteTitle {
  font-size: 24px;
  font-weight: 800;
  padding: 14px;
  border-radius: 14px;
}

#noteBody {
  min-height: 500px;
  resize: vertical;
  padding: 16px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.6;
}

.meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

#status {
  color: var(--muted);
  font-size: 13px;
}

.palette {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  z-index: 999;
}

.palette-box {
  width: min(620px, 92vw);
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 100px rgba(0,0,0,0.45);
}

#commandInput {
  border: none;
  padding: 18px;
  background: transparent;
  font-size: 18px;
}

.command-item {
  padding: 16px 18px;
  cursor: pointer;
  transition: 0.2s;
  border-top: 1px solid var(--border);
}

.command-item:hover {
  background: rgba(255,159,28,0.15);
}

.fade-in {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeIn 0.65s ease forwards;
}

.delay-1 {
  animation-delay: 0.12s;
}

.delay-2 {
  animation-delay: 0.24s;
}

.shake {
  animation: shake 0.25s ease;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoPulse {
  50% {
    transform: translateY(-4px) scale(1.02);
  }
}

@keyframes notePop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes floatGlow {
  to {
    transform: translate(-40px, -35px) scale(1.08);
  }
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }

  50% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }
}

@media (max-width: 800px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .staff-panel {
    margin-left: 0;
    text-align: left;
  }

  .app {
    padding: 20px;
  }
}