:root {
  --kts-primary: #1a73e8;
  --kts-bg: #f5f7fa;
  --kts-card-bg: #fff;
  --kts-border: #e0e0e0;
  --kts-radius: 12px;
  --kts-shadow: 0 4px 24px rgba(30, 42, 73, 0.08);
  --kts-text: #222;
}
body {
  background: var(--kts-bg);
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--kts-text);
}
.kts-card {
  background: var(--kts-card-bg);
  border-radius: var(--kts-radius);
  box-shadow: var(--kts-shadow);
  padding: 2.5rem 2rem;
  max-width: 400px;
  margin: 3rem auto;
  border: 1px solid var(--kts-border);
}
.kts-login-card h2,
.kts-first-time-login-card h2 {
  margin-bottom: 1.5rem;
  color: var(--kts-primary);
  font-weight: 600;
}
.kts-forgot-password-card h2 {
  margin-bottom: 1.5rem;
  color: var(--kts-primary);
  font-weight: 600;
}
.kts-form-group {
  margin-bottom: 1.25rem;
}
.kts-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.kts-form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--kts-border);
  border-radius: 6px;
  font-size: 1rem;
  background: #f9f9f9;
  transition: border 0.2s;
}
.kts-form-group input:focus {
  border-color: var(--kts-primary);
  outline: none;
}
.kts-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  background: var(--kts-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.kts-btn:hover {
  background: #155ab6;
}
.kts-login-links {
  margin-top: 1rem;
  text-align: right;
}
.kts-login-links a {
  color: var(--kts-primary);
  text-decoration: none;
  font-size: 0.95rem;
}
.kts-login-links a:hover {
  text-decoration: underline;
}
.kts-error-msg {
  background: #ffeaea;
  color: #c00;
  border: 1px solid #f5c2c7;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 1rem;
  text-align: center;
}
/* Transaction History Filter Cards */
.kts-tx-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kts-filter-card {
  background: var(--kts-card-bg);
  border-radius: var(--kts-radius);
  box-shadow: var(--kts-shadow);
  border: 1px solid var(--kts-border);
  transition: all 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kts-filter-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.kts-filter-header {
  padding: 1rem 1.25rem;
  background: var(--kts-bg);
  border-bottom: 1px solid var(--kts-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kts-filter-header i {
  color: var(--kts-primary);
  width: 1.25rem;
  text-align: center;
}

.kts-filter-header h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--kts-text);
}

.kts-filter-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.kts-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.kts-form-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--kts-text);
  opacity: 0.8;
}

.kts-input, .kts-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--kts-border);
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  width: 100%;
  background: #f9f9f9;
}

