* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
  background: #0a0a0a;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  color: #c8c8c8;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

[x-cloak] { display:none !important; }

/* ── Relogin Banner ── */
.relogin-banner {
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.3);
  color: #ffcc00;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-family: 'Courier New', monospace;
}
.relogin-banner .btn-small {
  background: rgba(255, 204, 0, 0.2);
  border: 1px solid rgba(255, 204, 0, 0.4);
  color: #ffcc00;
}

/* ── Loading ── */
#loading-screen {
  display:flex; align-items:center; justify-content:center;
  min-height:100vh; background:#0a0a0a;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  color: #888;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

/* ── Logo ── */
.logo-container {
  text-align: center;
  margin-bottom: 16px;
}

.logo {
  width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.logo-nav {
  height: 28px;
  width: auto;
  margin-right: 8px;
}

/* ── Auth ── */
.auth-screen {
  display:flex; align-items:center; justify-content:center;
  min-height:100vh; padding:20px;
}

.auth-box {
  background: #111;
  border: 1px solid #333;
  padding: 32px;
  width: 100%;
  max-width: 420px;
}

.auth-box h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 18px;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid #333;
  padding-bottom: 16px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #333;
  margin-bottom: 20px;
}

.tabs button {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: #666;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs button.active {
  color: #fff;
  border-bottom-color: #fff;
}

.auth-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Remember me ── */
.remember-me {
  display: flex;
  align-items: center;
}

.remember-me label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: #888;
  letter-spacing: 0.5px;
}

.remember-me input[type="checkbox"] {
  width: auto;
  accent-color: #fff;
  cursor: pointer;
}

/* ── App footer ── */
.app-footer {
  text-align: center;
  padding: 12px;
  border-top: 1px solid #222;
  background: #0d0d0d;
  font-size: 11px;
}

.app-footer a {
  color: #444;
  text-decoration: none;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.app-footer a:hover {
  color: #888;
}

/* ── Dropdown ── */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #111;
  border: 1px solid #333;
  min-width: 180px;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.dropdown-menu button {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: #ccc;
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #222;
}

.dropdown-menu button:last-child {
  border-bottom: none;
}

.dropdown-menu button:hover {
  background: #1a1a1a;
  color: #fff;
}

/* ─ Password field with eye toggle ── */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 36px;
}

.eye-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: #1a1a1a;
  border: 1px solid #444;
  color: #ccc;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}

.eye-toggle:hover {
  background: #2a2a2a;
  border-color: #888;
  color: #fff;
}

