﻿* {
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f4f4f4;
  color: #222;
}
.container {
  max-width: 960px;
  margin: 24px auto;
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.actions {
  display: flex;
  gap: 8px;
}
.button {
  display: inline-block;
  padding: 8px 12px;
  background: #1a73e8;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}
.button.secondary {
  background: #6b7280;
}
.button.secondary.active {
  background: #374151;
}
.button.danger, a.danger {
  background: #d93025;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
}
.notice {
  background: #eef6ff;
  border: 1px solid #c7e0ff;
  padding: 10px 12px;
  border-radius: 4px;
  margin: 16px 0;
}
.field {
  margin-bottom: 12px;
}
.field label {
  display: block;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.customer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.item-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 80px 120px 140px 110px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.items-header {
  font-weight: 600;
  margin-top: 8px;
}
.item-row select,
.item-row input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.subtotal-text {
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #f8fafc;
  min-height: 38px;
  display: flex;
  align-items: center;
}
.totals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
table th,
table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 8px;
  text-align: left;
}
.inline-form {
  display: flex;
  gap: 8px;
  margin: 12px 0 18px;
}
.inline-form input {
  flex: 1;
}
.table-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.table-inline-form input[type="number"] {
  width: 60px;
}
.table-inline-form .unit-suffix {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}
.table-inline-form {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.table-inline-form .auto-stock-input {
  width: 45px !important;
  min-width: 45px !important;
  max-width: 45px !important;
  flex: 0 0 45px !important;
  padding: 4px 2px !important;
  text-align: center;
}
.customer-info-inline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.actual-row {
  grid-template-columns: minmax(200px, 1fr) 120px 160px 110px;
}
.delta-pos {
  color: #0f9d58;
  font-weight: 600;
}
.delta-neg {
  color: #d93025;
  font-weight: 600;
}
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.status-pill.done {
  background: #e8f5e9;
  color: #0f9d58;
}
.status-pill.pending {
  background: #fff4e5;
  color: #b45309;
}
.report-shell {
  border: 1px solid #e5e7eb;
  background:
    radial-gradient(1200px 200px at -10% -20%, #eaf3ff 0%, transparent 60%),
    radial-gradient(900px 180px at 110% -20%, #e8fff3 0%, transparent 60%),
    #fff;
}
.report-header h1 {
  margin: 0;
}
.report-subtitle {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.report-card {
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}
.report-card.primary {
  border-color: #cfe3ff;
  background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 100%);
}
.report-card.accent {
  border-color: #d9d6ff;
  background: linear-gradient(180deg, #f8f7ff 0%, #ffffff 100%);
}
.report-card.success {
  border-color: #ccead7;
  background: linear-gradient(180deg, #f2fbf6 0%, #ffffff 100%);
}
.report-label {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
}
.report-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: #6b7280;
}
.report-value {
  margin: 12px 0 0;
  font-size: 30px;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
}
.report-value span {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}
@media (max-width: 560px) {
  .customer-grid,
  .totals-grid,
  .customer-info-inline {
    grid-template-columns: 1fr;
  }
  .report-grid {
    grid-template-columns: 1fr;
  }
  .item-row {
    grid-template-columns: 1fr;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.login-form {
  max-width: 420px;
}

.row-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
}
.row-actions .action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  color: #1a73e8;
  background: #eef4ff;
  border: 1px solid #cfe0ff;
}
.row-actions .action-link:hover {
  background: #e2edff;
}
.row-actions .action-link.danger {
  color: #fff;
  background: #d93025;
  border-color: #c6281f;
  min-width: 68px;
  padding: 6px 9px;
  font-weight: 600;
}
.row-actions .action-link.danger:hover {
  background: #bf2a20;
}
.actions-col {
  min-width: 150px;
}




.customer-name-link {
  text-decoration: none;
  font-weight: 700;
  color: #111827;
}
.customer-name-link:hover {
  text-decoration: none;
  color: #0f172a;
}

.import-panel {
  margin: 12px 0 18px;
  padding: 12px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 8px;
}
.import-panel h2 {
  margin-top: 0;
}
.import-form {
  flex-wrap: wrap;
}
.import-form .import-form-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.import-form .import-form-row + .import-form-row {
  margin-top: 8px;
}
.import-form .import-form-row-2 .button {
  flex: 0 0 auto;
}
.import-form select,
.import-form input {
  min-width: 140px;
  height: 36px;
  padding: 6px 10px;
  font-size: 14px;
  box-sizing: border-box;
}

/* mobile-tuning-v1 */
@media (max-width: 900px) {
  .container {
    margin: 12px;
    padding: 16px;
  }

  .header {
    flex-wrap: wrap;
  }

  .actions {
    flex-wrap: wrap;
  }

  .inline-form {
    flex-wrap: wrap;
  }

  .inline-form input,
  .inline-form select,
  .inline-form button {
    width: 100%;
    min-width: 0;
  }

  .table-inline-form {
    flex-wrap: nowrap;
  }

  .table-inline-form input[type="number"] {
    width: 100%;
  }
  .table-inline-form .auto-stock-input {
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    flex: 0 0 45px !important;
  }
  .table-inline-form .unit-suffix {
    display: inline-block;
    width: auto;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .actions .button,
  .actions a.button {
    width: 100%;
    text-align: center;
  }

  .row-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .row-actions .action-link {
    min-width: 92px;
    padding: 7px 10px;
  }

  .actions-col {
    min-width: 130px;
  }

  .import-panel {
    padding: 10px;
  }
  .import-form .import-form-row {
    flex-wrap: wrap;
  }
}

/* customer-form horizontal row tuning */
#customer-form .items-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  padding-bottom: 4px;
}
#customer-form .items-header.item-row,
#customer-form #items .item-row {
  min-width: 480px;
}
#customer-form .item-row {
  display: grid !important;
  grid-template-columns: minmax(85px, 120px) 49px 96px 88px 32px !important;
  gap: 8px;
  align-items: center;
}
#customer-form .item-row select,
#customer-form .item-row input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
}
#customer-form .subtotal-text {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}
.remove-row-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #f5b7b1;
  border-radius: 6px;
  background: #fff1f0;
  color: #d93025;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.remove-row-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: block;
}
.remove-row-btn:hover {
  background: #ffe4e1;
}
@media (max-width: 640px) {
  #customer-form .item-row,
  #customer-form .items-header.item-row {
    display: grid !important;
    grid-template-columns: minmax(85px, 120px) 49px 90px 84px 30px !important;
    min-width: 480px;
  }
}


#customer-form .flower-select {
  font-size: 11px;
}