.kts-input:focus, .kts-select:focus {
  outline: none;
  border-color: var(--kts-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Device Type Buttons */
.kts-tx-device-type-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 1.25rem 1.25rem;
}

.kts-tx-device-type-btn {
  background: var(--kts-bg);
  border: 1px solid var(--kts-border);
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.kts-tx-device-type-btn:hover {
  background: #f1f5f9;
}

.kts-tx-device-type-btn.active {
  background: var(--kts-primary);
  color: white;
  border-color: var(--kts-primary);
}

/* Action Buttons */
.kts-actions-card {
  justify-content: center;
  padding: 1.25rem;
  gap: 0.75rem;
  display: flex;
  flex-direction: column;
}

.kts-btn-block {
  width: 100%;
  display: flex;
}

.kts-btn-outline {
  background: transparent;
  border-color: var(--kts-border);
  color: var(--kts-text);
  background: white;
}

.kts-btn-outline:hover {
  background: var(--kts-bg);
}

/* Search Box */
.kts-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.kts-search-box i {
  position: absolute;
  left: 0.75rem;
  color: #666;
  pointer-events: none;
}

.kts-search-box input {
  padding-left: 2.25rem !important;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .kts-tx-filters {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kts-tx-filters {
    grid-template-columns: 1fr;
  }
  
  .kts-filter-card {
    width: 100%;
  }
  
  .kts-tx-device-type-bar {
    justify-content: center;
  }
}

/* Dashboard Carousel Styles */
.kts-dashboard-card-carousel {
  background: var(--kts-card-bg);
  border-radius: var(--kts-radius);
  box-shadow: var(--kts-shadow);
  padding: 1.5rem 1rem;
  margin-bottom: 2rem;
  border: 1px solid var(--kts-border);
}
.kts-carousel-title {
  font-weight: 600;
  color: var(--kts-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.kts-carousel-wrapper {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 0.5rem;
}
.kts-carousel-item {
  min-width: 180px;
  background: #f7fafd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(30, 42, 73, 0.06);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  color: #333;
  border: 1px solid #e0e0e0;
}
.kts-carousel-item i {
  color: var(--kts-primary);
  font-size: 1.2rem;
}
.kts-carousel-item-empty {
  min-width: 180px;
  background: #fff8e1;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(30, 42, 73, 0.06);
  padding: 1.2rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
  color: #b47b00;
  border: 1px solid #ffe0b2;
  font-weight: 600;
}
.kts-dashboard-card-carousel::-webkit-scrollbar,
.kts-carousel-wrapper::-webkit-scrollbar {
  height: 6px;
  background: #eee;
}
.kts-dashboard-card-carousel::-webkit-scrollbar-thumb,
.kts-carousel-wrapper::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 4px;
}
/* Icon improvements */
.kts-card-icon {
  font-size: 2rem;
  color: var(--kts-primary);
  margin-bottom: 0.5rem;
  display: block;
}
/* Support Tabs */
.kts-support-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kts-support-tab-btn {
  background: #e8f0fe;
  color: var(--kts-primary);
  border: none;
  border-radius: 6px 6px 0 0;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.kts-support-tab-btn.active, .kts-support-tab-btn:hover {
  background: var(--kts-primary);
  color: #fff;
}
.kts-support-tab-content {
  background: var(--kts-card-bg);
  border-radius: 0 0 12px 12px;
  box-shadow: var(--kts-shadow);
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
}
.kts-support-tickets-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.kts-support-tickets-table th, .kts-support-tickets-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}
.kts-support-tickets-table th {
  background: #f5f7fa;
  color: var(--kts-primary);
  font-weight: 600;
}
.kts-support-tickets-table tr:hover {
  background: #f0f6ff;
}
.kts-btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.95rem;
}
.kts-support-form-card {
  background: #f7fafd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(30, 42, 73, 0.06);
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  margin-bottom: 2rem;
}
.kts-support-thread-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30,42,73,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.kts-support-thread-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(30,42,73,0.18);
  width: 100%;
  max-width: 500px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.kts-support-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--kts-primary);
}
.kts-support-thread-messages {
  max-height: 300px;
  overflow-y: auto;
  background: #f7fafd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.kts-thread-msg {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #e8f0fe;
  max-width: 80%;
  word-break: break-word;
}
.kts-thread-msg-owner {
  background: #d1f5e0;
  margin-left: auto;
  text-align: right;
}
.kts-thread-msg-admin {
  background: #fbeee6;
  margin-right: auto;
  text-align: left;
}
.kts-thread-msg-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.kts-thread-msg-date {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.25rem;
}
.kts-support-thread-card textarea {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  padding: 0.75rem;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.kts-support-thread-card button {
  margin-top: 0.5rem;
}
/* Device Manager Table */
.kts-device-manager-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.kts-device-manager-table th, .kts-device-manager-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}
.kts-device-manager-table th {
  background: #f5f7fa;
  color: var(--kts-primary);
  font-weight: 600;
}
.kts-device-manager-table tr:hover {
  background: #f0f6ff;
}
.kts-cps-input {
  width: 70px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  padding: 0.4rem 0.5rem;
  font-size: 1rem;
}
.kts-status-select {
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  padding: 0.4rem 0.5rem;
  font-size: 1rem;
}
.kts-btn-add-device {
  margin-left: auto;
  background: #43b77a;
  color: #fff;
}
.kts-btn-add-device:hover {
  background: #2e8b57;
}
/* Transaction History Header */
.kts-tx-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.kts-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Action Buttons Row */
.kts-tx-actions-row {
  margin: 2rem 0;
  width: 100%;
}

.kts-actions-card {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Button Styles */
#kts-tx-apply,
#kts-tx-reset,
#kts-tx-download {
  transition: all 0.2s ease;
  border: 1px solid transparent;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 150px;
}

#kts-tx-apply {
  background: #16a34a; /* green */
  color: #fff;
  border-color: #16a34a;
}
#kts-tx-apply:hover { 
  background: #15803d;
  transform: translateY(-1px);
}

#kts-tx-reset {
  background: #ef4444; /* red */
  color: #fff;
  border-color: #ef4444;
}
#kts-tx-reset:hover { 
  background: #dc2626;
  transform: translateY(-1px);
}

