/* === Claude Customer Manager — dstatus-style Glass Theme === */

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

:root {
  --text-primary: #f0f0f5;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.35);
  --accent-blue: #5aadff;
  --accent-purple: #b48eff;
  --accent-green: #63e6a0;
  --accent-gold: #f5c45a;
  --accent-red: #ff8a8a;
  --glass-bg: rgba(13, 17, 28, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Body === */

body {
  color: var(--text-primary);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  min-height: 100vh;
  background: #06090f;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* When background image is set */
body.has-bg {
  background-repeat: no-repeat;
}

/* Default gradient when no bg image */
body:not(.has-bg) {
  background-image:
    radial-gradient(
      ellipse 80% 60% at 20% 40%,
      rgba(40, 90, 180, 0.12) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 60% 50% at 80% 25%,
      rgba(100, 60, 200, 0.07) 0%,
      transparent 55%
    );
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* === Glass Panel (shared) === */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.glass-light {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

/* === Header === */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px 26px;
}
.header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.btn-add {
  background: rgba(56, 132, 255, 0.85);
  color: #fff;
  border: 1px solid rgba(120, 180, 255, 0.3);
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(56, 132, 255, 0.25);
  transition: all 0.2s var(--ease);
}
.btn-add:hover {
  box-shadow: 0 4px 20px rgba(56, 132, 255, 0.4);
  transform: translateY(-1px);
}

.btn-settings {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-settings:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.bg-preview {
  display: none;
  margin-top: 8px;
  height: 80px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--glass-border);
}

/* === Stats === */

.stats {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.stat-card {
  flex: 1;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.stat-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}
.stat-card.stat-active {
  border-color: rgba(56, 132, 255, 0.4);
  box-shadow:
    0 0 0 1px rgba(56, 132, 255, 0.2),
    0 4px 16px rgba(56, 132, 255, 0.08);
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.stat-card.blue .stat-num {
  color: var(--accent-blue);
}
.stat-card.purple .stat-num {
  color: var(--accent-purple);
}
.stat-card.green .stat-num {
  color: var(--accent-green);
}
.stat-card.cyan .stat-num {
  color: #5ad8e6;
}
.stat-card.gold .stat-num {
  color: var(--accent-gold);
}
.stat-card.gold {
  cursor: default;
}

/* === Search === */

.search {
  margin-bottom: 16px;
}
.search input {
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: #e2e8f0;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}
.search input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}
.search input:focus {
  border-color: rgba(56, 132, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(56, 132, 255, 0.08);
}

/* === Filters === */

.filters {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.filter {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.filter:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}
.filter.active {
  background: rgba(56, 132, 255, 0.15);
  border-color: rgba(56, 132, 255, 0.3);
  color: var(--accent-blue);
}

/* === Customer Cards === */

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

.customer-card {
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.customer-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* === Card Layout === */

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.card-badge {
  padding: 3px 11px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.badge-standard {
  background: rgba(56, 132, 255, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 132, 255, 0.25);
}
.badge-self-paid {
  background: rgba(80, 200, 220, 0.15);
  color: #5ad8e6;
  border: 1px solid rgba(80, 200, 220, 0.25);
}
.badge-custom {
  background: rgba(160, 100, 255, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(160, 100, 255, 0.25);
}
.badge-self {
  background: rgba(80, 220, 150, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(80, 220, 150, 0.2);
}
.card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.card-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
}
.card-dates {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-date {
  font-size: 11px;
  color: var(--text-muted);
}
.card-date strong {
  color: var(--text-secondary);
}

/* === Action Buttons === */

.card-actions {
  display: flex;
  gap: 6px;
}
.btn-sm {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.btn-sm:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.btn-sm.renew {
  color: var(--accent-blue);
  border-color: rgba(56, 132, 255, 0.2);
}
.btn-sm.renew:hover {
  background: rgba(56, 132, 255, 0.15);
}
.btn-sm.delete:hover {
  background: rgba(255, 60, 60, 0.15);
  color: var(--accent-red);
  border-color: rgba(255, 60, 60, 0.2);
}

/* === Tags === */

.reminder-tag {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.reminder-tag.active {
  background: rgba(56, 132, 255, 0.12);
  border-color: rgba(56, 132, 255, 0.2);
  color: var(--accent-blue);
}

.days-left {
  font-size: 11px;
  color: var(--accent-blue);
  font-weight: 600;
}
.days-left.today {
  color: var(--accent-gold);
}
.days-left.expired {
  color: var(--accent-red);
}

.expiring-soon {
  border-color: rgba(245, 158, 11, 0.3) !important;
}
.expiring-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
}

/* === Modal === */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: rgba(13, 17, 28, 0.85);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px;
  width: 440px;
  max-width: 90vw;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  animation: modalIn 0.3s var(--ease);
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 22px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-group input,
.form-group select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  border-color: rgba(56, 132, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(56, 132, 255, 0.08);
}
.form-group select {
  appearance: none;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group {
  flex: 1;
}

.reminder-options {
  display: flex;
  gap: 6px;
}
.reminder-opt {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.reminder-opt.selected {
  background: rgba(56, 132, 255, 0.15);
  border-color: rgba(56, 132, 255, 0.3);
  color: var(--accent-blue);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.btn-save {
  background: rgba(56, 132, 255, 0.85);
  border: 1px solid rgba(120, 180, 255, 0.3);
  color: #fff;
  padding: 9px 22px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(56, 132, 255, 0.25);
  transition: all 0.2s;
}
.btn-save:hover {
  box-shadow: 0 4px 20px rgba(56, 132, 255, 0.4);
  transform: translateY(-1px);
}

.computed-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
}
.computed-date strong {
  color: var(--accent-blue);
}

/* === Toast === */

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: rgba(15, 50, 40, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(80, 220, 150, 0.2);
  color: var(--accent-green);
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.3s var(--ease);
}
@keyframes toastIn {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* === Scrollbar === */

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
::selection {
  background: rgba(56, 132, 255, 0.3);
}

/* === Responsive === */

@media (max-width: 640px) {
  .container {
    padding: 20px 14px;
  }
  .stats {
    flex-wrap: wrap;
    gap: 8px;
  }
  .stat-card {
    min-width: calc(50% - 4px);
  }
  .card-info {
    flex-direction: column;
    gap: 4px;
  }
  .card-bottom {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  .card-actions {
    align-self: flex-end;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .filters {
    flex-wrap: wrap;
  }
}
