/* Student Deposit Space — Biyn DS 2026 */

/* ========================================================================
   CSS Variables / Design Tokens
   ======================================================================== */
:root {
  --brand: #7441BA;
  --brand-light: #9464DE;
  --brand-dark: #5E349A;
  --brand-50: #F5F0FD;
  --brand-100: #E8DCFB;
  --brand-200: #D1B8F6;

  --gold: #D4A020;
  --gold-light: #E8C84A;
  --gold-50: #FEF9E7;
  --gold-100: #FEF0C7;

  --success: #2BA665;
  --success-50: #EEFBF3;
  --success-100: #D0F5E0;

  --warning: #EEA218;
  --warning-50: #FFFAEB;
  --warning-100: #FEF0C7;

  --danger: #E63946;
  --danger-50: #FEF0F0;
  --danger-100: #FDDFDF;

  --info: #20A6D9;
  --info-50: #EEF9FD;
  --info-100: #B8E6F5;

  --violet: #8B5CF6;
  --violet-50: #F5F3FF;
  --violet-100: #EDE9FE;

  --dark: #1C1833;
  --text: #2D2647;
  --text-sec: #564E6E;
  --text-ter: #918BA8;

  --border: #E4E1EE;
  --border-light: #EEECF5;
  --surface: #FAFAFC;
  --white: #FFF;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --shadow: 0 8px 32px rgba(32, 18, 64, .08);
  --shadow-lg: 0 16px 48px rgba(32, 18, 64, .12);
}

/* ========================================================================
   Reset & Base
   ======================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.6;
  transition: background .4s, color .4s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================================================
   Gradient Header Band
   ======================================================================== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 320px;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 40%, var(--brand-light) 100%);
  z-index: -2;
  transition: opacity .4s;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 320px;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, .06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .04) 0%, transparent 40%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 100% 100%, 100% 100%, 60px 60px;
  z-index: -1;
  transition: opacity .4s;
}

/* ========================================================================
   Layout
   ======================================================================== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 60px;
  position: relative;
  z-index: 1;
}

/* ========================================================================
   Header
   ======================================================================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  position: relative;
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}

.header-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

/* Logo — always show white version */

.header-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, .15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(8px);
}

.header-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, .15);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  backdrop-filter: blur(8px);
}

.header-btn:hover {
  background: rgba(255, 255, 255, .25);
  border-color: rgba(255, 255, 255, .35);
}

/* ========================================================================
   Hero Section
   ======================================================================== */
.hero {
  text-align: center;
  padding: 24px 20px 36px;
  color: var(--white);
}

.hero h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -.5px;
}

.hero p {
  font-size: 15px;
  opacity: .85;
  max-width: 480px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}

/* ========================================================================
   Cards
   ======================================================================== */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s;
}

.card + .card {
  margin-top: 16px;
}

.card-body {
  padding: 24px;
}

.card-body.compact {
  padding: 16px 24px;
}

/* ========================================================================
   View System (multi-step / tabs)
   ======================================================================== */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeUp .35s ease-out;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================================
   Forms
   ======================================================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.1px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}

.form-input::placeholder {
  color: var(--text-ter);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.form-input.is-invalid,
.form-select.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-50);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23918BA8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row > .form-group {
  flex: 1;
}

