/* styles.css */
:root{
  --bg: #0b1220;
  --card: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);

  --primary: #4f8cff;
  --primary2:#2f6fff;
  --good: #38d9a9;

  --radius: 16px;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
}

*{ box-sizing: border-box; }
html, body { height: 100%; }

body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(79,140,255,.18), transparent 55%),
    radial-gradient(1200px 800px at 90% 30%, rgba(56,217,169,.12), transparent 55%),
    radial-gradient(900px 600px at 50% 95%, rgba(255,92,119,.08), transparent 55%),
    var(--bg);
}

.app{
  max-width: 1150px;
  margin: 26px auto;
  padding: 0 16px 40px;
}

/* Top header */
.topbar{
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 250px;
}

.logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(79,140,255,.95), rgba(56,217,169,.85));
  box-shadow: 0 18px 40px rgba(79,140,255,.18);
  display:grid;
  place-items:center;
  font-weight: 800;
  letter-spacing: .5px;
}

.brand h1{
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.subtitle{
  color: rgba(255,255,255,.55);
  font-weight: 600;
}

.brand p{
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  user-select:none;
}
.btn:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.16);
}
.btn:active{ transform: translateY(1px); }

.btn.primary{
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(79,140,255,.20);
}
.btn.primary:hover{ filter: brightness(1.05); }

.btn.ghost{ background: transparent; }

/* Layout */
.grid{
  display:grid;
  grid-template-columns: 1.35fr .95fr;
  gap: 16px;
  align-items:start;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-head{
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.title{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.title h2{
  margin:0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .2px;
}
.title span{
  font-size: 12px;
  color: var(--muted);
}

/* Search */
.search{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display:flex;
  gap:10px;
  align-items:center;
}
.search input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  outline:none;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 13px;
}
.search input::placeholder{ color: rgba(255,255,255,0.40); }

/* Small badge/chip */
.badge{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display:inline-flex;
  gap:8px;
  align-items:center;
  white-space: nowrap;
}
.badge b{ color: rgba(255,255,255,0.9); font-weight: 900; }

.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.dot{
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(56,217,169,.12);
}

/* Table */
.table-wrap{ overflow:auto; }

table{
  width:100%;
  border-collapse: collapse;
}

thead th{
  text-align:left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

tbody td{
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.86);
}

tbody tr{
  transition: background .12s ease;
  cursor:pointer;
}
tbody tr:hover{ background: rgba(255,255,255,0.05); }
tbody tr.active{
  background: rgba(79,140,255,0.16);
  outline: 1px solid rgba(79,140,255,0.30);
}

.col-name{ min-width: 220px; }
.col-phone{ min-width: 140px; }
.col-city{ min-width: 140px; }
.col-actions{ min-width: 120px; text-align:right; }

.muted{
  color: var(--muted);
  font-size: 12px;
}

.table-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
}

.icon-btn{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: background .15s ease, transform .08s ease;
  user-select:none;
}
.icon-btn:hover{ background: rgba(255,255,255,0.10); }
.icon-btn:active{ transform: translateY(1px); }
.icon{
  width: 16px;
  height: 16px;
  opacity: .9;
}

/* Details */
.details-body{
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.kv{
  display:grid;
  grid-template-columns: 140px 1fr;
  gap:10px;
  padding: 10px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
}
.k{
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.v{
  font-size: 13px;
  color: rgba(255,255,255,0.90);
  overflow-wrap: anywhere;
}

.details-footer{
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap: wrap;
}

.empty{
  padding: 16px 14px 18px;
  color: var(--muted);
  font-size: 13px;
}

.error{
  padding: 12px 14px 14px;
  color: rgba(255,255,255,0.90);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ==========================
   MODAL (Edit Customer)
========================== */
.modal{
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

.modal-card{
  position: relative;
  width: min(720px, calc(100% - 24px));
  margin: 60px auto;
  background: rgba(15, 25, 45, 0.92);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  overflow: hidden;
}

.modal-head{
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.modal-head h3{
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.modal-head p{
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.modal-body{
  padding: 14px;
}

.form-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.field-full{
  grid-column: 1 / -1;
}

.field label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.field input,
.field textarea{
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  outline:none;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 13px;
}

.modal-footer{
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap: wrap;
}

@media (max-width: 720px){
  .form-grid{ grid-template-columns: 1fr; }
}

/* ==========================
   SHARE / PRINT
========================== */

.share-modal-card{
  width: min(760px, calc(100% - 24px));
}

.share-preview-title{
  margin-top: 18px;
  margin-bottom: 8px;

  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.share-preview-wrap{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;

  padding: 24px;

  display: flex;
  justify-content: center;
  align-items: center;

  min-height: 350px;
}

.shipping-card-preview{
  background: white;
  color: #111;

  width: min(320px, 100%);
  box-sizing: border-box;

  padding: 22px;

  box-shadow: 0 10px 40px rgba(0,0,0,.35);

  overflow: hidden;
}

.shipping-brand{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;

  padding-bottom: 12px;
  margin-bottom: 16px;

  border-bottom: 2px solid #111;
}

.shipping-field{
  margin-bottom: 13px;
}

.shipping-label{
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;

  color: #777;

  font-weight: 800;

  margin-bottom: 3px;
}

.shipping-value{
  font-size: 14px;
  line-height: 1.4;

  font-weight: 600;

  overflow-wrap: anywhere;
}