* { box-sizing: border-box; }
:root {
  --bg:#0b0c0f; --card:#14171c; --text:#e7ebf3; --muted:#aab3c5; --accent:#0b6cff; --danger:#ff4d4f; --success:#2ecc71;
  --bg-light:#f5f7fa; --card-light:#ffffff; --text-light:#0f172a; --muted-light:#475569; --accent-light:#3b82f6; --border-light:#e2e8f0;
  --success-light:#10b981; --warning-light:#f59e0b; --danger-light:#ef4444;
}

/* Dark mode (default) */
html, body { margin:0; padding:0; background:var(--bg); color:var(--text); font-family: "Wix Madefor Text", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; }

/* Light mode */
html[data-theme="light"] body {
  background:var(--bg-light); color:var(--text-light);
}

html[data-theme="light"] .topbar {
  background: #f8f9fa; border-bottom:1px solid #dee2e6;
}

html[data-theme="light"] .card {
  background: var(--card-light); border:1px solid #dee2e6;
}

html[data-theme="light"] .footer {
  background: #f8f9fa; border-top:1px solid #dee2e6; color: var(--muted-light);
}

html[data-theme="light"] .alert-error {
  background: rgba(220,53,69,.1); border:1px solid rgba(220,53,69,.35);
}

html[data-theme="light"] .alert-success {
  background: rgba(25,135,84,.1); border:1px solid rgba(25,135,84,.35);
}

html[data-theme="light"] .properties-table thead {
  background: rgba(0,0,0,.02); border-bottom: 1px solid #dee2e6;
}

html[data-theme="light"] .properties-table tbody tr {
  border-bottom: 1px solid #dee2e6;
}

html[data-theme="light"] .properties-table tbody tr:hover {
  background: rgba(0,0,0,.02);
}

html[data-theme="light"] .status-card {
  background: var(--card-light); border:1px solid #dee2e6;
}

html[data-theme="light"] .status-card.success {
  border-color: rgba(25,135,84,.35); background: rgba(25,135,84,.05);
}

html[data-theme="light"] .status-card.error {
  border-color: rgba(220,53,69,.35); background: rgba(220,53,69,.05);
}

html[data-theme="light"] .status-card.info {
  border-color: rgba(11,108,255,.35); background: rgba(11,108,255,.05);
}

html[data-theme="light"] .controls-card {
  background: var(--card-light); border:1px solid #dee2e6;
}

html[data-theme="light"] .controls-header {
  border-bottom: 1px solid #dee2e6;
}

html[data-theme="light"] .modal-content {
  background: var(--card-light); border:1px solid #dee2e6;
}

html[data-theme="light"] .form-input {
  border:1px solid #ced4da; background: #ffffff; color:var(--text-light);
}

html[data-theme="light"] .filter-select {
  border:1px solid #ced4da; background: #ffffff; color:var(--text-light);
}

html[data-theme="light"] .search-input {
  border:1px solid #ced4da; background: #ffffff; color:var(--text-light);
}

html[data-theme="light"] .toggle-slider {
  background-color: #6c757d;
}

html[data-theme="light"] .checkbox {
  border: 2px solid #ced4da; background: #ffffff;
}

html[data-theme="light"] .sortable:hover {
  background: rgba(0,0,0,.05);
}

html[data-theme="light"] .table-footer {
  background: rgba(0,0,0,.02); border-top: 1px solid #dee2e6; color: var(--muted-light);
}

html[data-theme="light"] .bulk-actions {
  background: rgba(11,108,255,.05); border-bottom: 1px solid #dee2e6;
}

/* Theme Toggle Styles */
.theme-toggle {
  display: flex;
  align-items: center;
}

#theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

#theme-toggle-btn:hover {
  transform: none;
}

.theme-icon {
  font-size: 1rem;
}

.container { width: min(1200px, 92%); margin: 0 auto; }
.flex-between { display:flex; align-items:center; justify-content:space-between; gap:16px; }

.topbar {
  background: #0f1116;
  border-bottom:1px solid #1f2530;
  /* height: 66px; */
  padding: 0;
  display: flex;
  align-items: center;
}

.tool-selector-compact {
  position: relative;
  display: inline-block;
  margin-left: 8px;
}

.tool-selector-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
  transition: all 0.2s ease;
  border: 1px dotted #5a5a5a;
}

.tool-selector-button svg {
  flex-shrink: 0;
}