/* ========================================================================
   File Upload
   ======================================================================== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--surface);
}

.upload-zone:hover {
  border-color: var(--brand-light);
  background: var(--brand-50);
}

.upload-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: 0 0 0 4px rgba(116, 65, 186, .1);
}

.upload-zone .upload-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
  color: var(--brand-light);
}

.upload-zone .upload-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-zone .upload-hint {
  font-size: 13px;
  color: var(--text-ter);
}

.upload-files {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.file-item:hover {
  background: var(--brand-50);
}

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--brand-50);
  color: var(--brand);
}

.file-icon.pdf {
  background: var(--danger-50);
  color: var(--danger);
}

.file-icon.img {
  background: var(--info-50);
  color: var(--info);
}

.file-icon.doc {
  background: var(--info-50);
  color: var(--info);
}

.file-icon.zip {
  background: var(--warning-50);
  color: var(--warning);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 12px;
  color: var(--text-ter);
  margin-top: 2px;
}

.file-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--brand-50);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background .15s, color .15s;
}

.file-action:hover {
  background: var(--brand-100);
  color: var(--brand-dark);
}

.file-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-ter);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .15s, color .15s;
}

.file-remove:hover {
  background: var(--danger-50);
  color: var(--danger);
}

/* ========================================================================
   Buttons
   ======================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: var(--white);
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(116, 65, 186, .25);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(116, 65, 186, .35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(116, 65, 186, .2);
}

.btn-outline {
  background: var(--white);
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-50);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}

.btn-success:hover {
  background: #249A5A;
  box-shadow: 0 4px 12px rgba(43, 166, 101, .3);
}

.btn-warning {
  background: var(--warning);
  color: var(--white);
  border-color: var(--warning);
}

.btn-warning:hover {
  background: #D98F10;
  box-shadow: 0 4px 12px rgba(238, 162, 24, .3);
}

.btn-danger-outline {
  background: var(--white);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger-outline:hover {
  background: var(--danger-50);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 6px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========================================================================
   Status Badges
   ======================================================================== */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 100px;
  white-space: nowrap;
}

.status-pending {
  background: var(--warning-50);
  color: var(--warning);
  border: 1px solid var(--warning-100);
}

.status-submitted {
  background: var(--info-50);
  color: var(--info);
  border: 1px solid var(--info-100);
}

.status-validated {
  background: var(--success-50);
  color: var(--success);
  border: 1px solid var(--success-100);
}

.status-review {
  background: var(--violet-50);
  color: var(--violet);
  border: 1px solid var(--violet-100);
}

.status-rejected {
  background: var(--danger-50);
  color: var(--danger);
  border: 1px solid var(--danger-100);
}

/* ========================================================================
   Deadline Badges
   ======================================================================== */
.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 100px;
  background: var(--success-50);
  color: var(--success);
  border: 1px solid var(--success-100);
}

.deadline-badge.orange {
  background: var(--warning-50);
  color: var(--warning);
  border-color: var(--warning-100);
}

.deadline-badge.red {
  background: var(--danger-50);
  color: var(--danger);
  border-color: var(--danger-100);
  animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(230, 57, 70, .2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(230, 57, 70, 0);
  }
}

.deadline-badge.violet {
  background: var(--violet-50);
  color: var(--violet);
  border-color: var(--violet-100);
}

/* ========================================================================
   Tracking
   ======================================================================== */
.tracking-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-sm);
}

.tracking-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.tracking-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  letter-spacing: .5px;
}

.tracking-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tracking-inline .tracking-copy {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--brand-100);
  color: var(--brand);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background .15s;
}

.tracking-inline .tracking-copy:hover {
  background: var(--brand-200);
}

/* ========================================================================
   Info Grid
   ======================================================================== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.info-cell {
  padding: 14px 16px;
  background: var(--white);
}

.info-cell-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-ter);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.info-cell-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ========================================================================
   Conversation / Messages (Timeline)
   ======================================================================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px 0;
}

.timeline-item {
  display: flex;
  gap: 12px;
}

.timeline-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--white);
  background: var(--text-ter);
}

.timeline-avatar.trainer {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
}

.timeline-avatar.student {
  background: linear-gradient(135deg, var(--info) 0%, #4FC3F7 100%);
}

.timeline-avatar.system {
  background: var(--border);
  color: var(--text-ter);
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.timeline-time {
  font-size: 12px;
  color: var(--text-ter);
}

.timeline-text {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.6;
}

.timeline-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.timeline-file:hover {
  background: var(--brand-50);
  border-color: var(--brand-100);
}

.timeline-system {
  padding: 10px 16px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-ter);
  font-style: italic;
  text-align: center;
}

/* Reply Box */
.reply-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-top: 16px;
}

