@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --bg-main: #0c0e14;
  --bg-card: rgba(22, 27, 39, 0.75);
  --bg-card-hover: rgba(30, 38, 56, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(13, 202, 240, 0.4);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-cyan: #0dcaf0;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --glass-blur: blur(14px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(13, 202, 240, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(245, 158, 11, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Header & Top Bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 14, 20, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  font-size: 26px;
  color: var(--accent-gold);
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.actions-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  max-width: 680px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex-grow: 1;
  min-width: 180px;
  max-width: 300px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px 8px 34px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(13, 202, 240, 0.2);
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #000;
}
.btn-primary:hover {
  background: #38d9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 202, 240, 0.3);
}

.btn-warning {
  background: #f59e0b;
  color: #000;
}
.btn-warning:hover {
  background: #fbbf24;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-success {
  background: #10b981;
  color: #fff;
}
.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Service Grid */
.main-content {
  padding: 30px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 28px 20px;
  justify-items: center;
}

.service-card {
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.service-card:hover {
  transform: translateY(-4px);
}

.service-logo-box {
  width: 72px;
  height: 72px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.service-card:hover .service-logo-box {
  border-color: var(--accent-cyan);
  box-shadow: 0 6px 24px rgba(13, 202, 240, 0.25);
}

.service-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-count-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: #f59e0b;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.service-title {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  color: #e5e7eb;
  line-height: 1.3;
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: #141721;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 20px 16px;
  justify-items: center;
}

.account-card {
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.account-logo-box {
  width: 54px;
  height: 54px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.account-logo-box:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(13, 202, 240, 0.3);
}

.account-label {
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
  color: #d1d5db;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.account-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.btn-mini {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-mini-info {
  background: rgba(13, 202, 240, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(13, 202, 240, 0.3);
}
.btn-mini-info:hover {
  background: var(--accent-cyan);
  color: #000;
}

.btn-mini-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.3);
}
.btn-mini-success:hover {
  background: var(--accent-green);
  color: #fff;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 48px);
}

.toast {
  background: #1e2433;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-cyan);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.success { border-left-color: var(--accent-green); }
.toast.error { border-left-color: var(--accent-red); }
.toast.warning { border-left-color: var(--accent-gold); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .top-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }
  .actions-section {
    max-width: 100%;
    justify-content: space-between;
  }
  .main-content {
    padding: 20px 16px;
  }
}