.customer-form-header {
  align-items: flex-start;
  margin-bottom: 10px;
}
.customer-form-header .actions {
  margin-top: -4px;
}
#customer-form .items-header.item-row div {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}





#customer-form .totals-grid .field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}
#customer-form .totals-grid .field label {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: 13px;
  min-width: 140px;
}
#customer-form .totals-grid .field input[type="text"] {
  flex: 1;
}
@media (max-width: 640px) {
  #customer-form .totals-grid .field {
    flex-direction: row;
  }
  #customer-form .totals-grid .field label {
    min-width: 130px;
  }
}

/* actual-sale-form horizontal row tuning */
#actual-sale-form .actual-items-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  padding-bottom: 4px;
}
#actual-sale-form .items-header.item-row,
#actual-sale-form #actual-items .actual-row {
  min-width: 620px;
}
#actual-sale-form .actual-row {
  display: grid !important;
  grid-template-columns: minmax(85px, 118px) 46px 90px 170px 32px !important;
  gap: 8px;
  align-items: center;
}
#actual-sale-form .actual-row select,
#actual-sale-form .actual-row input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
}
#actual-sale-form .items-header.item-row div {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.actual-sale-header {
  align-items: flex-start;
  margin-bottom: 10px;
}
.actual-sale-header .actions {
  margin-top: -4px;
}
.actual-sale-totals .field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}
.actual-sale-totals .field label {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: 13px;
  min-width: 160px;
}
.actual-sale-totals .field input[type="text"] {
  flex: 1;
}
@media (max-width: 640px) {
  #actual-sale-form .actual-row,
  #actual-sale-form .items-header.item-row {
    grid-template-columns: minmax(85px, 118px) 44px 88px 160px 30px !important;
    min-width: 600px;
  }
  .actual-sale-totals .field label {
    min-width: 150px;
  }
}

