/* ============================================
   Thailand Laser - Admin Dashboard Styles
   ============================================ */

/* Login Screen */
.login-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #1a2332 0%, #004c99 50%, #0066cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 380px;
  max-width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  text-align: center;
}

.login-logo {
  font-size: 24px;
  font-weight: 700;
  color: #0066cc;
}

.login-subtitle {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 25px;
}

.login-card .form-group {
  text-align: left;
  margin-bottom: 16px;
}

.login-card .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.login-card .form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.login-card .form-group input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.login-error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

.login-hint {
  margin-top: 15px;
  font-size: 12px;
  color: #9ca3af;
  padding: 8px;
  background: #f3f4f6;
  border-radius: 6px;
}

.back-to-site {
  display: block;
  margin-top: 15px;
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
}

.back-to-site:hover {
  color: #0066cc;
}

/* Dashboard Layout */
.admin-body {
  background: #f0f2f5;
}

.dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 240px;
  background: #1a2332;
  color: #aabbcc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.admin-sidebar-logo {
  padding: 20px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.admin-sidebar-logo small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #667788;
  margin-top: 2px;
}

.admin-nav {
  flex: 1;
  padding: 15px 0;
  overflow-y: auto;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #8899aa;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.admin-nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.admin-nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.admin-nav-link.active {
  background: rgba(0,102,204,0.2);
  color: #00aeef;
  border-left: 3px solid #00aeef;
}

.admin-sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.back-to-site-link {
  display: block;
  color: #667788;
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 10px;
}

.back-to-site-link:hover {
  color: #fff;
}

.logout-btn {
  width: 100%;
  padding: 8px;
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239,68,68,0.25);
}

/* Main Content */
.admin-main {
  flex: 1;
  margin-left: 240px;
  padding: 0;
}

.admin-topbar {
  background: #fff;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar h1 {
  font-size: 20px;
  font-weight: 600;
  color: #1a2332;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
}

.admin-user-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0066cc, #00aeef);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* Sections */
.admin-section {
  display: none;
  padding: 25px;
}

.admin-section.active {
  display: block;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.stat-blue { background: linear-gradient(135deg, #0066cc, #00aeef); }
.stat-green { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a2332;
}

.stat-name {
  font-size: 13px;
  color: #6b7280;
}

/* Admin Cards */
.admin-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.admin-card h2 {
  font-size: 17px;
  font-weight: 600;
  color: #1a2332;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.card-header h2 {
  margin: 0;
  padding: 0;
  border: none;
}

/* Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f3f4f6;
  color: #4b5563;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  color: #374151;
}

.admin-table tr:hover td {
  background: #f8faff;
}

.empty-state {
  text-align: center;
  color: #9ca3af;
  padding: 30px !important;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.filter-bar select,
.filter-bar input {
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
}

.filter-bar input {
  flex: 1;
}

.filter-bar select {
  width: 200px;
}

/* Action buttons in table */
.action-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 5px;
}

.action-edit {
  background: #dbeafe;
  color: #0066cc;
}

.action-delete {
  background: #fee2e2;
  color: #ef4444;
}

/* Visitor Stats */
.visitor-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 15px;
}

.visitor-stat-box {
  text-align: center;
  padding: 25px;
  background: #f8faff;
  border-radius: 10px;
  border: 1px solid #e0e7ff;
}

.visitor-stat-num {
  font-size: 36px;
  font-weight: 700;
  color: #0066cc;
}

.visitor-stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-top: 5px;
}

/* Settings Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-row .form-group {
  margin-bottom: 15px;
}

.admin-card .form-group {
  margin-bottom: 15px;
}

.admin-card .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.admin-card .form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  background: #f9fafb;
}

.admin-card .form-group input:focus {
  outline: none;
  border-color: #0066cc;
}

.admin-note {
  font-size: 13px;
  color: #6b7280;
  margin-top: 10px;
  padding: 10px;
  background: #fffbeb;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
}

.admin-note code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.pass-message {
  margin-top: 10px;
  font-size: 13px;
  min-height: 18px;
}

.pass-message.success { color: #10b981; }
.pass-message.error { color: #ef4444; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-active {
  background: #d1fae5;
  color: #10b981;
}

.status-pending {
  background: #fef3c7;
  color: #f59e0b;
}

.status-new {
  background: #dbeafe;
  color: #0066cc;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 60px;
    overflow: hidden;
  }
  .admin-sidebar-logo, .admin-nav-link span, .admin-sidebar-footer {
    display: none;
  }
  .admin-main {
    margin-left: 60px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .visitor-stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    flex-direction: column;
  }
  .filter-bar select {
    width: 100%;
  }
}