/* ── Form labels ── */
.form-label {
  display: block;
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

/* ─ Date picker ─ */
.date-picker-field {
  position: relative;
  display: flex;
  align-items: center;
}

.date-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.date-display {
  padding: 10px 40px 10px 12px;
  border: 1px solid #333;
  background: #0a0a0a;
  color: #c8c8c8;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.date-display:hover,
.date-display:focus {
  border-color: #666;
}

.date-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: #1a1a1a;
  border: 1px solid #444;
  color: #ccc;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-toggle:hover {
  background: #2a2a2a;
  border-color: #888;
  color: #fff;
}

/* ── Copyright ── */
.copyright {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #222;
  font-size: 11px;
}

.copyright a {
  color: #444;
  text-decoration: none;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.copyright a:hover {
  color: #888;
}

input, textarea {
  padding: 10px 12px;
  border: 1px solid #333;
  background: #0a0a0a;
  color: #c8c8c8;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, textarea:focus {
  border-color: #666;
}

textarea {
  resize: vertical;
}

.btn-primary {
  padding: 10px;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #000;
  color: #fff;
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-small {
  padding: 4px 10px;
  border: 1px solid #444;
  background: transparent;
  color: #888;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-small:hover {
  border-color: #888;
  color: #fff;
}

.btn-danger {
  border-color: #552222;
  color: #aa4444;
}

.btn-danger:hover {
  border-color: #aa4444;
  color: #ff6666;
}

.error {
  color: #aa4444;
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
}

/* ── App Layout ── */
.app-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

nav {
  background: #111;
  border-bottom: 1px solid #333;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}

.nav-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-header h2 {
  color: #fff;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  gap: 0;
}

.nav-tabs button {
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #555;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.nav-tabs button.active {
  color: #fff;
  border-bottom-color: #fff;
}

.nav-tabs button:hover {
  color: #aaa;
}

main {
  flex: 1;
  overflow: auto;
  display: flex;
  padding: 20px;
}

.tab-content {
  flex: 1;
  display: flex;
}

.tab-content > div {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* ── Chat ── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 100px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message {
  max-width: 85%;
  padding: 10px 14px;
  border: 1px solid #333;
  background: #111;
  font-size: 13px;
  line-height: 1.6;
}

.message.user {
  align-self: flex-end;
  border-color: #555;
  background: #1a1a1a;
}

.message.assistant {
  align-self: flex-start;
  border-color: #333;
}

.msg-content {
  word-break: break-word;
}

.msg-content p {
  margin: 4px 0;
}

.msg-content code {
  background: #0a0a0a;
  border: 1px solid #333;
  padding: 2px 6px;
  font-size: 12px;
}

.msg-content pre {
  background: #0a0a0a;
  border: 1px solid #333;
  padding: 10px;
  overflow-x: auto;
  margin: 8px 0;
}

.msg-content pre code {
  border: none;
  padding: 0;
}

.msg-time {
  font-size: 10px;
  color: #555;
  margin-top: 6px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #555;
  animation: blink 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid #333;
  margin-top: auto;
}

.chat-input input {
  flex: 1;
}

.chat-input button {
  padding: 10px 20px;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
}

.chat-input button:hover {
  background: #000;
  color: #fff;
}

.chat-input button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ─ Diary / Calendar / Search ── */
.diary-container,
.calendar-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 100px);
}

.diary-container form,
.diary-container .diary-form,
.calendar-container form,
.calendar-container .calendar-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid #333;
  background: #111;
}

.calendar-container form input[type="date"] {
  max-width: 200px;
}

.diary-entries,
.calendar-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diary-entry,
.calendar-event {
  border: 1px solid #333;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  background: #0d0d0d;
}

.diary-entry:hover,
.calendar-event:hover {
  border-color: #555;
}

.entry-text,
.event-text {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #555;
  white-space: nowrap;
}

.event-date {
  color: #888;
  font-size: 12px;
  min-width: 90px;
  font-weight: bold;
}

/* ── Search Results ── */
.diary-entry a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 13px;
}

.diary-entry a:hover {
  text-decoration: underline;
}

/* ─ Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #333; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .nav-tabs button {
    padding: 10px 10px;
    font-size: 11px;
  }
  .auth-box {
    padding: 20px;
  }
  main {
    padding: 12px;
  }
}

/* ── Form row ── */
.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Select input ── */
.select-input {
  padding: 10px 12px;
  border: 1px solid #333;
  background: #0a0a0a;
  color: #c8c8c8;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  flex: 1;
}

.select-input:focus {
  border-color: #666;
}

/* ── Color input ── */
.color-input {
  width: 40px;
  height: 36px;
  border: 1px solid #333;
  background: #0a0a0a;
  cursor: pointer;
  padding: 2px;
}

/* ── Relevance stars ── */
.relevance-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.relevance-important {
  background: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
  border: 1px solid rgba(255, 59, 48, 0.4);
}
.relevance-medium {
  background: rgba(255, 204, 0, 0.2);
  color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, 0.4);
}
.relevance-low {
  background: rgba(142, 142, 147, 0.2);
  color: #8e8e93;
  border: 1px solid rgba(142, 142, 147, 0.4);
}
.relevance-note {
  background: rgba(0, 122, 255, 0.2);
  color: #007aff;
  border: 1px solid rgba(0, 122, 255, 0.4);
}
.note-icon {
  width: 14px;
  height: 14px;
}
.relevance-select option {
  font-weight: 600;
}
.relevance-select option[value="important"] { color: #ff3b30; }
.relevance-select option[value="medium"] { color: #ffcc00; }
.relevance-select option[value="low"] { color: #8e8e93; }
.relevance-select option[value="note"] { color: #007aff; }

/* ── Voice ── */
.voice-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c8c8c8;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.voice-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}
.voice-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.voice-btn.recording {
  background: rgba(255, 59, 48, 0.2);
  border-color: rgba(255, 59, 48, 0.5);
  animation: pulse-btn 1.5s infinite;
}
@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
}
.recording-indicator {
  text-align: center;
  padding: 8px;
  color: #ff3b30;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.recording-indicator .pulse {
  width: 8px;
  height: 8px;
  background: #ff3b30;
  border-radius: 50%;
  animation: pulse-dot 1s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

/* ── Prompts ── */
.prompts-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prompt-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 12px;
}
.prompt-item.active {
  border-color: rgba(0, 255, 136, 0.3);
  background: rgba(0, 255, 136, 0.05);
}
.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.prompt-name {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.prompt-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.active-badge {
  background: rgba(0, 255, 136, 0.2);
  color: #00ff88;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid rgba(0, 255, 136, 0.3);
}
.prompt-text {
  color: #888;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-edit-area {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c8c8c8;
  padding: 10px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  resize: vertical;
}
.prompt-edit-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-box h3 {
  color: #fff;
  margin-bottom: 16px;
  font-size: 16px;
}
.suggestion-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.suggestion-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 8px;
}
.suggestion-text {
  color: #c8c8c8;
  font-size: 13px;
  padding-left: 24px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* ── Role Badges ── */
.user-role-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.role-super_admin {
  background: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
  border: 1px solid rgba(255, 59, 48, 0.4);
}
.role-admin {
  background: rgba(255, 204, 0, 0.2);
  color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, 0.4);
}
.role-user {
  background: rgba(255, 255, 255, 0.1);
  color: #888;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ── Invite Field ── */
.invite-field {
  margin-bottom: 12px;
}
.invite-field input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c8c8c8;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.invite-field input:focus {
  outline: none;
  border-color: rgba(0, 255, 136, 0.4);
}

/* ── Admin Panel ── */
.admin-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-section:last-child {
  border-bottom: none;
}
.invite-code-display {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.invite-code-display span {
  color: #00ff88;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 3px;
  font-family: 'Courier New', monospace;
}
.invites-list, .users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invite-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.invite-item.used {
  opacity: 0.5;
}
.invite-code {
  color: #fff;
  font-weight: 600;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  margin-right: 12px;
}
.invite-status {
  color: #888;
  font-size: 12px;
}
.user-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.user-name {
  color: #fff;
  font-weight: 600;
  margin-right: 8px;
}
.user-id {
  color: #666;
  font-size: 12px;
  margin-left: 8px;
}
.user-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.role-select {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c8c8c8;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

/* ── SSL ── */
.ssl-status {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}
.ssl-info-row {
  display: flex;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ssl-info-row:last-child {
  border-bottom: none;
}
.ssl-label {
  color: #666;
  font-size: 13px;
  min-width: 100px;
}
.ssl-value {
  color: #c8c8c8;
  font-size: 13px;
  word-break: break-all;
}
.ssl-type-badge {
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.ssl-custom {
  background: rgba(0, 122, 255, 0.2);
  color: #007aff;
  border: 1px solid rgba(0, 122, 255, 0.4);
}
.ssl-letsencrypt {
  background: rgba(52, 199, 89, 0.2);
  color: #34c759;
  border: 1px solid rgba(52, 199, 89, 0.4);
}
.ssl-self_signed {
  background: rgba(255, 204, 0, 0.2);
  color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, 0.4);
}
.ssl-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.ssl-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 16px;
}
.ssl-upload .form-row {
  margin-bottom: 12px;
}
.ssl-file-input {
  flex: 1;
}
.ssl-file-input label {
  display: block;
  color: #888;
  font-size: 12px;
  margin-bottom: 6px;
}
.ssl-file-input input[type="file"] {
  width: 100%;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #c8c8c8;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}
.ssl-file-input input[type="file"]::file-selector-button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #c8c8c8;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  margin-right: 8px;
}
.le-form .form-row {
  margin-bottom: 12px;
}
.success {
  color: #34c759;
  margin-top: 8px;
  font-size: 13px;
}

/* ── General Settings ── */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.setting-item:last-child {
  border-bottom: none;
}
.setting-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.setting-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.setting-desc {
  color: #666;
  font-size: 12px;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  transition: 0.3s;
  border-radius: 26px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: #888;
  transition: 0.3s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(0, 255, 136, 0.2);
  border-color: rgba(0, 255, 136, 0.4);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
  background: #00ff88;
}

/* ── Update Section ── */
.update-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.btn-update {
  background: linear-gradient(135deg, #00ff88, #00cc6a);
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-update:hover:not(:disabled) {
  background: linear-gradient(135deg, #33ffaa, #00ff88);
  transform: translateY(-1px);
}
.btn-update:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.update-log {
  margin-top: 12px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 12px;
  color: #888;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Entry Type Toggle ── */
.entry-type-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.entry-type-toggle button {
  flex: 1;
  padding: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #888;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  transition: all 0.2s;
}
.entry-type-toggle button.active {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.3);
  color: #00ff88;
}

/* ── Checklist ── */
.checklist-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checklist-item-input {
  display: flex;
  gap: 8px;
}
.checklist-item-input input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c8c8c8;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}
.checklist-item-input button {
  padding: 10px 16px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: #00ff88;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}
.checklist-title-input {
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c8c8c8;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
}
.checklist-title-input:focus {
  outline: none;
  border-color: rgba(0, 255, 136, 0.4);
}
.checklist-preview {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.checklist-preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  font-size: 13px;
}
.checklist-preview-item button {
  background: none;
  border: none;
  color: #ff3b30;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}
.checklist-display {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.checklist-title {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 10px;
  margin-bottom: 4px;
  border-left: 3px solid #00ff88;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.checklist-item.checked {
  opacity: 0.5;
  text-decoration: line-through;
}
.checklist-item input[type="checkbox"] {
  accent-color: #00ff88;
  width: 16px;
  height: 16px;
}

/* ── Inline Relevance ── */
.inline-relevance-select {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.inline-relevance-select.relevance-important {
  color: #ff3b30;
  border-color: rgba(255, 59, 48, 0.3);
}
.inline-relevance-select.relevance-medium {
  color: #ffcc00;
  border-color: rgba(255, 204, 0, 0.3);
}
.inline-relevance-select.relevance-low {
  color: #8e8e93;
  border-color: rgba(142, 142, 147, 0.3);
}
.inline-relevance-select.relevance-note {
  color: #007aff;
  border-color: rgba(0, 122, 255, 0.3);
}

/* ── Entry Actions ── */
.entry-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn-edit {
  background: rgba(0, 122, 255, 0.1);
  border: 1px solid rgba(0, 122, 255, 0.3);
  color: #007aff;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 4px 8px;
  transition: all 0.2s;
}
.btn-edit:hover {
  background: rgba(0, 122, 255, 0.2);
}

/* ── Modal Large ── */
.modal-large {
  max-width: 600px;
}
.modal-xlarge {
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-large textarea,
.modal-large .select-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c8c8c8;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  margin-bottom: 8px;
}
.modal-large textarea:focus,
.modal-large .select-input:focus {
  outline: none;
  border-color: rgba(0, 255, 136, 0.4);
}

/* ── View User ── */
.btn-view {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: #00ff88;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 4px 8px;
  transition: all 0.2s;
}
.btn-view:hover {
  background: rgba(0, 255, 136, 0.2);
}
.user-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.stat-badge {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #c8c8c8;
}
.view-user-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.view-user-tabs button {
  flex: 1;
  padding: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #888;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  transition: all 0.2s;
}
.view-user-tabs button.active {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.3);
  color: #00ff88;
}
.view-user-content {
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.view-user-entry {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}
.view-user-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #888;
  flex-wrap: wrap;
}
.view-user-encrypted {
  color: #555;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  word-break: break-all;
}
.view-user-note {
  color: #ffcc00;
  font-size: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.view-user-chat {
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.message-user {
  background: rgba(0, 122, 255, 0.1);
  border: 1px solid rgba(0, 122, 255, 0.2);
}
.message-assistant {
  background: rgba(0, 255, 136, 0.05);
  border: 1px solid rgba(0, 255, 136, 0.15);
}
.view-user-chat-role {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.view-user-chat-content {
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}
.view-user-chat-time {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
}
.entry-type-badge {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

/* ── Sharing ── */
.btn-share {
  background: rgba(0, 122, 255, 0.1);
  border: 1px solid rgba(0, 122, 255, 0.3);
  color: #007aff;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 4px 8px;
  transition: all 0.2s;
}
.btn-share:hover {
  background: rgba(0, 122, 255, 0.2);
}
.btn-accept {
  background: rgba(52, 199, 89, 0.1);
  border: 1px solid rgba(52, 199, 89, 0.3);
  color: #34c759;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 4px 8px;
  transition: all 0.2s;
}
.btn-accept:hover {
  background: rgba(52, 199, 89, 0.2);
}
.shared-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed rgba(0, 122, 255, 0.3);
}
.shared-entry {
  border-color: rgba(0, 122, 255, 0.2);
  background: rgba(0, 122, 255, 0.03);
}
.shared-from-badge {
  background: rgba(0, 122, 255, 0.15);
  color: #007aff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid rgba(0, 122, 255, 0.3);
}
.share-search-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c8c8c8;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  margin-bottom: 12px;
}
.share-search-input:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.4);
}
.share-user-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.share-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.share-user-item:hover {
  background: rgba(0, 122, 255, 0.1);
  border-color: rgba(0, 122, 255, 0.3);
}
.share-relationship-badge {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.star {
  background: none;
  border: none;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.star.star-active {
  color: #ffcc00;
}

.star:hover {
  color: #ffdd44;
}

.entry-stars {
  display: flex;
  gap: 1px;
}

.entry-stars .star {
  cursor: default;
  font-size: 12px;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid #333;
  border-top: none;
  background: #0d0d0d;
  flex-wrap: wrap;
}

.filter-input {
  flex: 1;
  min-width: 150px;
  padding: 8px 12px;
  border: 1px solid #333;
  background: #0a0a0a;
  color: #c8c8c8;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.filter-input:focus {
  border-color: #666;
}

.filter-select {
  padding: 8px 10px;
  border: 1px solid #333;
  background: #0a0a0a;
  color: #c8c8c8;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: #666;
}

/* ── Entry header ── */
.entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.entry-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 10px;
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Categories list ── */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px 16px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #333;
  background: #0d0d0d;
}

.category-color {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid #555;
}

.category-item span:nth-child(2) {
  flex: 1;
  font-size: 13px;
}

/* ── Event content ── */
.event-content {
  flex: 1;
}

.calendar-event {
  align-items: flex-start;
}
