/* NoteShare – refreshed theme */

:root {
  --bg: #0f172a;
  --bg-alt: #1e1b4b;
  --card: rgba(15, 23, 42, 0.7);
  --card-border: rgba(148, 163, 184, 0.2);
  --text: #f8fafc;
  --text-muted: #cbd5f5;
  --accent: #22d3ee;
  --accent-dark: #0ea5e9;
  --danger: #f87171;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(circle at 15% 20%, #1f1b3d, #0a1020 55%);
  background-attachment: fixed;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--text); }

.container {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.page-title { margin: 0 0 6px; }
.page-subtitle {
  margin: 0;
  color: var(--text-muted);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(203, 213, 225, 0.8);
  margin: 0 0 4px;
}
.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 10px 12px;
}
.hero-text {
  display: grid;
  gap: 4px;
}
.hero-title { margin: 0; font-size: 1.4rem; }
.hero-caption {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.hero-with-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.hero-tabs {
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  padding-top: 8px;
}
.hero-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-divider {
  color: var(--text-muted);
}
.hero-client-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.hero-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 5px 15px 4px 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 3px;
}
.hero-select-trigger:focus {
  outline: 1px solid rgba(34, 211, 238, 0.35);
  outline-offset: 1px;
}
.hero-select-label {
  display: inline-block;
  white-space: nowrap;
}
.hero-caret {
  width: 12px;
  height: 12px;
  display: inline-block;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5f5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}
.hero-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 160px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 20;
}
.hero-select-option {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  padding: 7px 10px;
  font-weight: 600;
  cursor: pointer;
}
.hero-select-option[aria-selected="true"] {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}
.hero-select-option:hover {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.08);
}
.hero-caret {
  width: 12px;
  height: 12px;
  display: inline-block;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5f5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.hero-client-name {
  color: var(--text);
  font-weight: 600;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(20px);
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.nav a {
  color: var(--text-muted);
  margin-left: 18px;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav a:hover,
.nav a:focus {
  color: #0f172a;
  background: rgba(34, 211, 238, 0.25);
}

.site-footer {
  margin-top: 64px;
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
}
.site-footer .footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-logout {
  color: var(--accent);
  font-weight: 600;
}
.footer-logout:hover,
.footer-logout:focus {
  color: var(--text);
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 12px;
}
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h2 { font-size: 1.4rem; margin-top: 20px; }
p { margin: 0 0 12px; color: var(--text-muted); }
small { color: var(--text-muted); }
.panel-heading h2 {
  margin: 4px 0 6px;
  font-size: 1.4rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px 8px;
  box-shadow: var(--shadow);
}
.card-subtle {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.28);
}
.upload-panel {
  margin-top: 5px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.upload-panel h2 {
  margin-top: 0;
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0f172a;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.35);
  text-decoration: none;
}
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-img {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
}
.icon-only {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
}
.btn:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(14, 165, 233, 0.4);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-ghost {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  box-shadow: none;
  border: 1px solid transparent;
}
.btn-ghost:hover {
  border-color: rgba(148, 163, 184, 0.3);
}
.btn-xs {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 10px;
}

.form { max-width: 720px; }
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.2);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
  outline: none;
}
.form-row textarea { min-height: 140px; resize: vertical; }
.form-row input[type="file"] {
  padding: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed rgba(226, 232, 240, 0.35);
  cursor: pointer;
}
.form-row input[type="file"]::file-selector-button,
.form-row input[type="file"]::-webkit-file-upload-button {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  margin-right: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
}
.form-row input[type="file"]::file-selector-button:hover,
.form-row input[type="file"]::-webkit-file-upload-button:hover {
  opacity: 0.9;
}

