/* ═══════════════════════════════════════
   SMART TAILOR — PREMIUM ADMIN UI
   Clean White + Royal Blue
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===== ROOT VARIABLES ===== */
:root {
  --primary: #4361ee;
  --primary-dark: #3651d4;
  --accent: #4361ee;

  --ink: #1e293b;
  --ink3: #334155;

  --bg-main: #f6f8ff;
  --white: #ffffff;
  --border-l: #e9edf5;

  --text-dark: #1f2937;
  --text-light: #6b7280;

  --shadow: 0 6px 20px rgba(0,0,0,0.05);
  --shadow-soft: 0 8px 30px rgba(0,0,0,0.04);
  --shadow-premium: 0 10px 40px rgba(67,97,238,0.08);
  --shadow-premium-hover: 0 16px 48px rgba(67,97,238,0.12);

  --font-head: 'Poppins', sans-serif;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
body {
  margin: 0;
  padding: 0;
  background: #f6f8ff;
}

/* ===== GLOBAL ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: var(--bg-main);
  color: var(--text-dark);
}

/* ===============================
   SIDEBAR
   =============================== */
.tms-sidebar {
  width: 260px;
  height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--border-l);
  position: fixed;
  left: 0;
  top: 0;
  padding: 20px 18px;
  overflow-y: auto;
}

.sidebar-logo {
  margin-bottom: 25px;
}

.logo-mark {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.sidebar-logo h2 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 10px;
}

.sidebar-logo p {
  font-size: 12px;
  color: var(--text-light);
}

/* Sidebar Admin */
.sidebar-admin {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
  background: #f9fbff;
  border-radius: 10px;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.admin-name {
  font-weight: 600;
  font-size: 14px;
}

.admin-role {
  font-size: 12px;
  color: var(--text-light);
}

/* Navigation */
.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  margin: 18px 0 8px;
  text-transform: uppercase;
}

.tms-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  transition: 0.2s;
}

.tms-sidebar .nav-item:hover {
  background: #f3f6ff;
  color: var(--primary);
}

.tms-sidebar .nav-item.active {
  background: var(--primary);
  color: white;
}

.sidebar-hr {
  margin: 15px 0;
  border-color: var(--border-l);
}

/* ===============================
   MAIN AREA
   =============================== */
.tms-main {
  margin-left: 260px;
  min-height: 100vh;
  background: var(--bg-main);
}

.tms-content {
  padding: 30px;
}

/* ===============================
   TOPBAR
   =============================== */
.tms-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border-l);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-title h1 {
  font-size: 22px;
  margin-bottom: 3px;
}

.topbar-title span {
  font-size: 13px;
  color: var(--text-light);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Button */
.btn-primary-tms {
  background: var(--primary);
  color: white;
  padding: 9px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: 0.2s;
}

.btn-primary-tms:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ===============================
   STATS
   =============================== */
.tms-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.tms-stat {
  background: var(--white);
  border-radius: 16px;
  padding: 22px;
  border: 1px solid var(--border-l);
  box-shadow: var(--shadow);
}

.tms-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  color: white;
}