.reply-input {
  width: 100%;
  min-height: 44px;
  max-height: 200px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: none;
  overflow-y: auto;
  transition: border-color .2s, box-shadow .2s;
  line-height: 1.5;
}

.reply-input::placeholder {
  color: var(--text-ter);
}

.reply-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reply-attach {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-sec);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: border-color .2s, color .2s, background .2s;
}

.reply-attach:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-50);
}

.reply-send {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--white);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
}

.reply-send:hover {
  box-shadow: 0 4px 12px rgba(116, 65, 186, .3);
  transform: translateY(-1px);
}

.reply-send:active {
  transform: translateY(0);
}

/* ========================================================================
   Milestones
   ======================================================================== */
.milestones {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 24px;
}

.milestones::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--border-light);
}

.milestone {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  padding: 12px 0;
}

.milestone-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  margin-left: -24px;
  transition: border-color .2s, background .2s;
}

.milestone-dot.waiting {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-ter);
}

.milestone-dot.done {
  border-color: var(--success);
  background: var(--success);
  color: var(--white);
}

.milestone-dot.active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--white);
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(116, 65, 186, .3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(116, 65, 186, 0);
  }
}

.milestone-dot.review {
  border-color: var(--violet);
  background: var(--violet);
  color: var(--white);
}

.milestone-dot.urgent {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--white);
  animation: dot-urgent 1.5s ease-in-out infinite;
}

@keyframes dot-urgent {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(230, 57, 70, .3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(230, 57, 70, 0);
  }
}

.milestone-body {
  flex: 1;
  min-width: 0;
}

.milestone-card {
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}

.milestone-card:hover {
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(32, 18, 64, .04);
}

.milestone-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.milestone-desc {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.5;
}

/* ========================================================================
   Description Box
   ======================================================================== */
.desc-box {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.7;
}

.desc-box strong {
  color: var(--text);
}

/* ========================================================================
   Promo Tag
   ======================================================================== */
.promo-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--gold-50);
  color: var(--gold);
  border: 1px solid var(--gold-100);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}

/* ========================================================================
   Link Box
   ======================================================================== */
.link-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.link-box:hover {
  border-color: var(--brand-100);
  background: var(--brand-50);
  box-shadow: 0 2px 8px rgba(116, 65, 186, .06);
}

.link-box .link-box-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand-50);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.link-box .link-box-text {
  flex: 1;
  min-width: 0;
}

.link-box .link-box-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.link-box .link-box-desc {
  font-size: 12px;
  color: var(--text-ter);
  margin-top: 2px;
}

.link-box .link-box-arrow {
  color: var(--text-ter);
  font-size: 14px;
  flex-shrink: 0;
  transition: transform .2s;
}

.link-box:hover .link-box-arrow {
  transform: translateX(3px);
  color: var(--brand);
}

/* ========================================================================
   Confirm Icon
   ======================================================================== */
.confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  animation: popIn .4s cubic-bezier(.175, .885, .32, 1.275);
}

.confirm-icon.success {
  background: var(--success-50);
  color: var(--success);
  border: 2px solid var(--success-100);
}

.confirm-icon.warning {
  background: var(--warning-50);
  color: var(--warning);
  border: 2px solid var(--warning-100);
}

.confirm-icon.danger {
  background: var(--danger-50);
  color: var(--danger);
  border: 2px solid var(--danger-100);
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(.3);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================================================
   Alerts
   ======================================================================== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-info {
  background: var(--info-50);
  color: var(--info);
  border: 1px solid var(--info-100);
}

.alert-warning {
  background: var(--warning-50);
  color: #8B6914;
  border: 1px solid var(--warning-100);
}

.alert-success {
  background: var(--success-50);
  color: #1F7A4A;
  border: 1px solid var(--success-100);
}

/* ========================================================================
   Tabs
   ======================================================================== */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  font-family: inherit;
}

