/* PearlMiner Web Management Panel - Modern Dark Responsive CSS */
:root {
  --bg-primary: #0b0f19;
  --bg-surface: #111827;
  --bg-card: #1f2937;
  --bg-input: #151d2c;
  --border-color: #374151;
  --border-focus: #3b82f6;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* Navbar */
.navbar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
}
.nav-brand:hover {
  text-decoration: none;
}
.nav-brand span.logo-icon {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.95rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
}
.badge-admin {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid #8b5cf6;
}
.badge-user {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid #3b82f6;
}
.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid #10b981;
}
.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid #ef4444;
}
.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid #f59e0b;
}

/* Main Container */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1rem;
  flex: 1;
}

/* Cards */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #f9fafb;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #d1d5db;
  margin-bottom: 0.4rem;
}
.label-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.25rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
textarea {
  resize: vertical;
  min-height: 75px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}
.btn-success {
  background-color: var(--success);
  color: white;
}
.btn-success:hover {
  background-color: var(--success-hover);
}
.btn-danger {
  background-color: var(--danger);
  color: white;
}
.btn-danger:hover {
  background-color: var(--danger-hover);
}
.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: #374151;
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.775rem;
}
.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  background-color: rgba(31, 41, 55, 0.6);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1f2937;
  font-size: 0.875rem;
}
tr:hover td {
  background-color: rgba(31, 41, 55, 0.4);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text-main);
}
.tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  font-weight: 600;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Download Hero Card */
.download-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.download-card-info h3 {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
  color: #ffffff;
}
.download-card-info p {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 650px;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 520px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.modal-header h3 {
  font-size: 1.15rem;
  color: #fff;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close:hover {
  color: #fff;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  color: var(--text-main);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  min-width: 260px;
  max-width: 400px;
  animation: slideIn 0.25s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.toast-success {
  border-left: 4px solid var(--success);
}
.toast-error {
  border-left: 4px solid var(--danger);
}
.toast-info {
  border-left: 4px solid var(--primary);
}
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Online Indicator Dot */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.dot-green {
  background-color: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}
.dot-gray {
  background-color: var(--text-muted);
}

/* Alert boxes */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}
.alert-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.alert-success {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* Center auth cards */
.auth-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow);
}
.auth-title {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-title h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.auth-title p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: auto;
}