#kts-tx-download {
  background: #3b82f6; /* blue */
  color: #fff;
  border-color: #3b82f6;
}
#kts-tx-download:hover { 
  background: #2563eb;
  transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .kts-tx-actions-row {
    margin: 1.5rem 0;
  }
  
  .kts-actions-card {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  #kts-tx-apply,
  #kts-tx-reset,
  #kts-tx-download {
    width: 100%;
  }
}
/* Password Popup */
.kts-password-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30,42,73,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.kts-password-popup-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(30,42,73,0.18);
  width: 100%;
  max-width: 350px;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.kts-password-popup-card input[type="password"] {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  padding: 0.75rem;
  font-size: 1rem;
}
.kts-password-popup-actions {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: center;
}
.kts-btn-cancel {
  background: #e0e0e0;
  color: #333;
}
.kts-btn-cancel:hover {
  background: #bdbdbd;
}
/* Dashboard Summary Grid */
.kts-dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.kts-dashboard-card {
  background: var(--kts-card-bg);
  border-radius: var(--kts-radius);
  box-shadow: var(--kts-shadow);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  border: 1px solid var(--kts-border);
  min-width: 0;
}
.kts-dashboard-card .kts-card-icon {
  font-size: 2.2rem;
  color: var(--kts-primary);
  margin-bottom: 0.5rem;
}
.kts-dashboard-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #222;
}
.kts-dashboard-value.kts-balance {
  color: #43b77a;
}
.kts-dashboard-value.kts-notification {
  color: #e67e22;
}
.kts-dashboard-carousels {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.kts-dashboard-card-carousel {
  flex: 1 1 320px;
  min-width: 320px;
  background: var(--kts-card-bg);
  border-radius: var(--kts-radius);
  box-shadow: var(--kts-shadow);
  padding: 1.5rem 1rem;
  border: 1px solid var(--kts-border);
  margin-bottom: 0;
}
.kts-carousel-title {
  font-weight: 600;
  color: var(--kts-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.kts-carousel-wrapper {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 0.5rem;
}
.kts-carousel-item {
  min-width: 180px;
  background: #f7fafd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(30, 42, 73, 0.06);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  color: #333;
  border: 1px solid #e0e0e0;
}
.kts-carousel-item i {
  color: var(--kts-primary);
  font-size: 1.2rem;
}
.kts-dashboard-activity-section {
  background: var(--kts-card-bg);
  border-radius: var(--kts-radius);
  box-shadow: var(--kts-shadow);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  border: 1px solid var(--kts-border);
}
.kts-activity-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
}
.kts-activity-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 1.05rem;
}
.kts-activity-list li:last-child {
  border-bottom: none;
}
.kts-activity-time {
  margin-left: auto;
  color: #888;
  font-size: 0.95rem;
  white-space: nowrap; /* Keep time on one line */
  min-width: 70px; /* Ensure minimum width for time */
  text-align: right; /* Align time to the right */
}

/* Ensure activity items don't overflow */
.kts-activity-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 1.05rem;
  flex-wrap: wrap; /* Allow items to wrap on small screens */
}

/* Make activity content take available space but not push time off screen */
.kts-activity-content {
  flex: 1;
  min-width: 0; /* Allow text to truncate */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .kts-activity-list li {
    flex-wrap: nowrap;
  }
  .kts-activity-time {
    font-size: 0.85rem;
    min-width: 60px;
  }
}