.tab:hover {
  color: var(--text);
  background: var(--white);
}

.tab.active {
  color: var(--brand);
  background: var(--white);
  box-shadow: 0 1px 3px rgba(32, 18, 64, .08);
}

/* ========================================================================
   Section Title
   ======================================================================== */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .section-icon {
  font-size: 18px;
}

/* ========================================================================
   Duplicate Options
   ======================================================================== */
.dup-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.dup-option:hover {
  border-color: var(--brand-100);
  background: var(--brand-50);
}

.dup-option.selected {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(116, 65, 186, .1);
}

.dup-option + .dup-option {
  margin-top: 8px;
}

/* ========================================================================
   Detail Header
   ======================================================================== */
.detail-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.detail-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
  margin-bottom: 4px;
}

.detail-promo {
  font-size: 13px;
  color: var(--text-sec);
}

/* ========================================================================
   Jalon v2 — Accordion Milestone View (jv2-*)
   ======================================================================== */

/* ── Header ── */
.jv2-header {
  text-align: center;
  margin-bottom: 28px;
}

.jv2-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--violet-50);
  color: var(--violet);
  border: 1px solid var(--violet-100);
  margin-bottom: 14px;
}

.jv2-header h1 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.jv2-header-meta {
  font-size: 13px;
  color: var(--text-ter);
}

.jv2-header-welcome {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-pri);
  margin-top: 14px;
  padding: 10px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: inline-block;
}

/* ── Tracking Strip ── */
.jv2-tracking {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.jv2-tracking-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.jv2-tracking-code {
  font-family: 'DM Sans', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
}

.jv2-tracking-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.jv2-tracking-progress.complete {
  background: var(--success-50);
  color: var(--success);
  border: 1px solid var(--success-100);
}

.jv2-tracking-progress.partial {
  background: var(--warning-50);
  color: var(--warning);
  border: 1px solid var(--warning-100);
}

.jv2-tracking.has-desc {
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.jv2-tracking-desc {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.6;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  margin-top: 4px;
  width: 100%;
}

/* ── Progress Timeline ── */
.jv2-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 0 20px;
}

.jv2-timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  flex: 1;
  max-width: 160px;
}

.jv2-timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  border: 3px solid var(--border);
  background: var(--white);
  color: var(--text-ter);
  position: relative;
  z-index: 2;
  transition: all .3s;
}

.jv2-timeline-step.done .jv2-timeline-dot {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.jv2-timeline-step.active .jv2-timeline-dot {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
  animation: jv2-pulse 2s infinite;
}

@keyframes jv2-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(238,162,24,.3); }
  50% { box-shadow: 0 0 0 8px rgba(238,162,24,0); }
}

.jv2-timeline-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-ter);
  text-align: center;
}

.jv2-timeline-step.done .jv2-timeline-label {
  color: var(--success);
}

.jv2-timeline-step.active .jv2-timeline-label {
  color: var(--warning);
  font-weight: 700;
}

.jv2-timeline-connector {
  flex: 1;
  height: 3px;
  background: var(--border);
  max-width: 80px;
  margin: 0 -4px;
  position: relative;
  top: -12px;
}

.jv2-timeline-connector.done {
  background: var(--success);
}

/* ── Jalon Accordion ── */
.jv2-jalon {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: all .25s ease;
}

.jv2-jalon.expanded {
  box-shadow: var(--shadow);
}

/* Header — always visible */
.jv2-jalon-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}

.jv2-jalon-header:hover {
  background: var(--surface);
}

.jv2-jalon-number {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}

.jv2-jalon.status-deposited .jv2-jalon-number {
  background: var(--success-50);
  color: var(--success);
  border: 1px solid var(--success-100);
}

