/* Soft Music Ops — cabinet Soft Workspace shell */

:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, sans-serif;
  --background: #e8eef2;
  --foreground: #000000;
  --primary: #007aff;
  --primary-fg: #ffffff;
  --muted-fg: rgba(60, 60, 67, 0.6);
  --destructive: #ff3b30;
  --success: #34c759;
  --separator: rgba(60, 60, 67, 0.29);
  --fill: rgba(118, 118, 128, 0.12);
}

html.dark {
  color-scheme: dark;
  --background: #08090e;
  --foreground: #ffffff;
  --primary: #0a84ff;
  --muted-fg: rgba(235, 235, 245, 0.6);
  --separator: rgba(84, 84, 88, 0.65);
  --fill: rgba(118, 118, 128, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.35;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 95% 75% at 8% 5%, rgb(245 238 228 / 0.98) 0%, transparent 52%),
    radial-gradient(ellipse 80% 70% at 92% 35%, rgb(120 170 220 / 0.72) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 78% 8%, rgb(170 205 235 / 0.65) 0%, transparent 50%),
    radial-gradient(ellipse 90% 70% at 12% 88%, rgb(120 200 195 / 0.7) 0%, transparent 55%),
    radial-gradient(ellipse 65% 55% at 45% 55%, rgb(255 255 255 / 0.55) 0%, transparent 60%),
    linear-gradient(165deg, #f4f0e8 0%, #d8e6f2 28%, #b8d4ea 55%, #9ecfc8 100%);
}

html.dark body {
  background: #08090e;
}

html.dark body::before {
  background:
    radial-gradient(ellipse 95% 50% at 50% 100%, rgb(70 115 200 / 0.42) 0%, transparent 58%),
    radial-gradient(ellipse 55% 40% at 18% 88%, rgb(255 150 55 / 0.14) 0%, transparent 52%),
    radial-gradient(ellipse 50% 38% at 88% 78%, rgb(255 190 70 / 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 55% 40% at 82% 18%, rgb(55 95 175 / 0.28) 0%, transparent 50%),
    radial-gradient(ellipse 45% 35% at 12% 22%, rgb(40 80 160 / 0.18) 0%, transparent 48%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgb(6 8 14 / 0.95) 0%, transparent 55%),
    linear-gradient(180deg, #05060a 0%, #0a0d18 36%, #101c32 68%, #152448 90%, #1a2030 100%);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted-fg);
}

.error {
  color: var(--destructive);
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

/* Glass */
.sw-glass {
  position: relative;
  isolation: isolate;
  background: rgb(255 255 255 / 0.28);
  backdrop-filter: blur(44px) saturate(200%) brightness(1.08);
  -webkit-backdrop-filter: blur(44px) saturate(200%) brightness(1.08);
  border: 0.5px solid rgb(255 255 255 / 0.62);
  box-shadow:
    inset 0 1px 0 0 rgb(255 255 255 / 0.82),
    inset 1px 0 0 0 rgb(255 255 255 / 0.32),
    0 8px 32px rgb(0 0 0 / 0.08);
}

html.dark .sw-glass {
  background: rgb(36 40 54 / 0.5);
  border-color: rgb(200 215 255 / 0.2);
  backdrop-filter: blur(44px) saturate(180%) brightness(0.9);
  -webkit-backdrop-filter: blur(44px) saturate(180%) brightness(0.9);
  box-shadow:
    inset 0 1px 0 rgb(220 235 255 / 0.22),
    0 8px 32px rgb(0 0 0 / 0.5);
}

.sw-glass-control {
  background: rgb(255 255 255 / 0.32);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 0.5px solid rgb(255 255 255 / 0.58);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.78);
}

html.dark .sw-glass-control {
  background: rgb(44 48 62 / 0.55);
  border-color: rgb(200 215 255 / 0.18);
}

.sw-field {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.625rem;
  border: 0.5px solid rgb(255 255 255 / 0.45) !important;
  background: rgb(255 255 255 / 0.28) !important;
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  outline: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55);
}

html.dark .sw-field {
  border-color: rgb(200 215 255 / 0.28) !important;
  background: rgb(8 10 18 / 0.55) !important;
}

.sw-field:focus {
  box-shadow: 0 0 0 3px rgb(0 122 255 / 0.28);
}

textarea.sw-field {
  resize: vertical;
  min-height: 4.5rem;
}

.sw-card,
.empty-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 0.875rem;
  border: 0.5px solid rgb(255 255 255 / 0.68);
  background: rgb(255 255 255 / 0.42);
  backdrop-filter: blur(40px) saturate(190%) brightness(1.06);
  -webkit-backdrop-filter: blur(40px) saturate(190%) brightness(1.06);
  padding: 1.25rem 1.35rem;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    0 8px 28px rgb(0 0 0 / 0.06);
}

html.dark .sw-card,
html.dark .empty-card {
  border-color: rgb(200 215 255 / 0.18);
  background: rgb(36 40 54 / 0.48);
  box-shadow:
    inset 0 1px 0 rgb(220 235 255 / 0.16),
    0 8px 28px rgb(0 0 0 / 0.4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 0.75rem;
  border: 0.5px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn.primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.45),
    0 4px 12px rgb(0 122 255 / 0.35);
}

.btn.ok {
  background: var(--success);
  color: #fff;
}

.btn.danger {
  background: var(--destructive);
  color: #fff;
}

.btn.ghost,
.btn.outline {
  color: var(--primary);
  background: rgb(255 255 255 / 0.32);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-color: rgb(255 255 255 / 0.5);
}

html.dark .btn.ghost,
html.dark .btn.outline {
  background: rgb(44 48 62 / 0.55);
  border-color: rgb(200 215 255 / 0.18);
}

.btn.block {
  width: 100%;
}

.btn.sm {
  min-height: 2.25rem;
  padding: 0 0.85rem;
  font-size: 0.8125rem;
}

.btn.icon {
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Login */
.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
}

.login-center {
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem max(1rem, env(safe-area-inset-bottom, 0px));
}

.sw-login-card {
  width: min(28rem, 100%);
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: blur(48px) saturate(200%);
  -webkit-backdrop-filter: blur(48px) saturate(200%);
  border: 0.5px solid rgb(255 255 255 / 0.7);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    0 16px 48px rgb(0 0 0 / 0.12);
}

html.dark .sw-login-card {
  background: rgb(32 36 50 / 0.8);
  border-color: rgb(200 215 255 / 0.2);
}

.login-card-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.login-card-head p {
  margin: 0.35rem 0 0;
  color: var(--muted-fg);
  font-size: 0.9375rem;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.field-label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-fg);
}