.tool-select-compact {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.tool-selector-compact:hover .tool-selector-button {
  color: var(--text);
  background: rgba(255,255,255,.05);
}

html[data-theme="light"] .tool-selector-button {
  color: var(--muted-light);
}

html[data-theme="light"] .tool-selector-compact:hover .tool-selector-button {
  color: var(--text-light);
  background: rgba(0,0,0,.05);
}

.topbar .brand {
  font-weight:700;
  letter-spacing:.3px;
  display: flex;
  align-items: center;
}

.topbar .brand img {
  height: 48px;
  width: auto;
  max-width: 200px;
  margin: .5rem 0;
}

.topbar .nav .nav-link {
  color: var(--muted);
  text-decoration: none;
  margin-left: 0px;
  padding: 8px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.topbar .nav .nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
}

.topbar .nav .nav-link.active {
  color: var(--accent);
  background: rgba(11, 108, 255, 0.1);
}

.topbar .nav .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

html[data-theme="light"] .topbar .nav .nav-link {
  color: var(--muted-light);
}

html[data-theme="light"] .topbar .nav .nav-link:hover {
  color: var(--text-light);
  background: rgba(0,0,0,.05);
}

html[data-theme="light"] .topbar .nav .nav-link.active {
  color: var(--accent-light);
  background: rgba(59, 130, 246, 0.1);
}

.topbar .nav .inline {
  display:inline;
}

.topbar .linklike {
  background:none;
  border:none;
  color:var(--text);
  cursor:pointer;
  margin-left:16px;
  line-height: 70px;
}

.topbar .linklike:hover {
  color:var(--accent);
}

main.container { padding: 15px 0 48px; }

.card { background: var(--card); border:1px solid #222937; border-radius: 10px; padding: 20px; margin-bottom: 10px; }
.card-narrow { max-width: 420px; margin: 40px auto; }

label { display:block; margin: 10px 0; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url] { width:100%; padding:10px 12px; border-radius:8px; border:1px solid #2a3242; background:#0f1218; color:var(--text); }

button { background: var(--accent); border:none; color:white; padding:10px 16px; border-radius:8px; cursor:pointer; }
button:hover { filter: brightness(1.1); }

.actions { margin-top: 12px; display:flex; gap:12px; }

.alert { padding: 12px 14px; border-radius: 8px; margin: 10px 0; }
.alert-error { background: rgba(255,77,79,.1); border:1px solid rgba(255,77,79,.35); }
.alert-success { background: rgba(46,204,113,.1); border:1px solid rgba(46,204,113,.35); }

.grid-2 { display:grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.grid-3 { display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .grid-3 { grid-template-columns: 1fr; } }

.grid-4 { display:grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1010px) { .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.footer { border-top:1px solid #1f2530; padding: 18px 0; color: var(--muted); background:#0f1116; }

.chart-container {
  width: 100%;
  height: 400px;
  margin: 20px 0;
  border-radius: 8px;
  background: var(--card);
  padding: 20px;
}

/* Properties Management Styles */
.properties-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 20px;
}

.properties-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}

.properties-header p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
}

.btn-danger {
  background: var(--danger);
}

.btn-secondary {
  background: #4a5568;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Status Cards */
.status-card {
  background: var(--card);
  border: 1px solid #222937;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-card.success {
  border-color: rgba(46,204,113,.35);
  background: rgba(46,204,113,.05);
}

.status-card.error {
  border-color: rgba(255,77,79,.35);
  background: rgba(255,77,79,.05);
}

.status-card.info {
  border-color: rgba(11,108,255,.35);
  background: rgba(11,108,255,.05);
}

.status-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.status-content {
  flex: 1;
}

.status-content h4 {
  margin: 0 0 4px 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.status-content p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Search and Filter Controls */
.controls-card {
  background: var(--card);
  border: 1px solid #222937;
  border-radius: 10px;
  margin-bottom: 24px;
}

.controls-header {
  padding: 20px;
  border-bottom: 1px solid #222937;
}

.controls-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.search-wrapper {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  border-radius: 8px;
  border: 1px solid #2a3242;
  background: #0f1218;
  color: var(--text);
  font-size: 0.9rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11,108,255,.1);
}

.filter-select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2a3242;
  background: #0f1218;
  color: var(--text);
  font-size: 0.9rem;
  min-width: 160px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11,108,255,.1);
}

/* Bulk Actions */
.bulk-actions {
  padding: 16px 20px;
  background: rgba(11,108,255,.05);
  border-bottom: 1px solid #222937;
  display: none;
}

.bulk-actions.show {
  display: flex;
}

.bulk-actions-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.bulk-count {
  font-size: 0.9rem;
  color: var(--muted);
}

.bulk-buttons {
  display: flex;
  gap: 8px;
}

/* Properties Table */
.properties-table {
  width: 100%;
  border-collapse: collapse;
}

.properties-table thead {
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid #222937;
}

.properties-table th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.properties-table tbody tr {
  border-bottom: 1px solid #1a1f2b;
  transition: background-color 0.2s ease;
}

.properties-table tbody tr:hover {
  background: rgba(255,255,255,.02);
}

.properties-table td {
  padding: 16px 18px;
  vertical-align: middle;
}

.property-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.property-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.property-url {
  font-size: 0.85rem;
  color: var(--muted);
  font-family: 'Monaco', 'Menlo', monospace;
}

/* Toggle Switch */
.toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #4a5568;
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle input:checked + .toggle-slider,
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--success);
}

.toggle input:checked + .toggle-slider:before,
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* Checkboxes */
.checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #2a3242;
  border-radius: 4px;
  background: #0f1218;
  cursor: pointer;
  position: relative;
}

.checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

/* Sortable Headers */
.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color 0.2s ease;
}

.sortable:hover {
  background: rgba(255,255,255,.05);
}

.sort-icon {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.sortable:hover .sort-icon {
  opacity: 1;
}

.sortable.sort-asc .sort-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.sortable.sort-desc .sort-icon {
  opacity: 1;
  transform: rotate(180deg);
}

/* Action Buttons */
.action-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: rgba(11,108,255,.1);
  color: var(--text);
}

/* Table Footer */
.table-footer {
  padding: 16px 20px;
  background: rgba(255,255,255,.02);
  border-top: 1px solid #222937;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--muted);
  opacity: 0.6;
}

.empty-state h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--card);
  border: 1px solid #222937;
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  margin-bottom: 20px;
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.modal-body {
  margin-bottom: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Elements */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2a3242;
  background: #0f1218;
  color: var(--text);
  font-size: 0.9rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11,108,255,.1);
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .properties-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .bulk-actions-content {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .properties-table {
    font-size: 0.85rem;
  }
  
  .properties-table th,
  .properties-table td {
    padding: 12px 16px;
  }
}