.jv2-jalon.status-waiting .jv2-jalon-number {
  background: var(--warning-50);
  color: var(--warning);
  border: 1px solid var(--warning-100);
}

.jv2-jalon.status-validated .jv2-jalon-number {
  background: var(--success-50);
  color: var(--success);
  border: 1px solid var(--success-100);
}

.jv2-jalon.status-rejected .jv2-jalon-number {
  background: var(--danger-50);
  color: var(--danger);
  border: 1px solid var(--danger-100);
}

.jv2-jalon.status-revision .jv2-jalon-number {
  background: var(--warning-50);
  color: var(--warning);
  border: 1px solid var(--warning-100);
}

.jv2-jalon-info {
  flex: 1;
  min-width: 0;
}

.jv2-jalon-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.jv2-jalon-subtitle {
  font-size: 12px;
  color: var(--text-ter);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.jv2-jalon-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.jv2-jalon-status {
  padding: 4px 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.jv2-jalon-status.deposited {
  background: var(--success-50);
  color: var(--success);
  border: 1px solid var(--success-100);
}

.jv2-jalon-status.waiting {
  background: var(--warning-50);
  color: var(--warning);
  border: 1px solid var(--warning-100);
}

.jv2-jalon-status.validated {
  background: var(--success);
  color: white;
}

.jv2-jalon-status.rejected {
  background: var(--danger-50);
  color: var(--danger);
  border: 1px solid var(--danger-100);
}

.jv2-jalon-status.revision {
  background: rgba(232,96,60,.1);
  color: #E8603C;
  border: 1px solid rgba(232,96,60,.18);
}

.jv2-jalon-chevron {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-light);
  color: var(--text-ter);
  transition: all .25s;
  font-size: 12px;
}

.jv2-jalon.expanded .jv2-jalon-chevron {
  transform: rotate(180deg);
  background: var(--brand-50);
  color: var(--brand-light);
}

/* Body — collapsible */
.jv2-jalon-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, opacity .25s ease;
  opacity: 0;
}

.jv2-jalon.expanded .jv2-jalon-body {
  max-height: 2000px;
  opacity: 1;
}

/* ── Zones inside jalon body ── */
.jv2-zone {
  border-top: 1px solid var(--border-light);
}

.jv2-zone-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 20px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-ter);
}