/* actual-sale-form visual refinements */
#actual-sale-form .status-field {
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 10px 12px;
}
#actual-sale-form .status-field label {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}
#actual-sale-form .status-select {
  width: 180px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  color: #1e3a8a;
}
#actual-sale-form .items-header.item-row div {
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
  line-height: 1.2;
}
.compare-table {
  table-layout: fixed;
}
.compare-table th:nth-child(1),
.compare-table td:nth-child(1) {
  width: 5% !important;
  padding-left: 2px !important;
  padding-right: 0 !important;
}
.compare-table th:nth-child(2),
.compare-table td:nth-child(2),
.compare-table th:nth-child(3),
.compare-table td:nth-child(3),
.compare-table th:nth-child(4),
.compare-table td:nth-child(4) {
  width: 12%;
  white-space: normal;
  word-break: keep-all;
  padding: 6px 6px;
}
.compare-table th:nth-child(2),
.compare-table td:nth-child(2) {
  padding-left: 2px !important;
}
.compare-table td:nth-child(1) {
  padding-right: 10px !important;
}
.compare-table td:nth-child(2) {
  padding-left: 10px !important;
}
.compare-table th:nth-child(1) {
  padding-right: 6px !important;
}
.compare-table th:nth-child(2) {
  padding-left: 6px !important;
}
.compare-table th:nth-child(5),
.compare-table td:nth-child(5) {
  width: 59% !important;
}
@media (max-width: 640px) {
  .compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .compare-table {
    min-width: 640px;
  }
  .compare-table th,
  .compare-table td {
    padding-left: 2px !important;
    padding-right: 2px !important;
  }
  .compare-table th:nth-child(1),
  .compare-table td:nth-child(1) {
    width: 10% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .compare-table th:nth-child(2),
  .compare-table td:nth-child(2),
  .compare-table th:nth-child(3),
  .compare-table td:nth-child(3),
  .compare-table th:nth-child(4),
  .compare-table td:nth-child(4) {
    width: 10.8% !important;
    padding: 5px 5px;
  }
  .compare-table th:nth-child(2),
  .compare-table td:nth-child(2) {
    padding-left: 1px !important;
  }
  .compare-table td:nth-child(1) {
    padding-right: 10px !important;
  }
  .compare-table td:nth-child(2) {
    padding-left: 10px !important;
  }
  .compare-table th:nth-child(1) {
    padding-right: 6px !important;
  }
  .compare-table th:nth-child(2) {
    padding-left: 6px !important;
  }
  .compare-table th:nth-child(5),
  .compare-table td:nth-child(5) {
    width: 57.6% !important;
  }
}



.compare-table th:nth-child(2),
.compare-table th:nth-child(3),
.compare-table th:nth-child(4) {
  line-height: 1.25;
}



/* index-table compact tuning */
.index-table {
  table-layout: fixed;
}
.index-table .quantity-col {
  width: 44px;
  white-space: nowrap;
  text-align: center;
}
.index-table .ship-col {
  width: 108px;
  min-width: 108px;
  text-align: center;
}
.index-table td.ship-col .action-link {
  min-width: 92px;
  padding: 7px 10px;
}
.index-table td.ship-col .action-link.ship-btn {
  color: #6d28d9;
  border-color: #ddd6fe;
  background: #f3e8ff;
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow: none;
  font-weight: 700;
  font-size: 12px;
}
.index-table td.ship-col .action-link.ship-btn:hover {
  color: #5b21b6;
  background: #ede9fe;
  border-color: #c4b5fd;
  text-decoration: none !important;
  box-shadow: none;
  transform: none;
}
.index-table td.ship-col .action-link.ship-btn:focus,
.index-table td.ship-col .action-link.ship-btn:visited {
  text-decoration: none !important;
}
.index-table td.ship-col .action-link.ship-btn:active {
  transform: none;
}
.index-table .actions-col {
  min-width: 44px;
  width: 44px;
  text-align: center;
}
.index-table .row-actions {
  flex-wrap: nowrap !important;
  gap: 0;
  justify-content: center;
}
.index-table .row-actions .icon-trash {
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.index-table .row-actions .icon-trash svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: block;
}
@media (max-width: 640px) {
  .index-table .ship-col {
    width: 102px;
    min-width: 102px;
  }
  .index-table .actions-col {
    min-width: 40px;
    width: 40px;
  }
  .index-table .row-actions {
    flex-wrap: nowrap !important;
  }
  .index-table .quantity-col {
    width: 38px;
  }
}

/* flowers stats compact tuning */
.flowers-delete-icon {
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.flowers-delete-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: block;
}

.stats-table-1,
.stats-table-2 {
  table-layout: fixed;
}

/* Thong ke 1 */
.stats-table-1 th:nth-child(1),
.stats-table-1 td:nth-child(1) {
  width: 36% !important;
}
.stats-table-1 th:nth-child(2),
.stats-table-1 td:nth-child(2),
.stats-table-1 th:nth-child(3),
.stats-table-1 td:nth-child(3),
.stats-table-1 th:nth-child(4),
.stats-table-1 td:nth-child(4) {
  width: 20% !important;
}
.stats-table-1 th:nth-child(5),
.stats-table-1 td:nth-child(5) {
  width: 20% !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* Thong ke 2 */
.stats-table-2 th:nth-child(1),
.stats-table-2 td:nth-child(1) {
  width: 35%;
}
.stats-table-2 th:nth-child(2),
.stats-table-2 td:nth-child(2) {
  width: 38% !important;
}
.stats-table-2 th:nth-child(3),
.stats-table-2 td:nth-child(3) {
  width: 27% !important;
}
@media (max-width: 640px) {
  .stats-table-1 th:nth-child(1),
  .stats-table-1 td:nth-child(1) {
    width: 36%;
  }
  .stats-table-1 th:nth-child(2),
  .stats-table-1 td:nth-child(2),
  .stats-table-1 th:nth-child(3),
  .stats-table-1 td:nth-child(3),
  .stats-table-1 th:nth-child(4),
  .stats-table-1 td:nth-child(4) {
    width: 20% !important;
    padding: 5px 4px;
  }
  .stats-table-1 th:nth-child(5),
  .stats-table-1 td:nth-child(5) {
    width: 20% !important;
    padding: 5px 4px;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .stats-table-2 th:nth-child(1),
  .stats-table-2 td:nth-child(1) {
    width: 36%;
  }
  .stats-table-2 th:nth-child(2),
  .stats-table-2 td:nth-child(2) {
    width: 36% !important;
    padding: 5px 4px;
  }
  .stats-table-2 th:nth-child(3),
  .stats-table-2 td:nth-child(3) {
    width: 28% !important;
    padding: 5px 4px;
  }
}
.stats-table-1 th,
.stats-table-1 td,
.stats-table-2 th,
.stats-table-2 td {
  white-space: normal !important;
  word-break: break-word;
}
.stats-table-1 th:nth-child(5),
.stats-table-1 td:nth-child(5) {
  white-space: nowrap !important;
}