@media (max-width: 480px) {
  .kts-activity-time {
    font-size: 0.8rem;
    min-width: 50px;
  }
  .kts-activity-list li {
    font-size: 0.95rem;
  }
}
@media (max-width: 900px) {
  .kts-dashboard-carousels {
    flex-direction: column;
    gap: 1.5rem;
  }
  .kts-dashboard-card-carousel {
    min-width: 0;
  }
}
@media (max-width: 700px) {
  .kts-password-popup {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    background: rgba(30,42,73,0.18) !important;
  }
  .kts-password-popup-card {
    max-width: 95vw !important;
    width: 98vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 1.2rem 0.7rem 1.1rem 0.7rem !important;
  }
}
@media (max-width: 700px) {
  .kts-dashboard-summary-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .kts-dashboard-card, .kts-dashboard-activity-section {
    padding: 1.2rem 0.7rem;
  }
  .kts-support-thread-card, .kts-password-popup-card {
    max-width: 98vw;
    padding: 1rem 0.5rem;
  }
  .kts-support-tab-content {
    padding: 1rem 0.5rem;
  }
}
@media (max-width: 500px) {
  .kts-card {
    padding: 1.5rem 0.5rem;
    max-width: 98vw;
  }
} 
.kts-device-list-section {
  margin-top: 2rem;
  background: var(--kts-card-bg);
  border-radius: var(--kts-radius);
  box-shadow: var(--kts-shadow);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  border: 1px solid var(--kts-border);
}
.kts-device-list-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--kts-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.kts-device-manager-table th, .kts-device-manager-table td {
  vertical-align: middle;
}
.kts-device-manager-table th {
  font-size: 1.05rem;
}
.kts-device-manager-table td {
  font-size: 1.02rem;
}
.kts-device-manager-table input.kts-cps-input {
  max-width: 70px;
}
.kts-device-manager-table select.kts-status-select {
  min-width: 90px;
} 
.kts-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.kts-password-wrapper input[type="password"],
.kts-password-wrapper input[type="text"] {
  flex: 1 1 auto;
}
.kts-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #888;
  font-size: 1.1rem;
  z-index: 2;
  padding: 0 0.2rem;
}
.kts-password-toggle:hover {
  color: var(--kts-primary);
}
.kts-page {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.kts-page .kts-card {
  max-width: none;
  margin: 0 0 1.5rem 0;
}
.kts-page-header h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--kts-primary);
  margin: 0 0 0.35rem 0;
  font-weight: 700;
}
.kts-page-header .kts-muted {
  color: #6b7280;
  margin: 0 0 1rem 0;
}
.kts-tx-filters {
  margin-bottom: 1.5rem;
}
.kts-tx-device-type-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.kts-device-type-btn {
  background: #e8f0fe;
  color: var(--kts-primary);
  border: 1px solid #d6e2ff;
  border-radius: 20px;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
}
.kts-device-type-btn.active,
.kts-device-type-btn:hover {
  background: var(--kts-primary);
  color: #fff;
  border-color: var(--kts-primary);
}
.kts-btn-secondary {
  background: #e5e7eb;
  color: #111827;
}
.kts-btn-secondary:hover {
  background: #d1d5db;
}
.kts-tx-filter-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
.kts-tx-filter-row .kts-filter-item { grid-column: span 3; }
.kts-tx-filter-row .kts-filter-item[style*="flex:1"] { grid-column: span 6; }
.kts-tx-filter-row .kts-filter-actions { grid-column: span 12; display: flex; gap: 0.6rem; justify-content: flex-end; }
.kts-tx-filters label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.kts-tx-filters input[type="text"],
.kts-tx-filters input[type="date"],
.kts-tx-filters select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--kts-border);
  border-radius: 6px;
  background: #f9f9f9;
  font-size: 0.98rem;
  transition: border 0.2s;
}
.kts-tx-filters input:focus,
.kts-tx-filters select:focus {
  border-color: var(--kts-primary);
  outline: none;
}
.kts-table-responsive {
  width: 100%;
  overflow-x: auto;
}
.kts-table {
  width: 100%;
  border-collapse: collapse;
}
.kts-table th, .kts-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
}
.kts-table th {
  background: #f5f7fa;
  color: var(--kts-primary);
  font-weight: 700;
}
.kts-table tr:hover td {
  background: #f0f6ff;
}
.kts-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}
.kts-pagination .kts-page-btn {
  background: var(--kts-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.kts-pagination .kts-page-btn[disabled] {
  background: #cbd5e1;
  cursor: not-allowed;
}
.kts-pagination .kts-page-info {
  color: #374151;
  font-weight: 600;
}
@media (max-width: 900px) {
  .kts-tx-filter-row { grid-template-columns: repeat(6, 1fr); }
  .kts-tx-filter-row .kts-filter-item { grid-column: span 3; }
  .kts-tx-filter-row .kts-filter-item[style*="flex:1"] { grid-column: span 6; }
}
@media (max-width: 600px) {
  .kts-tx-filter-row { grid-template-columns: repeat(2, 1fr); }
  .kts-tx-filter-row .kts-filter-item, .kts-tx-filter-row .kts-filter-item[style*="flex:1"] { grid-column: span 2; }
  .kts-tx-filter-row .kts-filter-actions { justify-content: stretch; }
}

/* ===== TRANSACTION HISTORY OVERHAUL ===== */
:root {
  --kts-primary: #4f46e5;
  --kts-primary-light: #818cf8;
  --kts-bg: #f9fafb;
  --kts-card-bg: #ffffff;
  --kts-border: #e5e7eb;
  --kts-text: #1f2937;
  --kts-text-light: #6b7280;
  --kts-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --kts-radius: 0.5rem;
  --kts-transition: all 0.2s ease;
}

.kts-tx-page {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

.kts-tx-header {
  margin-bottom: 1.5rem;
}

.kts-tx-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--kts-primary);
  margin: 0 0 0.5rem 0;
}

.kts-tx-filters {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.kts-tx-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.kts-tx-filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kts-tx-device-type-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.kts-tx-device-type-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kts-tx-device-type-btn:hover {
  background: #e5e7eb;
}

.kts-tx-device-type-btn.active {
  background: var(--kts-primary);
  color: white;
  border-color: var(--kts-primary);
}

.kts-tx-table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1rem;
  overflow: auto;
  max-height: 60vh;
}

.kts-tx-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
}