/* Files list inside jalon */
.jv2-files-list {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jv2-file-dl {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-ter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all .2s;
  flex-shrink: 0;
  text-decoration: none;
}

.jv2-file-dl:hover {
  border-color: var(--brand);
  color: var(--brand-light);
}

.jv2-file-preview {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-ter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .2s;
  flex-shrink: 0;
  cursor: pointer;
}
.jv2-file-preview:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Upload zone overrides inside jalon */
.jv2-upload-zone {
  margin: 0 20px 16px;
  padding: 20px;
}

.jv2-upload-files {
  margin: 0 20px;
}

.jv2-note-group {
  padding: 0 20px 8px;
  margin-top: 10px;
}

.jv2-note-group textarea {
  min-height: 44px;
  font-size: 13px;
}

.jv2-submit-wrap {
  padding: 8px 20px 16px;
}

/* ── Messages inside jalon ── */
.jv2-messages {
  padding: 0 20px 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.jv2-msg {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.jv2-msg:last-child {
  border-bottom: none;
}

.jv2-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.jv2-msg-avatar.student {
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
}

.jv2-msg-avatar.trainer {
  background: linear-gradient(135deg, #E8603C, #F07A5A);
}

.jv2-msg-content {
  flex: 1;
  min-width: 0;
}

.jv2-msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.jv2-msg-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.jv2-msg-role {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
}

.jv2-msg-role.student {
  background: var(--brand-50);
  color: var(--brand);
}

.jv2-msg-role.trainer {
  background: rgba(232,96,60,.1);
  color: #E8603C;
}

.jv2-msg-time {
  font-size: 11px;
  color: var(--text-ter);
  margin-left: auto;
}

.jv2-msg-text {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.6;
}

.jv2-msg-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.jv2-msg-file:hover {
  background: var(--brand-50);
  border-color: var(--brand-100);
}

.jv2-empty-messages {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-ter);
  font-style: italic;
}

/* ── Reply Box inside jalon ── */
.jv2-reply-box {
  padding: 0 20px 20px;
}

.jv2-reply-inner {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  transition: border-color .2s;
}

.jv2-reply-inner:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.jv2-reply-textarea {
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  min-height: 64px;
  resize: none;
}

.jv2-reply-textarea::placeholder {
  color: var(--text-ter);
}

.jv2-reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border-light);
}

.jv2-reply-attach {
  background: none;
  border: none;
  color: var(--text-ter);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .15s;
}

.jv2-reply-attach:hover {
  color: var(--brand-light);
  background: var(--brand-50);
}

.jv2-reply-send {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .2s;
}

.jv2-reply-send:hover {
  box-shadow: 0 4px 12px rgba(116,65,186,.3);
  transform: scale(1.05);
}

.jv2-reply-send:active {
  transform: scale(.95);
}

/* ========================================================================
   Responsive — max-width: 640px
   ======================================================================== */
@media (max-width: 640px) {
  body::before,
  body::after {
    height: 260px;
  }

  .main {
    padding: 0 12px 40px;
  }

  .header {
    padding: 14px 16px;
  }

  .header-text {
    font-size: 16px;
  }

  .hero {
    padding: 16px 12px 28px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero p {
    font-size: 14px;
  }

  .card-body {
    padding: 16px;
  }

  .card-body.compact {
    padding: 12px 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
  }

  .upload-zone {
    padding: 24px 16px;
  }

  .detail-header {
    padding: 16px;
  }

  .detail-title {
    font-size: 18px;
  }

  .tabs {
    gap: 2px;
  }

  .tab {
    padding: 7px 14px;
    font-size: 12px;
  }

  .timeline-item {
    gap: 10px;
  }

  .timeline-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .reply-box {
    padding: 12px;
  }

  .milestone {
    gap: 12px;
  }

  .milestone-card {
    padding: 12px 14px;
  }

  .tracking-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  /* jv2 responsive */
  .jv2-timeline {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .jv2-timeline-connector {
    display: none;
  }

  .jv2-jalon-header {
    padding: 14px 16px;
    gap: 10px;
  }

  .jv2-jalon-subtitle {
    flex-direction: column;
    gap: 4px;
  }

  .jv2-tracking {
    flex-direction: column;
    align-items: flex-start;
  }

  .jv2-files-list {
    padding: 0 16px 12px;
  }

  .jv2-upload-zone {
    margin: 0 16px 12px;
  }

  .jv2-messages {
    padding: 0 16px 4px;
  }

  .jv2-reply-box {
    padding: 0 16px 16px;
  }

  .jv2-zone-label {
    padding: 12px 16px 8px;
  }

  .jv2-note-group {
    padding: 0 16px 8px;
  }

  .jv2-submit-wrap {
    padding: 8px 16px 12px;
  }

  .jv2-msg-head {
    flex-wrap: wrap;
  }

  .jv2-msg-time {
    width: 100%;
    margin-left: 0;
  }
}

/* ========================================================================
   Dark Mode
   ======================================================================== */

/* Dark mode CSS variable overrides */
[data-theme="dark"] {
  --bg: #0F0B1A;
  --surface: #161224;
  --text: #E8E4F0;
  --text-sec: #B0A8C8;
  --text-ter: #7A7194;
  --border: rgba(255,255,255,.1);
  --border-light: rgba(255,255,255,.06);
  --shadow: 0 8px 32px rgba(0,0,0,.3);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.4);
  --brand-50: rgba(116,65,186,.15);
  --brand-100: rgba(116,65,186,.25);
  --brand-200: rgba(116,65,186,.35);
  --success-50: rgba(43,166,101,.12);
  --success-100: rgba(43,166,101,.2);
  --warning-50: rgba(238,162,24,.12);
  --warning-100: rgba(238,162,24,.2);
  --danger-50: rgba(230,57,70,.12);
  --danger-100: rgba(230,57,70,.2);
  --info-50: rgba(32,166,217,.12);
  --info-100: rgba(32,166,217,.2);
  --violet-50: rgba(139,92,246,.12);
  --violet-100: rgba(139,92,246,.2);
  --gold-50: rgba(212,160,32,.12);
  --gold-100: rgba(212,160,32,.2);
}

/* Dark mode body background */
[data-theme="dark"] body {
  background: var(--bg);
}

/* Hide light mode gradient in dark mode */
[data-theme="dark"] body::before,
[data-theme="dark"] body::after {
  opacity: 0;
}

/* ── Cosmic Orbs Background (dark only) ── */
.bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s;
}

[data-theme="dark"] .bg-canvas {
  opacity: 1;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb:nth-child(1) {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #7441BA, transparent 70%);
  top: -15%;
  left: -10%;
  animation-duration: 25s;
}

.bg-orb:nth-child(2) {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #9464DE, transparent 70%);
  top: 20%;
  right: -15%;
  animation-duration: 30s;
  animation-delay: -5s;
}

.bg-orb:nth-child(3) {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #20A6D9, transparent 70%);
  bottom: 10%;
  left: 20%;
  animation-duration: 22s;
  animation-delay: -10s;
  opacity: .2;
}

.bg-orb:nth-child(4) {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #2BA665, transparent 70%);
  top: 50%;
  right: 30%;
  animation-duration: 28s;
  animation-delay: -15s;
  opacity: .12;
}

.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(116,65,186,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116,65,186,.035) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 100%);
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(.95); }
  75% { transform: translate(40px, 20px) scale(1.02); }
}

