/* ===== Modern Customer Portal (aligned with new admin panel language) ===== */

.cp-body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 90% -10%, rgba(59, 130, 246, 0.22), transparent 55%),
              radial-gradient(900px 500px at -10% 20%, rgba(16, 185, 129, 0.12), transparent 55%),
              #020817;
  color: #e2e8f0;
}

.cp-skip {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 9999;
  padding: 0.75rem 1.1rem;
  background: #22c55e;
  color: #04130a;
  border-radius: 8px;
  font-weight: 700;
}

.cp-skip:focus {
  left: 1rem;
}

.cp-shell {
  min-height: 100vh;
  display: flex;
}

.cp-shell-simple {
  align-items: stretch;
}

.cp-sidebar {
  width: 280px;
  position: fixed;
  inset: 0 auto 0 0;
  background: rgba(15, 23, 42, 0.94);
  border-right: 1px solid #1e293b;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  z-index: 90;
  transform: translateX(-102%);
  transition: transform 0.22s ease;
}

.cp-sidebar.open {
  transform: translateX(0);
}

.cp-sidebar-simple {
  transform: none;
}

.cp-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cp-brand {
  color: #f8fafc;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cp-sidebar-close,
.cp-sidebar-open {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #111c31;
  color: #e2e8f0;
  cursor: pointer;
}

.cp-nav {
  display: grid;
  gap: 0.4rem;
}

.cp-nav a {
  border-radius: 10px;
  padding: 0.72rem 0.85rem;
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.18s, color 0.18s;
}

.cp-nav a:hover {
  color: #f8fafc;
  background: #111c31;
}

.cp-nav a.active {
  color: #f8fafc;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.cp-nav a.danger:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
}

.cp-version {
  margin-top: auto;
  color: #64748b;
  font-size: 0.76rem;
}

.cp-content {
  width: 100%;
}

.cp-content-simple {
  margin-left: 280px;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.cp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #1e293b;
  background: rgba(11, 21, 42, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cp-topbar h1 {
  margin: 0;
  font-size: 1.45rem;
  color: #f8fafc;
}

.cp-topbar p {
  margin: 0.15rem 0 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.cp-main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 1.4rem;
}

.cp-hero {
  margin-bottom: 1rem;
}

.cp-card {
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 1rem;
}

.cp-kicker {
  margin: 0;
  color: #60a5fa;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cp-card h2,
.cp-card h3 {
  margin: 0.45rem 0 0;
  color: #f8fafc;
  font-size: 1.05rem;
}

.cp-muted {
  margin: 0.45rem 0 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.cp-facts {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.cp-fact {
  border: 1px solid #243246;
  background: #111c31;
  border-radius: 12px;
  padding: 0.72rem;
}

.cp-fact span {
  display: block;
  color: #94a3b8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cp-fact strong {
  display: block;
  margin-top: 0.25rem;
  color: #e2e8f0;
  font-size: 0.92rem;
}

.cp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

.cp-updates-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.cp-update-item {
  border: 1px solid #243246;
  background: #111c31;
  border-radius: 12px;
  padding: 0.8rem;
}

.cp-update-item time {
  display: block;
  color: #93c5fd;
  font-size: 0.78rem;
  margin-bottom: 0.3rem;
}

.cp-update-item p {
  margin: 0;
  color: #dbeafe;
  font-size: 0.9rem;
}

.cp-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.cp-image {
  width: 170px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid #2b3a51;
}

.cp-chat-messages {
  margin-top: 0.8rem;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid #243246;
  background: #111c31;
  border-radius: 12px;
  padding: 0.8rem;
}

.cp-chat-msg {
  padding: 0.68rem 0.72rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #0f1a2e;
  margin-bottom: 0.6rem;
}

.cp-chat-msg:last-child {
  margin-bottom: 0;
}

.cp-chat-msg.msg-admin {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(14, 116, 144, 0.2);
}

.cp-chat-meta {
  color: #93c5fd;
  font-size: 0.76rem;
}

.cp-chat-msg p {
  margin: 0.25rem 0 0;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.cp-chat-form {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.cp-chat-form textarea {
  width: 100%;
  min-height: 90px;
  border-radius: 11px;
  border: 1px solid #334155;
  background: #0f1a2e;
  color: #e2e8f0;
  padding: 0.72rem;
  resize: vertical;
}

.cp-chat-form textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.cp-empty {
  margin: 0.2rem 0 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.cp-empty-card {
  max-width: 720px;
}

.cp-empty-card h1 {
  margin: 0.4rem 0 0;
  color: #f8fafc;
  font-size: 1.9rem;
}

.cp-empty-card p {
  margin: 0.6rem 0 0;
  color: #94a3b8;
}

.cp-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(2px);
  z-index: 120;
  display: none;
}

.cp-modal {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cp-modal-content {
  width: 100%;
  max-width: 560px;
  border-radius: 16px;
  border: 1px solid #243246;
  background: #0f172a;
  padding: 1rem;
  position: relative;
}

.cp-modal-content h2 {
  margin: 0 0 0.6rem;
  color: #f8fafc;
}

.cp-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.25rem;
}

.cp-profile-form {
  display: grid;
  gap: 0.75rem;
}

.cp-form-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr;
}

.cp-profile-form label {
  display: block;
  margin-bottom: 0.3rem;
  color: #cbd5e1;
  font-size: 0.84rem;
}

.cp-profile-form input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #111c31;
  color: #e2e8f0;
  padding: 0.63rem 0.7rem;
}

.cp-profile-form input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-error {
  color: #fca5a5;
  margin: 0 0 0.45rem;
}

.form-success {
  color: #86efac;
  margin: 0 0 0.45rem;
}

.cp-modal-open .cp-main {
  filter: blur(2px);
}

@media (min-width: 980px) {
  .cp-sidebar {
    transform: none;
  }

  .cp-content {
    margin-left: 280px;
  }

  .cp-sidebar-open,
  .cp-sidebar-close {
    display: none;
  }
}

@media (max-width: 1100px) {
  .cp-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .cp-content-simple {
    margin-left: 0;
    padding: 1rem;
  }

  .cp-sidebar-simple {
    display: none;
  }

  .cp-topbar h1 {
    font-size: 1.2rem;
  }

  .cp-facts {
    grid-template-columns: 1fr;
  }

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

/* ===== Customer Portal – Invoices section ===== */

.cp-invoices-section {
  margin-top: 1rem;
}

.cp-invoices-list {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.6rem;
}

.cp-invoice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #111c31;
  border: 1px solid #243246;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  flex-wrap: wrap;
}

.cp-invoice-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cp-invoice-num {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.cp-invoice-date {
  color: #64748b;
  font-size: 0.78rem;
}

.cp-invoice-center {
  flex: 1;
  min-width: 0;
}

.cp-invoice-due {
  color: #94a3b8;
  font-size: 0.82rem;
}

.cp-invoice-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cp-invoice-amount {
  font-weight: 700;
  color: #e2e8f0;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Status badge variants (reused from admin palette) */
.status-badge { display: inline-block; padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.02em; }
.badge-success { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.25); }
.badge-warning { background: rgba(234, 179, 8, 0.15); color: #fbbf24; border: 1px solid rgba(234, 179, 8, 0.25); }
.badge-muted   { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }

@media (max-width: 600px) {
  .cp-invoice-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .cp-invoice-right { width: 100%; justify-content: space-between; }
}