.kts-tx-table thead {
  background: #f9fafb;
  position: sticky;
  top: 0;
}

.kts-tx-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

.kts-tx-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.kts-tx-table tr:last-child td {
  border-bottom: none;
}

.kts-tx-table tr:hover td {
  background: #f9fafb;
}

.kts-tx-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  min-height: 52px;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.kts-tx-pagination > div {
  font-size: 0.9375rem;
  color: #475569;
  font-weight: 500;
}

.kts-tx-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.kts-tx-page-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #2366d9;
  color: #2366d9;
}

.kts-tx-page-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .kts-tx-filter-group {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .kts-tx-table th, 
  .kts-tx-table td {
    padding: 0.5rem;
  }
}
@media (max-width: 1024px) {
  .kts-tx-filters {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .kts-actions-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .kts-tx-filters {
    grid-template-columns: 1fr;
  }
  
  .kts-actions-card {
    grid-template-columns: 1fr;
  }
}

/* Scrollable container styles */
.kts-tx-scroll-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.kts-tx-table-container {
  overflow: auto;
  max-height: 60vh;
}

.kts-tx-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
}

/* Scrollbar styling */
.kts-tx-table-container::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.kts-tx-table-container::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.kts-tx-table-container::-webkit-scrollbar-track {
  background: #f3f4f6;
}

/* === Compact Transaction History Mode === */
.kts-tx-page.kts-tx-compact {
  background: var(--kts-card-bg);
  border: 1px solid var(--kts-border);
  border-radius: 10px;
  box-shadow: var(--kts-shadow);
  padding: 0.5rem;
}

.kts-tx-compact .kts-tx-header {
  margin: 0 0 0.4rem 0;
  padding: 0 0 0.4rem 0;
  border-bottom: 1px solid var(--kts-border);
}

.kts-tx-compact .kts-tx-header h2 {
  font-size: 1rem;
  line-height: 1.2;
  margin: 0;
}

.kts-tx-compact .kts-tx-subtitle {
  font-size: 0.8rem;
  color: var(--kts-text-light);
}

/* Flatten inner cards and reduce spacing */
.kts-tx-compact .kts-tx-filters {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 0.3rem 0;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.2rem;
}

.kts-tx-compact .kts-filter-card {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.kts-tx-compact .kts-filter-header {
  background: transparent;
  padding: 0;
  margin: 0;
}

.kts-tx-compact .kts-filter-header h3 { display: none; }
.kts-tx-compact .kts-filter-header p { display: none; }

.kts-tx-compact .kts-filter-header i { font-size: 0.9rem; margin-right: 0.35rem; }


.kts-tx-compact .kts-filter-content {
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0.2rem;
  row-gap: 0.18rem;
}

.kts-tx-compact .kts-form-group { gap: 0.25rem; }
.kts-tx-compact .kts-form-group label { font-size: 0.64rem; margin-bottom: 0.06rem; opacity: 0.9; }
.kts-tx-compact .kts-input,
.kts-tx-compact .kts-select {
  padding: 0.18rem 0.4rem;
  font-size: 0.74rem;
}

/* Tighten native input/select heights within compact mode */
.kts-tx-compact input[type="text"],
.kts-tx-compact input[type="number"],
.kts-tx-compact input[type="date"],
.kts-tx-compact input[type="search"],
.kts-tx-compact select {
  height: 24px;
  padding: 0.18rem 0.4rem;
  font-size: 0.74rem;
}

/* Compact search box icon and padding */
.kts-tx-compact .kts-search-box i { left: 0.35rem; font-size: 0.78rem; }
.kts-tx-compact .kts-search-box input { padding-left: 1.35rem !important; }

/* Device type buttons smaller, tighter */

/* ===== PROFESSIONAL WITHDRAWAL MODALS ===== */
.kts-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
  animation: kts-modal-fade-in 0.3s ease-out;
}

@keyframes kts-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.kts-modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: kts-modal-slide-up 0.3s ease-out;
  border: 1px solid #e5e7eb;
}