/* ── Theme Toggle ── */
.theme-toggle {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  transition: all .3s;
  flex-shrink: 0;
}

.theme-toggle::after {
  content: '\2600\FE0F';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all .3s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

[data-theme="dark"] .theme-toggle::after {
  left: 20px;
  content: '\1F319';
}

[data-theme="dark"] .theme-toggle {
  background: rgba(116,65,186,.3);
  border-color: rgba(116,65,186,.4);
}

/* ── Dark Mode Component Overrides ── */

[data-theme="dark"] .card {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .detail-header {
  border-color: rgba(255,255,255,.06);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: var(--text);
}

[data-theme="dark"] .form-input::placeholder {
  color: var(--text-ter);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus {
  box-shadow: 0 0 0 3px rgba(116,65,186,.2);
}

[data-theme="dark"] .info-grid {
  background: rgba(255,255,255,.06);
}

[data-theme="dark"] .info-cell {
  background: var(--surface);
}

[data-theme="dark"] .btn-outline {
  background: rgba(255,255,255,.06);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .btn-outline:hover {
  background: var(--brand-50);
}

[data-theme="dark"] .btn-danger-outline {
  background: rgba(255,255,255,.06);
}

[data-theme="dark"] .file-item {
  background: var(--surface);
  border-color: var(--border-light);
}

[data-theme="dark"] .file-item:hover {
  background: var(--brand-50);
}

[data-theme="dark"] .file-action {
  background: var(--brand-50);
  color: var(--brand-light);
}

[data-theme="dark"] .upload-zone {
  background: var(--surface);
  border-color: var(--brand-200);
}

[data-theme="dark"] .upload-zone:hover,
[data-theme="dark"] .upload-zone.dragover {
  background: var(--brand-50);
}

[data-theme="dark"] .desc-box {
  background: var(--surface);
  border-color: var(--border-light);
}

[data-theme="dark"] .tracking-box {
  background: var(--brand-50);
  border-color: var(--brand-100);
}

[data-theme="dark"] .tracking-number {
  color: var(--brand-light);
}

[data-theme="dark"] .reply-box {
  background: var(--surface);
  border-color: var(--border-light);
}

[data-theme="dark"] .reply-input {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: var(--text);
}

[data-theme="dark"] .reply-input:focus {
  box-shadow: 0 0 0 3px rgba(116,65,186,.2);
}

[data-theme="dark"] .reply-attach {
  background: rgba(255,255,255,.06);
  border-color: var(--border);
  color: var(--text-sec);
}

[data-theme="dark"] .tabs {
  background: var(--surface);
  border-color: var(--border-light);
}

[data-theme="dark"] .tab:hover,
[data-theme="dark"] .tab.active {
  background: rgba(255,255,255,.08);
}

[data-theme="dark"] .milestone-dot {
  background: var(--surface);
}

[data-theme="dark"] .milestone-card {
  background: rgba(255,255,255,.06);
  border-color: var(--border-light);
}

[data-theme="dark"] .dup-option {
  background: rgba(255,255,255,.06);
  border-color: var(--border-light);
}

[data-theme="dark"] .dup-option:hover {
  background: var(--brand-50);
}

[data-theme="dark"] .link-box {
  background: rgba(255,255,255,.06);
  border-color: var(--border-light);
}

[data-theme="dark"] .timeline-file {
  background: var(--surface);
  border-color: var(--border-light);
}

[data-theme="dark"] .timeline-system {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .alert-warning {
  color: var(--warning);
}

[data-theme="dark"] .alert-success {
  color: var(--success);
}

[data-theme="dark"] .promo-tag {
  background: var(--gold-50);
  border-color: var(--gold-100);
}

[data-theme="dark"] .section-title {
  color: var(--text);
}

[data-theme="dark"] .footer a {
  color: var(--brand-light);
}

/* ── Dark Mode — jv2 Accordion Overrides ── */

[data-theme="dark"] .jv2-tracking {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
}

[data-theme="dark"] .jv2-tracking-desc {
  border-color: rgba(255,255,255,.08);
}

[data-theme="dark"] .jv2-timeline-dot {
  background: var(--surface);
}

[data-theme="dark"] .jv2-jalon {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
}

[data-theme="dark"] .jv2-jalon-header:hover {
  background: rgba(255,255,255,.04);
}

[data-theme="dark"] .jv2-jalon.expanded {
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

[data-theme="dark"] .jv2-jalon-chevron {
  background: rgba(255,255,255,.08);
}

[data-theme="dark"] .jv2-file-dl {
  background: rgba(255,255,255,.06);
  border-color: var(--border);
}

[data-theme="dark"] .jv2-file-preview {
  background: rgba(255,255,255,.06);
  border-color: var(--border);
  color: var(--text-ter);
}

[data-theme="dark"] .jv2-reply-inner {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}

[data-theme="dark"] .jv2-reply-inner:focus-within {
  box-shadow: 0 0 0 3px rgba(116,65,186,.2);
}

[data-theme="dark"] .jv2-reply-textarea {
  color: var(--text);
}

[data-theme="dark"] .jv2-msg-file {
  background: var(--surface);
  border-color: var(--border-light);
}

[data-theme="dark"] .jv2-msg-role.student {
  color: var(--brand-light);
}

/* ========================================================================
   Preview Modal
   ======================================================================== */
.sd-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sd-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.sd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.sd-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.sd-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-ter);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.sd-modal-close:hover {
  color: var(--danger);
}

.sd-modal-body {
  padding: 20px;
  overflow: auto;
  flex: 1;
  min-height: 200px;
}

.sd-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
}

[data-theme="dark"] .sd-modal {
  background: var(--dark);
  border: 1px solid var(--border);
}

[data-theme="dark"] .sd-modal-header {
  border-color: var(--border);
}

[data-theme="dark"] .sd-modal-footer {
  border-color: var(--border);
}