/* App shell */
.app-root {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100svh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.app-sidebar {
  display: none;
  width: 15rem;
  flex-shrink: 0;
  flex-direction: column;
  padding: 0 0 1rem;
  overflow: auto;
}

.app-sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.25rem 1rem 0.5rem;
}

.sidebar-eyebrow {
  margin: 0;
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-transform: lowercase;
}

.sidebar-title {
  margin: 0.2rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted-fg);
}

.side-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: auto;
  padding: 0 0.5rem 0.75rem;
}

.nav-section-label {
  margin: 0.65rem 0.75rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted-fg);
  text-transform: uppercase;
}

.sw-sidebar-nav-group {
  margin: 0.25rem 0.35rem 0.5rem;
  padding: 0.25rem;
  border-radius: 0.875rem;
  background: rgb(255 255 255 / 0.22);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 0.5px solid rgb(255 255 255 / 0.35);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

html.dark .sw-sidebar-nav-group {
  background: rgb(255 255 255 / 0.06);
  border-color: rgb(255 255 255 / 0.1);
}

.sw-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.625rem;
  padding: 0 0.75rem;
  background: transparent;
  color: var(--foreground);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sw-nav-link:hover {
  background: rgb(0 0 0 / 0.04);
}

html.dark .sw-nav-link:hover {
  background: rgb(255 255 255 / 0.06);
}

.sw-nav-link.is-active {
  background: rgb(0 122 255 / 0.18);
  color: var(--primary);
  font-weight: 600;
}

html.dark .sw-nav-link.is-active {
  background: rgb(10 132 255 / 0.28);
  color: #64b5ff;
}

.sw-nav-link em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  color: var(--muted-fg);
  font-weight: 500;
}

.sw-nav-link.is-active em {
  color: inherit;
  opacity: 0.85;
}