@keyframes kts-modal-slide-up {
  from { 
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Password Modal Styling */
.kts-password-modal {
  padding: 2rem;
}

.kts-modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.kts-modal-icon {
  font-size: 3rem;
  color: var(--kts-primary);
  margin-bottom: 1rem;
  display: block;
}

.kts-modal-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.kts-modal-subtitle {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.4;
}

.kts-password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.kts-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 1.1rem;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.kts-password-toggle:hover {
  color: var(--kts-primary);
  background: #f3f4f6;
}

.kts-modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.kts-modal-actions .kts-btn {
  flex: 1;
  padding: 0.875rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.kts-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.kts-btn-secondary:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.kts-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

/* Processing Modal Styling */
.kts-processing-modal {
  padding: 3rem 2rem;
  text-align: center;
}

.kts-processing-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 1.5rem 0 0.5rem 0;
}

.kts-processing-content p {
  color: #6b7280;
  margin: 0 0 2rem 0;
}

/* Loading Spinner */
.kts-loading-spinner {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.kts-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid var(--kts-primary);
  border-radius: 50%;
  animation: kts-spin 1s linear infinite;
}

@keyframes kts-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Processing Steps */
.kts-processing-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  max-width: 280px;
  margin: 0 auto;
}

.kts-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f9fafb;
  transition: all 0.3s ease;
}

.kts-step i {
  width: 20px;
  color: #d1d5db;
  transition: color 0.3s ease;
}

.kts-step span {
  color: #6b7280;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.kts-step.active {
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.kts-step.active i {
  color: var(--kts-primary);
}

.kts-step.active span {
  color: #1f2937;
  font-weight: 500;
}

.kts-step.completed {
  background: #f0fdf4;
  border: 1px solid #dcfce7;
}

.kts-step.completed i {
  color: #16a34a;
}

.kts-step.completed span {
  color: #166534;
}

/* Form Control Enhancements */
.kts-form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  background: #fafafa;
  transition: all 0.2s ease;
}

.kts-form-control:focus {
  outline: none;
  border-color: var(--kts-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.kts-form-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: block;
}

/* Withdrawal Summary Enhancements */
.kts-withdraw-summary {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.kts-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.kts-summary-item:last-child {
  border-bottom: none;
}

.kts-summary-total {
  background: #eff6ff;
  margin: 1rem -1.5rem -1.5rem -1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 0 0 12px 12px;
  font-weight: 600;
  color: var(--kts-primary);
}

/* Professional Error Notification */
.kts-error-notification {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  animation: kts-error-slide-down 0.3s ease-out;
}

@keyframes kts-error-slide-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kts-error-content {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  gap: 0.75rem;
}

.kts-error-icon {
  color: #dc2626;
  font-size: 1.25rem;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.kts-error-text {
  flex: 1;
}

.kts-error-title {
  font-size: 1rem;
  font-weight: 600;
  color: #991b1b;
  margin: 0 0 0.25rem 0;
}

.kts-error-message {
  font-size: 0.875rem;
  color: #7f1d1d;
  margin: 0;
  line-height: 1.4;
}

.kts-error-close {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.kts-error-close:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* Professional Refresh Button */
.kts-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.kts-card-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.kts-refresh-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  position: relative;
  overflow: hidden;
}

.kts-refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.kts-refresh-btn:active {
  transform: translateY(0);
}

.kts-refresh-icon {
  color: white;
  font-size: 1rem;
  transition: transform 0.6s ease;
}

.kts-refresh-btn.refreshing .kts-refresh-icon {
  animation: kts-refresh-spin 1s linear infinite;
}

@keyframes kts-refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.kts-refresh-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s ease;
}

.kts-refresh-btn:hover::before {
  left: 100%;
}

/* Balance Display Enhancement */
.kts-balance-display {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.kts-balance-display.updating {
  background: #eff6ff;
  border-color: #3b82f6;
}

.kts-balance-amount {
  font-size: 1.125rem;
  font-weight: 600;
  color: #059669;
}

/* Professional Modal Styles */
.kts-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.kts-modal.show {
  opacity: 1;
  visibility: visible;
}

.kts-modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
}

.kts-modal.show .kts-modal-content {
  transform: translateY(0) scale(1);
}

.kts-password-modal {
  padding: 2rem;
}

.kts-modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.kts-modal-icon {
  font-size: 2.5rem;
  color: #4f46e5;
  margin-bottom: 1rem;
}

.kts-modal-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
}

.kts-modal-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.kts-modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.kts-modal-actions .kts-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
}

.kts-processing-modal {
  padding: 3rem 2rem;
  text-align: center;
}

