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

body {
  font-family: 'Segoe UI', sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
}

/* LOGIN */
#loginScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 48px 40px;
  width: 340px;
  text-align: center;
}

.login-box h1 { font-size: 24px; margin-bottom: 8px; }
.login-box p  { color: #888; margin-bottom: 32px; font-size: 14px; }

.login-box input {
  width: 100%;
  padding: 12px 16px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  margin-bottom: 12px;
  outline: none;
}

.login-box input:focus { border-color: #555; }

.login-box button {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 600;
}

.login-box button:hover { background: #1d4ed8; }
.error { color: #ef4444; font-size: 13px; margin-top: 10px; }

/* HEADER */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  flex-wrap: wrap;
  gap: 12px;
}

header h1 { font-size: 20px; }

.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

button { cursor: pointer; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600; }

.btn-danger    { background: #7f1d1d; color: #fca5a5; }
.btn-danger:hover { background: #991b1b; }
.btn-success   { background: #14532d; color: #86efac; }
.btn-success:hover { background: #166534; }
.btn-secondary { background: #27272a; color: #a1a1aa; }
.btn-secondary:hover { background: #3f3f46; }
.btn-block     { background: #7f1d1d; color: #fca5a5; font-size: 12px; padding: 6px 12px; }
.btn-unblock   { background: #14532d; color: #86efac; font-size: 12px; padding: 6px 12px; }

/* SUMMARY */
.summary {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  flex-wrap: wrap;
}

.summary-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px 24px;
  min-width: 140px;
  text-align: center;
  flex: 1;
}

.summary-card span  { display: block; font-size: 36px; font-weight: 700; }
.summary-card label { font-size: 12px; color: #888; margin-top: 4px; display: block; }
.summary-card.green span { color: #4ade80; }
.summary-card.blue  span { color: #60a5fa; }
.summary-card.red   span { color: #f87171; }

/* DATE FILTER */
.date-filter {
  padding: 0 24px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #888;
}

.date-filter input {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  padding: 6px 12px;
  font-size: 14px;
  outline: none;
}

/* TABLE */
.table-wrap {
  padding: 0 24px 40px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: #1a1a1a;
  color: #888;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #2a2a2a;
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid #1f1f1f; }
tbody tr:hover { background: #1a1a1a; }

tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  white-space: nowrap;
}

.store-id   { font-weight: 700; font-size: 15px; }
.badge-active   { background: #14532d; color: #86efac; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.badge-blocked  { background: #7f1d1d; color: #fca5a5; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.badge-inactive { background: #27272a; color: #a1a1aa;  padding: 3px 10px; border-radius: 20px; font-size: 12px; }

.num { font-weight: 700; color: #60a5fa; }
.num-zero { color: #444; }
.device  { color: #888; font-size: 12px; }
.version { color: #a78bfa; font-size: 12px; }

.loading { text-align: center; color: #555; padding: 40px; }

.btn-perms { background: #1e3a5f; color: #93c5fd; font-size: 12px; padding: 6px 12px; }
.btn-perms:hover { background: #1e40af; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}

.modal-box {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h2 { font-size: 17px; }

.modal-close {
  background: none;
  color: #888;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { background: #2a2a2a; color: #fff; }

.modal-subtitle {
  font-size: 13px;
  color: #666;
  padding: 8px 24px 16px;
  border-bottom: 1px solid #2a2a2a;
}

.perm-list {
  overflow-y: auto;
  padding: 8px 0;
  flex: 1;
}

.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid #1f1f1f;
  transition: background 0.15s;
}
.perm-row:hover { background: #222; }

.perm-info { display: flex; align-items: center; gap: 12px; }
.perm-icon { font-size: 20px; width: 28px; text-align: center; }
.perm-name { font-size: 14px; font-weight: 600; }
.perm-desc { font-size: 12px; color: #666; margin-top: 2px; }

/* Toggle switch */
.toggle { position: relative; width: 48px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #333;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: #16a34a; }
.toggle input:checked + .toggle-slider:before { transform: translateX(22px); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #2a2a2a;
}
