/* ===================================================
   GM7 Sistemas — Admin Panel Stylesheet
   =================================================== */

:root {
  --bg: #050a14;
  --bg2: #070d1a;
  --surface: rgba(255,255,255,0.04);
  --surface2: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --cyan: #22D3EE;
  --indigo: #6366F1;
  --indigo2: #4F46E5;
  --text: #F1F5F9;
  --text2: #94A3B8;
  --text3: #64748B;
  --red: #F87171;
  --green: #34D399;
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Inter', 'Segoe UI', Arial, sans-serif;
  --sidebar-w: 220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100%;
  overflow-x: hidden;
}

/* ── LOGIN PAGE ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
}
.login-wrapper::before {
  content: '';
  position: fixed;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: var(--indigo);
  filter: blur(120px);
  opacity: 0.12;
  top: -200px; left: -200px;
  pointer-events: none;
}
.login-wrapper::after {
  content: '';
  position: fixed;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: var(--cyan);
  filter: blur(100px);
  opacity: 0.1;
  bottom: -150px; right: -150px;
  pointer-events: none;
}
.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-mark {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
}
.login-logo h1 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.login-logo p {
  font-size: 0.83rem;
  color: var(--text3);
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  display: block;
  margin-bottom: 6px;
}
.login-form input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--cyan); }
.login-form input::placeholder { color: var(--text3); }
.login-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: var(--font);
}
.login-btn:hover { opacity: 0.88; }
.login-error {
  font-size: 0.83rem;
  color: var(--red);
  text-align: center;
  min-height: 1.2em;
}

/* ── ADMIN LAYOUT ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: var(--sidebar-w);
  background: rgba(255,255,255,0.025);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 10;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-text {
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  padding: 16px 20px 6px;
}
.sidebar-nav {
  list-style: none;
  padding: 0 10px;
  flex: 1;
}
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text2);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}
.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.sidebar-nav-item.active {
  background: linear-gradient(135deg, rgba(34,211,238,0.12), rgba(99,102,241,0.12));
  color: var(--cyan);
  font-weight: 700;
}
.sidebar-nav-item .nav-icon { font-size: 1rem; flex-shrink: 0; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: none;
  border: 1px solid rgba(248,113,113,0.2);
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.sidebar-logout:hover { background: rgba(248,113,113,0.08); }

/* ── ADMIN MAIN ── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.admin-header {
  position: sticky;
  top: 0;
  background: rgba(5,10,20,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 5;
}
.admin-header-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text2);
}
.admin-header-title span { color: var(--text); }
.admin-content {
  padding: 28px;
  flex: 1;
}

/* ── TAB PANELS ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.panel-sub {
  font-size: 0.88rem;
  color: var(--text3);
  margin-bottom: 28px;
}

/* ── FORM ELEMENTS ── */
.form-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.form-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1/-1; }
.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
}
.form-group input,
.form-group textarea,
.form-group select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--cyan); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text3); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group select { cursor: pointer; }
.form-group select option { background: var(--bg2); }
.form-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text2);
}
.toggle-switch {
  width: 38px; height: 20px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
}
input[type="checkbox"]:checked + .toggle-switch {
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
}
input[type="checkbox"]:checked + .toggle-switch::after {
  transform: translateX(18px);
}
input[type="checkbox"] { display: none; }

/* Image upload */
.img-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.img-upload-area:hover {
  border-color: var(--cyan);
  background: rgba(34,211,238,0.04);
}
.img-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%; height: 100%;
  border: none; padding: 0;
  background: transparent;
}
.img-preview {
  max-width: 200px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 8px;
  margin: 0 auto 8px;
  display: none;
}
.img-preview.show { display: block; }
.img-upload-label {
  font-size: 0.82rem;
  color: var(--text3);
}
.img-upload-label span { color: var(--cyan); font-weight: 600; }

/* ── BUTTONS ── */
.btn-save {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.2s;
}
.btn-save:hover { opacity: 0.88; }
.btn-save:disabled { opacity: 0.5; cursor: default; }
.btn-add {
  padding: 8px 18px;
  background: rgba(34,211,238,0.1);
  border: 1px solid rgba(34,211,238,0.3);
  border-radius: 7px;
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.btn-add:hover { background: rgba(34,211,238,0.18); }
.btn-delete {
  padding: 6px 12px;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 6px;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.btn-delete:hover { background: rgba(248,113,113,0.2); }
.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}
.save-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.save-status {
  font-size: 0.82rem;
  color: var(--green);
  min-height: 1.2em;
}
.save-status.err { color: var(--red); }

/* ── SERVICE CARD EDITOR ── */
.service-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.service-editor-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
}
.service-editor-card .card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* ── TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 12px;
  font-size: 0.875rem;
  color: var(--text2);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table td:first-child { color: var(--text); font-weight: 600; }
.table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}
.table-empty {
  text-align: center;
  color: var(--text3);
  padding: 32px;
  font-size: 0.88rem;
}
.table-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* Add testimonial form */
.add-form {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 20px;
}
.add-form-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 14px;
}

/* Badge */
.badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.badge-cyan { background: rgba(34,211,238,0.12); color: var(--cyan); }
.badge-green { background: rgba(52,211,153,0.12); color: var(--green); }
.badge-red { background: rgba(248,113,113,0.12); color: var(--red); }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(20,30,50,0.97);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.875rem;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.ok { border-color: rgba(52,211,153,0.3); color: var(--green); }
.toast.err { border-color: rgba(248,113,113,0.3); color: var(--red); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.4); border-radius: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-main { margin-left: 0; }
  .service-editor-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