.kts-processing-content h4 {
  margin: 1.5rem 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.kts-processing-content p {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
}

/* Enhanced Loading Spinner */
.kts-loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.kts-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #4f46e5;
  border-radius: 50%;
  animation: kts-spin 1s linear infinite;
}

@keyframes kts-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Form Error Styling */
.kts-form-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  display: none;
}

.kts-form-error.show {
  display: block;
  animation: kts-error-slide-in 0.3s ease;
}

@keyframes kts-error-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Modal Adjustments */
@media (max-width: 640px) {
  .kts-modal-content {
    width: 95%;
    margin: 1rem;
    border-radius: 12px;
  }
  
  .kts-password-modal,
  .kts-processing-modal {
    padding: 1.5rem;
  }
  
  .kts-modal-actions {
    flex-direction: column;
  }
  
  .kts-processing-steps {
    max-width: 100%;
  }
  
  .kts-error-content {
    padding: 0.75rem;
  }
  
  .kts-error-title {
    font-size: 0.9rem;
  }
  
  .kts-error-message {
    font-size: 0.8rem;
  }
  
  .kts-refresh-btn {
    width: 36px;
    height: 36px;
  }
  
  .kts-refresh-icon {
    font-size: 0.9rem;
  }
}
.kts-tx-compact .kts-tx-device-type-bar {
  padding: 0;
  margin: 0;
  gap: 0.25rem;
}

.kts-tx-compact .kts-tx-device-type-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
}

/* Action buttons in a small 2-column grid */
.kts-tx-compact .kts-actions-card {
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.4rem;
  grid-column: 1 / -1; /* place actions on its own full-width row */
  align-items: start;
}

.kts-tx-compact .kts-btn { padding: 0.3rem 0.6rem; font-size: 0.78rem; line-height: 1.15; border-radius: 6px; }
.kts-tx-compact .kts-btn-block { width: 100%; }

/* In actions area, avoid full-width buttons to reduce visual weight */
.kts-tx-compact .kts-actions-card .kts-btn-block { width: auto; }