.tms-stat-icon.purple { background: #8b5cf6; }
.tms-stat-icon.blue   { background: #3b82f6; }
.tms-stat-icon.gold   { background: #f59e0b; }
.tms-stat-icon.green  { background: #10b981; }
.tms-stat-icon.red    { background: #ef4444; }

.tms-stat-val {
  font-size: 24px;
  font-weight: 700;
}

.tms-stat-lbl {
  font-size: 14px;
  margin-top: 4px;
}

.tms-stat-sub {
  font-size: 12px;
  color: var(--text-light);
}

/* ===============================
   CARDS
   =============================== */
.tms-card {
  background: var(--white);
  border-radius: 8px !important;
  border: 1px solid var(--border-l);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  animation: fadeInUp 0.4s ease-out;
}
.tms-card:hover {
  box-shadow: 0 10px 40px rgba(67,97,238,0.08);
}

.tms-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid #eef1f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tms-card-header h5 {
  font-size: 15px;
  margin: 0;
}

.tms-btn-view {
  font-size: 12px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
}

.tms-btn-view:hover {
  text-decoration: underline;
}

/* Badges */
.tms-badge {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 20px;
  font-weight: 600;
}

.badge-gold { background: #fef3c7; color: #b45309; }
.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-green{ background: #dcfce7; color: #15803d; }
.badge-sky  { background: #e0f7fa; color: #0284c7; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* Empty State */
.tms-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.tms-empty-icon {
  width: 60px;
  height: 60px;
  background: #f3f6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 20px;
}






/* =====================================
   CUSTOMERS PAGE COMPONENTS
   ===================================== */

/* Accent 2 */
:root {
  --accent2: #7c3aed;
}

/* Customer avatar (initials badge) */
.customer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-head);
}

/* Table cell layouts */
.tms-cell-flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tms-customer-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.tms-customer-role {
  font-size: 0.7rem;
  color: #9197ae;
}

.tms-phone-cell {
  color: #4b5563;
  font-size: 0.875rem;
}

.tms-address-cell {
  font-size: 0.83rem;
  color: #6b7280;
  max-width: 180px;
}

.tms-no-orders {
  font-size: 0.8rem;
  color: #c4c9d6;
}

.tms-date-cell {
  font-size: 0.82rem;
  color: #9197ae;
}

.tms-card-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tms-modal-danger-header {
  background: linear-gradient(135deg, #7f1d1d, #991b1b) !important;
}

.tms-modal-body-pad {
  padding: 24px;
}

/* Alerts */
.tms-alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  position: relative;
}

.tms-alert.success {
  background: #dcfce7;
  color: #166534;
}

.tms-alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.tms-alert.warning {
  background: #fef3c7;
  color: #92400e;
}

.tms-alert-close {
  position: absolute;
  right: 12px;
  top: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

/* Search - Premium */
.tms-search {
  position: relative;
  transition: all 0.3s ease;
}

.tms-search input {
  padding: 10px 14px 10px 36px;
  border-radius: 12px;
  border: 2px solid var(--border-l);
  font-size: 14px;
  background: var(--white);
  transition: all 0.25s ease;
  min-width: 200px;
}

.tms-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(67,97,238,0.12);
  outline: none;
}

.tms-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #9ca3af;
  transition: color 0.25s ease;
}

.tms-search:focus-within i {
  color: var(--primary);
}

/* Premium Search Card (standalone) */
.tms-search-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-premium);
  border: 1px solid rgba(67,97,238,0.06);
  padding: 28px 32px;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

.tms-search-card:hover {
  box-shadow: var(--shadow-premium-hover);
  transform: translateY(-2px);
}

.tms-search-card .tms-search input {
  min-width: 280px;
  padding: 12px 16px 12px 42px;
  font-size: 15px;
}

.tms-search-card .tms-search i {
  left: 16px;
  font-size: 16px;
}

.tms-select-premium {
  padding: 12px 40px 12px 16px;
  border-radius: 12px;
  border: 2px solid var(--border-l);
  font-size: 14px;
  background: var(--white);
  transition: all 0.25s ease;
}

.tms-select-premium:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(67,97,238,0.12);
  outline: none;
}

/* Premium Buttons */
.btn-primary-tms {
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

.btn-primary-tms:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(67,97,238,0.35);
}

/* Premium Cards */
.tms-card {
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  animation: fadeInUp 0.4s ease-out;
}

.tms-card:hover {
  box-shadow: var(--shadow-premium);
}

/* Premium Edit/Action Buttons */
.tms-btn {
  transition: all 0.2s ease;
}

.tms-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tms-btn-edit:hover {
  background: #bae6fd !important;
  box-shadow: 0 4px 12px rgba(3,105,161,0.2);
}

.tms-btn-view:hover {
  background: #c7d2fe !important;
  box-shadow: 0 4px 12px rgba(67,51,202,0.2);
}

.tms-btn-delete:hover {
  background: #fecaca !important;
  box-shadow: 0 4px 12px rgba(153,27,27,0.2);
}

/* Table */
.tms-table {
  width: 100%;
  border-collapse: collapse;
}

.tms-table thead {
  background: #f9fbff;
}

.tms-table th,
.tms-table td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-l);
}

.tms-table tbody tr:hover {
  background: #f3f6ff;
}

/* ID Badge */
.tms-id {
  background: #eef2ff;
  color: #4338ca;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
}

/* Actions */
.tms-actions {
  display: flex;
  gap: 6px;
}

.tms-btn {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tms-btn-edit {
  background: #e0f2fe;
  color: #0369a1;
}

.tms-btn-view {
  background: #eef2ff;
  color: #4338ca;
}

.tms-btn-delete {
  background: #fee2e2;
  color: #991b1b;
}

/* Purple badge */
/* Orders Badge */
/* Orders Badge */
.badge-purple {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
  white-space: nowrap;
}

/* Modal */
.tms-modal .modal-content {
  border-radius: 14px;
  border: none;
  box-shadow: var(--shadow-soft);
}

.tms-modal .modal-header {
  background: var(--primary);
  color: white;
  border-bottom: none;
}

.modal-title {
  font-weight: 600;
}

.tms-form-group {
  margin-bottom: 16px;
}

.tms-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.tms-input,
.tms-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-l);
  font-size: 13px;
}

.tms-input:focus,
.tms-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.12);
}

/* Modal Buttons */
.tms-btn-modal-primary {
  background: var(--primary);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
}