.notice,
.error {
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 500;
}
.notice {
  background: rgba(14, 165, 233, 0.15);
  color: var(--text);
}
.error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}
.pill-soft {
  background: rgba(34, 211, 238, 0.16);
  color: var(--text);
  border: 1px solid rgba(34, 211, 238, 0.35);
}
.pill-ghost {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.panel-shell {
  display: flex;
  flex-direction: column;
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}
.lede-sm {
  margin: 4px 0 0;
  color: var(--text-muted);
}
.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.control-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.file-surface {
  background: transparent;
  border: none;
  box-shadow: none;
}
.upload-grid {
  display: block;
  gap: 10px;
}
.upload-panel .upload-file-input {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}
.panel-shell h3 {
  color: var(--text);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}
.list li:last-child {
  border-bottom: none;
}

.sync-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.file-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  display: grid;
  place-items: center;
}
.file-icon[data-kind],
.file-icon[data-kind="image"],
.file-icon[data-kind="video"],
.file-icon[data-kind="audio"],
.file-icon[data-kind="pdf"],
.file-icon[data-kind="sheet"],
.file-icon[data-kind="archive"],
.file-icon[data-kind="file"] {
  background: transparent;
}
.file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
}
.file-info span {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.file-actions {
  display: flex;
  gap: 8px;
}
.file-actions {
  flex-wrap: wrap;
}
.file-row .file-actions .btn,
.file-row .file-actions button,
.file-row .file-actions a {
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  flex: 0 0 auto;
}

.folder-node {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  margin: 6px 0;
}
.folder-node summary {
  list-style: none;
  outline: 0;
  width: 100%;
}
.folder-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 600;
  border-radius: 10px;
}
.folder-caret {
  transition: transform 0.2s ease;
  color: var(--accent);
}
.folder-node[open] .folder-caret {
  transform: rotate(90deg);
}
.folder-meta {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.82rem;
  margin-left: auto;
}
.folder-actions-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}
.folder-actions-inline .btn,
.folder-actions-inline button {
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
}
.folder-actions-inline .btn-ghost,
.folder-actions-inline button.btn-ghost {
  background: transparent;
  box-shadow: none;
  border: none;
}
.folder-actions-inline .icon {
  width: 18px;
  height: 18px;
}
.folder-body {
  padding: 0 10px 10px 10px;
}
/* inline folder actions are now in the summary row */
.empty-folder {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 8px 0 0;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0px 10px 0px;
}
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
}
.file-row--selectable {
  border-color: rgba(34, 211, 238, 0.25);
}
.file-row--selected {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}
.file-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.file-row .file-info {
  display: flex;
  flex-direction: column;
  gap: 0px;
  min-width: 0;
}
.file-row .file-info strong {
  font-size: 0.95rem;
}
.file-row .file-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  display: grid;
  place-items: center;
}
.file-row .file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.file-row .file-meta span + span::before {
  content: '';
  margin: 0;
}
.file-row .file-actions {
  display: flex;
  gap: 4px;
}
.file-row .file-actions .btn,
.file-row .file-actions button,
.file-row .file-actions a {
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
}
.file-row .file-actions .btn-ghost,
.file-row .file-actions button.btn-ghost,
.file-row .file-actions a.btn-ghost {
  background: transparent;
  box-shadow: none;
  border: none;
}
.file-row .file-actions .icon {
  width: 20px;
  height: 20px;
}
.file-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.file-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}
.move-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.move-controls select {
  min-width: 180px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(226, 232, 240, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
}
.move-hint {
  color: var(--text-muted);
}

[hidden] {
  display: none !important;
}

.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}
.category-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 6px 14px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  cursor: pointer;
}
.category-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0f172a;
  border-color: rgba(14,165,233,0.5);
}
.note-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.45);
}
.note-card summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.note-summary {
  width: 100%;
}
.note-card[open] summary {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.note-body {
  padding: 14px 16px 16px;
}
.note-meta {
  margin-top: 8px;
  color: var(--text-muted);
}
.note-actions {
  margin-top: 10px;
}

.folder-node[data-depth="0"] { background: rgba(15, 23, 42, 0.5); border: 1px solid rgba(59, 130, 246, 0.25); }
.folder-node[data-depth="1"] { background: rgba(26, 39, 70, 0.5); }
.folder-node[data-depth="2"] { background: rgba(34, 44, 90, 0.48); }
.folder-node[data-depth="3"] { background: rgba(43, 53, 110, 0.45); }
.tab-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.tab-card {
  padding: 10px 12px;
  border-radius: 14px;
}
.tab-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.tab-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0f172a;
  border-color: rgba(14,165,233,0.4);
  box-shadow: 0 8px 18px rgba(14,165,233,0.3);
}
.tab-panel {
  margin-bottom: 18px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-modal[hidden] {
  display: none;
}
.preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}
.preview-modal__panel {
  position: relative;
  width: min(900px, 90%);
  max-height: 90vh;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.preview-modal__body {
  overflow: auto;
  max-height: 70vh;
}
.preview-placeholder {
  color: var(--text-muted);
}
.preview-media {
  width: 100%;
  height: auto;
  max-height: 65vh;
  border-radius: 12px;
  object-fit: contain;
  background: #0f172a;
}
.preview-audio {
  width: 100%;
}
.preview-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

@media (max-width: 460px) {
  body { font-size: 0.95rem; }
  .container { width: 100%; padding: 16px; }
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .nav {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: center;
  }
  .nav a {
    flex: 0 1 auto;
    text-align: center;
    min-width: 0;
    margin-left: 0;
    padding: 6px 10px;
    font-size: 0.9rem;
  }
  .card,
  .upload-panel {
    padding: 18px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .page-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .file-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }
  .tab-buttons {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }
  .tab-buttons-inline {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .tab-buttons-inline .tab-btn {
    width: 100%;
  }
  .file-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .file-main {
    width: 100%;
  }
  .file-row .file-icon {
    width: 24px;
    height: 24px;
  }
  .file-row .file-info {
    width: 100%;
  }
  .tab-btn {
    width: 100%;
    flex: none;
    text-align: center;
  }
  .category-bar {
    width: 100%;
    gap: 8px;
  }
  .category-btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .note-card summary {
    font-size: 0.95rem;
    padding: 10px 12px;
  }
  .note-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .note-actions .btn,
  .note-actions button,
  .form button,
  .form .btn {
    width: 100%;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 380px) {
  body { font-size: 0.9rem; }
  .container { padding: 12px; }
  .site-header .container { gap: 6px; }
  .nav {
    flex-wrap: wrap;
    gap: 4px;
  }
  .nav a {
    flex: 1 1 48%;
    font-size: 0.85rem;
  }
  .tab-buttons { gap: 6px; }
  .category-bar {
    flex-direction: column;
  }
  .card,
  .upload-panel {
    padding: 16px;
  }
  .note-card summary {
    font-size: 0.9rem;
  }
  .toolbar button {
    width: 100%;
  }
}