/* Prevent buttons from stretching tall inside the actions grid */
.kts-tx-compact .kts-actions-card .kts-btn {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.kts-tx-compact .kts-actions-card .kts-btn i { margin-right: 0.1rem; }

/* Larger screens: enforce a neat 12-col grid layout */
@media (min-width: 1024px) {
  .kts-tx-compact .kts-tx-filters {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  /* 1) Device Type: full-width */
  .kts-tx-compact .kts-tx-filters .kts-filter-card:nth-child(1) {
    grid-column: 1 / -1;
  }
  /* 2) Date Range (span 4) */
  .kts-tx-compact .kts-tx-filters .kts-filter-card:nth-child(2) {
    grid-column: span 4;
  }
  /* 3) Search Filters (span 4) */
  .kts-tx-compact .kts-tx-filters .kts-filter-card:nth-child(3) {
    grid-column: span 4;
  }
  /* 4) Transaction Details (span 2) */
  .kts-tx-compact .kts-tx-filters .kts-filter-card:nth-child(4) {
    grid-column: span 2;
  }
  /* 5) Actions (span 2, two buttons side-by-side) */
  .kts-tx-compact .kts-tx-filters .kts-actions-card {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    align-items: start;
  }
}

/* Make device-type chips even smaller */
.kts-tx-compact .kts-tx-device-type-btn { height: 20px; line-height: 1; font-size: 0.68rem; }
.kts-tx-compact .kts-tx-device-type-bar { gap: 0.2rem; }

/* Ensure unselected device type text is visible */
.kts-tx-compact .kts-tx-device-type-btn { background: #f3f4f6; border: 1px solid #e5e7eb; color: var(--kts-text); }
.kts-tx-compact .kts-tx-device-type-btn:hover { background: #e5e7eb; }
.kts-tx-compact .kts-tx-device-type-btn.active { background: var(--kts-primary); color: #fff; border-color: var(--kts-primary); }

/* Table container compact */
.kts-tx-compact .kts-tx-scroll-container {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-bottom: 0.6rem;
}

.kts-tx-compact .kts-tx-table-container { max-height: 48vh; }
.kts-tx-compact .kts-tx-table { min-width: 900px; }

.kts-tx-compact .kts-tx-table th,
.kts-tx-compact .kts-tx-table td {
  padding: 0.26rem 0.36rem;
  font-size: 0.8rem;
  line-height: 1.15;
}

.kts-tx-compact .kts-tx-table thead { background: #fafafa; }

/* Pagination: keep visible and professional in compact layout */
.kts-tx-compact .kts-tx-pagination {
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  min-height: 48px;
}

.kts-tx-compact .kts-tx-page-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
}

/* Withdraw Summary */
.kts-summary-box {
  background: #f7fafd;
  border: 1px solid var(--kts-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
}
.kts-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed #e5e7eb;
  font-size: 0.96rem;
}
.kts-summary-row:last-child { border-bottom: none; }
.kts-summary-row .label { color: #6b7280; font-weight: 500; }
.kts-summary-row .value { font-weight: 700; color: #1f2937; }
.kts-summary-total { 
  margin-top: 0.35rem;
  padding-top: 0.5rem; 
  border-top: 1px solid var(--kts-border);
}
.kts-summary-total .value { font-size: 1.1rem; color: #111827; }
@media (max-width: 600px) {
  .kts-summary-box { padding: 0.6rem 0.75rem; }
  .kts-summary-row { font-size: 0.94rem; }
}

/* Withdraw Page Utilities */
.kts-card-section { margin-top: 0.5rem; }
.kts-card-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.kts-inline-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.kts-inline-title i { color: var(--kts-primary); }
.kts-card-section-body { margin-top: 0.25rem; }
.kts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}
.kts-muted { color: #6b7280; }
.kts-keyvals { display: grid; row-gap: 0.3rem; }
.kts-label { color: #6b7280; }
.kts-flex-between { display: flex; align-items: center; justify-content: space-between; }
.kts-input-group { display: flex; gap: 0.5rem; align-items: center; }
.kts-input-group .kts-input { flex: 1 1 auto; }
.kts-form-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; justify-content: flex-end; }
.kts-text-center { text-align: center; }
.kts-btn-primary { background: var(--kts-primary); color: #fff; }
.kts-section-title { font-size: 0.85rem; margin-bottom: 0.25rem; color: #6b7280; font-weight: 600; }
.kts-hidden { display: none; }

/* Withdrawal History Table Styles */
.kts-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: var(--kts-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kts-history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px; /* Ensures table doesn't shrink below this width */
}

.kts-history-table th,
.kts-history-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--kts-border);
    white-space: nowrap; /* Prevents text wrapping */
}

.kts-history-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.kts-history-table tbody tr:hover {
    background-color: #f9fafb;
}

.kts-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.kts-status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.kts-status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.kts-status-failed {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .kts-table-responsive {
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
    }
    
    .kts-history-table th,
    .kts-history-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Shared Device Summary Card (Dashboard + Withdraw) */
.kts-device-summary-card {
  background: var(--kts-card-bg);
  border-radius: 10px;
  padding: 12px;
  box-shadow: var(--kts-shadow);
  border: 1px solid var(--kts-border);
  border-left: 4px solid var(--kts-primary);
  transition: all 0.3s ease;
  position: relative;
}
.kts-device-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.kts-header-left { display: flex; align-items: center; gap: 10px; }
.kts-header-right { display: flex; align-items: center; gap: 8px; }
.kts-device-summary-header i {
  font-size: 1.1em;
  color: var(--kts-primary);
  background: rgba(35, 102, 168, 0.08);
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.kts-device-name {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 2px;
}
.kts-device-id {
  font-size: 0.85em;
  color: #6b7280;
}
.kts-device-summary-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 10px;
}
.kts-device-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95em;
}
.kts-device-detail span:first-child { color: #6b7280; }

/* Override generic card styles for withdraw page */
.kts-page .kts-device-summary-card {
  padding: 1.25rem !important;
  margin-bottom: 1.5rem !important;
  max-width: none !important;
}

/* Ensure header styles are applied */
.kts-device-summary-header {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--kts-border);
}

/* Device Summary Card - Used in Dashboard and Withdraw Page */
.kts-device-summary-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(35, 102, 168, 0.08);
  border: 1px solid #e9eef3;
  border-left: 4px solid #2366a8;
  margin-bottom: 14px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.kts-device-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.kts-header-left { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}

.kts-header-right { 
  display: flex; 
  flex-direction: column; 
  align-items: flex-end; 
  gap: 4px; 
}

.kts-device-summary-card i {
  font-size: 1.1em;
  color: #2366a8;
  background: rgba(35, 102, 168, 0.08);
  width: 34px; 
  height: 34px; 
  border-radius: 50%;
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
}

.kts-device-name {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 2px;
  font-size: 1.1em;
}

.kts-device-id {
  font-size: 0.85em;
  color: #6b7280;
}

/* Hover effect */
.kts-device-summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Form elements */
.kts-device-summary-card .kts-form-group {
  margin-bottom: 1.5rem;
}

.kts-device-summary-card .kts-input-group {
  gap: 0.75rem;
}