.sw-mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  border: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  background: rgb(0 0 0 / 0.35);
  backdrop-filter: blur(12px) saturate(120%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.sw-mobile-nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.app-column {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: calc(3.5rem + env(safe-area-inset-top, 0px));
  padding: calc(0.35rem + env(safe-area-inset-top, 0px)) 0.75rem 0.35rem;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}

.app-header > * {
  position: relative;
  z-index: 1;
}

.header-left {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.5rem;
}

.header-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.header-spacer {
  flex: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.user-chip {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-head #main-eyebrow {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 16rem;
  justify-content: flex-end;
  max-width: 28rem;
}

.search-field {
  flex: 1;
  min-width: 0;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.list-pane {
  border-radius: 1rem;
  overflow: auto;
  max-height: calc(100dvh - 11rem);
  padding: 0.4rem;
}

.detail-pane {
  overflow: auto;
  max-height: calc(100dvh - 11rem);
  min-width: 0;
}

.list-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
}

.list-item.ticket-item {
  grid-template-columns: 1fr;
}

.list-item:hover,
.list-item.is-active {
  background: rgb(0 122 255 / 0.12);
}

html.dark .list-item:hover,
html.dark .list-item.is-active {
  background: rgb(10 132 255 / 0.18);
}

.list-item img,
.cover-ph {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 0.55rem;
  background: var(--fill);
}

.list-item .t {
  font-weight: 650;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.list-item .m {
  margin: 0;
  color: var(--muted-fg);
  font-size: 0.82rem;
}

.list-empty {
  padding: 1.5rem;
  color: var(--muted-fg);
}

.detail-head {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-head img,
.detail-cover-ph {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 0.75rem;
  background: var(--fill);
}

.detail-pane h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.meta {
  color: var(--muted-fg);
  font-size: 0.9rem;
  line-height: 1.5;
}

.meta b {
  color: var(--foreground);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0;
}

.reject-box,
.reply-box {
  margin: 0.75rem 0 1rem;
  padding: 0.9rem;
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 0.25);
  border: 0.5px solid rgb(255 255 255 / 0.45);
}

html.dark .reject-box,
html.dark .reply-box {
  background: rgb(8 10 18 / 0.4);
  border-color: rgb(200 215 255 / 0.18);
}

.notes {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 0.5px solid var(--separator);
}

.notes h3,
.thread h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.note,
.msg {
  padding: 0.7rem 0.85rem;
  border-radius: 0.7rem;
  background: rgb(255 255 255 / 0.28);
  border: 0.5px solid rgb(255 255 255 / 0.4);
  margin-bottom: 0.5rem;
}

html.dark .note,
html.dark .msg {
  background: rgb(8 10 18 / 0.4);
  border-color: rgb(200 215 255 / 0.14);
}

.msg.staff {
  border-left: 3px solid var(--primary);
}

.msg.client {
  border-left: 3px solid var(--success);
}

.note .who,
.msg .who {
  color: var(--muted-fg);
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.note-form {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgb(0 122 255 / 0.14);
  color: var(--primary);
}

.files-block {
  margin: 0.25rem 0 1rem;
  padding: 0.9rem;
  border-radius: 0.85rem;
  background: rgb(0 122 255 / 0.08);
  border: 0.5px solid rgb(0 122 255 / 0.18);
}

html.dark .files-block {
  background: rgb(10 132 255 / 0.12);
  border-color: rgb(10 132 255 / 0.22);
}

.files-block h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.files-list {
  display: grid;
  gap: 0.55rem;
}

.file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.7rem;
  background: rgb(255 255 255 / 0.35);
  border: 0.5px solid rgb(255 255 255 / 0.45);
}

html.dark .file-row {
  background: rgb(8 10 18 / 0.4);
  border-color: rgb(200 215 255 / 0.14);
}

.file-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  min-width: 0;
}

.file-main .t {
  margin: 0;
  font-weight: 650;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.file-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  word-break: break-all;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 0.5px solid rgb(255 255 255 / 0.7);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.12);
  max-width: min(360px, calc(100vw - 2rem));
}

html.dark .toast {
  background: rgb(36 40 54 / 0.85);
  border-color: rgb(200 215 255 / 0.2);
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (min-width: 960px) {
  .app-sidebar {
    display: flex;
  }
}

@media (max-width: 959px) {
  .mobile-only {
    display: flex;
  }

  .desktop-only {
    display: none !important;
  }

  .app-sidebar {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    width: min(18rem, 86vw);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    border-radius: 0;
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .list-pane {
    max-height: 38vh;
  }

  .detail-pane {
    max-height: none;
  }

  .detail-head {
    grid-template-columns: 84px 1fr;
  }

  .detail-head img,
  .detail-cover-ph {
    width: 84px;
    height: 84px;
  }

  .page-head-actions {
    max-width: none;
    width: 100%;
    justify-content: stretch;
  }
}