.tms-btn-modal-secondary {
  background: #f3f4f6;
  color: #374151;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
}

.tms-btn-modal-danger {
  background: #dc2626;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
}




/* =====================================
   FORCE CUSTOM TABLE STYLE
   ===================================== */

.tms-main .tms-card {
  background: #ffffff !important;
  border-radius: 18px !important;
  border: 1px solid #e9edf5 !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.05) !important;
}

.tms-main .tms-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.tms-main .tms-table thead {
  background: #f8faff !important;
}

.tms-main .tms-table th {
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 16px !important;
  border-bottom: 1px solid #e9edf5 !important;
}

.tms-main .tms-table td {
  padding: 16px !important;
  font-size: 13px !important;
  border-bottom: 1px solid #f1f3f9 !important;
  vertical-align: middle !important;
}

.tms-main .tms-table tbody tr {
  transition: all 0.2s ease;
}

.tms-main .tms-table tbody tr:hover {
  background: #f3f6ff !important;
}

.tms-main .tms-search input {
  background: #ffffff !important;
  border: 1px solid #dbe2f0 !important;
}

.tms-main .tms-search input:focus {
  border-color: #4361ee !important;
  box-shadow: 0 0 0 3px rgba(67,97,238,0.12) !important;
}
.tms-count {
  background: #eef2ff;
  color: #4338ca;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
/* Fix Orders column width */
.tms-table th:nth-child(5),
.tms-table td:nth-child(5) {
  min-width: 110px;
}






/* FORCE PREMIUM ON BOOTSTRAP */

.card {
  border-radius: 18px !important;
  border: 1px solid #e9edf5 !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.05) !important;
}

.table {
  border-radius: 16px !important;
  overflow: hidden;
}

.table thead {
  background: #f8faff !important;
}

.table th {
  font-weight: 600 !important;
  font-size: 13px !important;
}

.table td {
  vertical-align: middle !important;
}

.btn-primary {
  background: #4361ee !important;
  border: none !important;
  border-radius: 10px !important;
}

.btn-success {
  border-radius: 10px !important;
}

.btn-info {
  border-radius: 10px !important;
}

.modal-content {
  border-radius: 20px !important;
}


.tms-sidebar {
  width: 260px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e9edf5;
  position: fixed;
  left: 0;
  top: 0;
  padding: 20px 18px;
  overflow-y: auto;
}

.tms-main {
  margin-left: 260px;
  min-height: 100vh;
  background: #f6f8ff;
}

.tms-content {
  padding: 30px;
}





/* ===============================
   MEASUREMENTS COLUMN FIX
   =============================== */

/* Keep table cells vertically centered */
.tms-table td {
  vertical-align: middle;
}

/* Measurements column width control — scoped to measurements page only */
.tms-measurements-table th:nth-child(5),
.tms-measurements-table td:nth-child(5) {
  min-width: 200px;
  max-width: 260px;
}

/* Measurements cell flex layout — scoped to measurements page only */
.tms-measurements-table td:nth-child(5) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* Badge styling improvement */
.tms-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

/* Hover effect */
.tms-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* No measurements text */
.tms-table td:nth-child(5) .text-muted {
  font-size: 13px;
  font-weight: 500;
}

/* =====================================
   PAYMENTS PAGE
   ===================================== */
.pay-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
}
.pay-status-chip.paid { background: #dcfce7; color: #15803d; }
.pay-status-chip.partial { background: #fef3c7; color: #b45309; }
.pay-status-chip.unpaid { background: #fee2e2; color: #991b1b; }
.badge-garment, .badge-status, .badge-method {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
}
.badge-status.status-pending { background: #fef3c7; color: #92400e; }
.badge-status.status-progress { background: #e0f7fa; color: #0284c7; }
.badge-status.status-completed { background: #dcfce7; color: #15803d; }
.badge-status.status-delivered { background: #e0f2fe; color: #0369a1; }
.badge-method.method-cash { background: #dcfce7; color: #15803d; }
.badge-method.method-upi { background: #e0f2fe; color: #0369a1; }
.badge-method.method-card { background: #ede9fe; color: #5b21b6; }
.badge-method.method-none { background: #f3f4f6; color: #6b7280; }
.cell-order-id { background: #eef2ff; color: #4338ca; padding: 4px 8px; font-size: 11px; border-radius: 6px; font-weight: 600; }
.cell-amount { font-weight: 600; font-size: 13px; }
.cell-amount.not-set { color: #9ca3af; font-weight: 500; }
.cell-advance { font-size: 13px; }
.cell-advance.zero { color: #9ca3af; }
.tms-btn-add { background: #dcfce7; color: #15803d; }
.tms-btn-add:hover { background: #bbf7d0; }

/* Fabric image placeholder */
.tms-fabric-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}
.tms-fabric-img-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}