:root {
  --bg: #0b1020;
  --panel: #121933;
  --panel-2: #18213f;
  --text: #f3f6ff;
  --muted: #9aa6c7;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #6ea8fe;
  --accent-hover: #8ab8ff;
  --success: #183d2f;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #0a0f1d 0%, #0d1327 100%);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.9);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 26px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav a {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  transition: 0.2s ease;
}

.nav a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.main {
  padding: 32px;
  max-width: 1200px;
  width: 100%;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1.1;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(110, 168, 254, 0.45);
}

.case-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--success);
  border: 1px solid rgba(102, 255, 178, 0.12);
  font-size: 13px;
}

.btn,
button {
  border: 0;
  outline: 0;
  background: var(--accent);
  color: #08111f;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:hover,
button:hover {
  background: var(--accent-hover);
}

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

.field {
  display: flex;
  flex-direction: column;
}

.field-full {
  grid-column: 1 / -1;
}

label {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(6, 10, 20, 0.55);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
}

input:focus,
textarea:focus {
  border-color: rgba(110, 168, 254, 0.6);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 180px;
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-bottom: 22px;
}

.info-list {
  display: grid;
  gap: 10px;
}

.content-box {
  white-space: pre-wrap;
  line-height: 1.65;
  background: rgba(4, 8, 18, 0.45);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.attachment-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.attachment-name {
  font-weight: 700;
  margin-bottom: 6px;
  word-break: break-word;
}

.attachment-type {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.preview-image,
.preview-video {
  width: 100%;
  border-radius: 12px;
  display: block;
  margin-bottom: 12px;
  max-height: 260px;
  object-fit: cover;
  background: #000;
}

.media-player {
  width: 100%;
  margin-bottom: 12px;
}

.link-btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(110, 168, 254, 0.12);
  color: #cfe1ff;
}

.empty {
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  row-gap: 18px;
  text-align: center;
  padding: 40px 24px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
}

.empty h3 {
  margin: 0;
}

.empty p {
  margin: 0;
  max-width: 620px;
  line-height: 1.6;
}

.empty .btn {
  margin: 0;
  align-self: center;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 20px;
  }

  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
}

.empty > * {
  position: relative;
  z-index: 1;
}

.empty p.muted {
  display: block;
  line-height: 1.6;
}

.empty .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


.empty p {
  padding-bottom: 6px;
}

.empty .btn {
  margin-top: 8px;
}

.actions-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.action-btn {
  min-width: 220px;
}

.action-btn[disabled] {
  opacity: 0.85;
  cursor: wait;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h3 {
  margin: 0;
}

.btn-secondary {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
}

.attachments-collapsed {
  display: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-card {
  width: min(460px, calc(100% - 32px));
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
  text-align: center;
}

.loading-title {
  margin-top: 16px;
  font-size: 24px;
  font-weight: 700;
}

.loading-text {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.spinner-inline {
  width: 18px;
  height: 18px;
  margin: 0;
  border-width: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.actions-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.action-btn {
  min-width: 220px;
}

.action-btn[disabled] {
  opacity: 0.85;
  cursor: wait;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h3 {
  margin: 0;
}

.btn-secondary {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
}

.attachments-collapsed {
  display: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-card {
  width: min(460px, calc(100% - 32px));
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
  text-align: center;
}

.loading-title {
  margin-top: 16px;
  font-size: 24px;
  font-weight: 700;
}

.loading-text {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.spinner-inline {
  width: 18px;
  height: 18px;
  margin: 0;
  border-width: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.case-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-card-link {
  display: block;
}

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

.card-actions form {
  margin: 0;
}

.btn-danger {
  border: 1px solid rgba(255, 107, 107, 0.25);
  background: rgba(255, 107, 107, 0.12);
  color: #ffd7d7;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.18);
}

.action-form {
  margin-bottom: 12px;
}

.action-btn {
  width: 100%;
  justify-content: center;
}

.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.loading-overlay[hidden] {
  display: none !important;
}
