/* ==========================================================================
   PANEL ADMINISTRATIVO & CMS - MINERA MH SAC
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --ruby-950: #46040f;
  --ruby-900: #5f0617;
  --ruby-800: #7a081d;
  --ruby-700: #9b112e;
  --ruby-50: #fdf2f4;
  --gold-500: #d4af37;
  --gold-400: #e4b936;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.15);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--slate-50);
  color: var(--slate-700);
  min-height: 100vh;
  line-height: 1.55;
}

a {
  color: var(--ruby-800);
  text-decoration: none;
}

a:hover {
  color: var(--ruby-900);
}

/* ---------- Login Page ---------- */
.admin-login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px 16px;
  background: 
    linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(95, 6, 23, 0.85) 100%),
    url('../../assets/images/fondo.png') center/cover no-repeat;
}

.login-card {
  width: min(350px, 100%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  height: 60px;
  width: auto;
  margin: 0 auto 16px;
  object-fit: contain;
}

.login-card h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--ruby-800);
  margin-bottom: 6px;
}

.login-sub {
  font-size: 0.875rem;
  color: var(--slate-600);
  margin-bottom: 24px;
}
.eye-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666; /* Color del icono */
}
/* Fuerza a que el texto no se desborde y use el tamaño del icono */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;  /* Ajusta el tamaño que desees */
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  
  /* Truco: Si no carga la fuente, el texto plano no se verá gigante ni romperá el diseño */
  font-size: 20px;
  width: 24px;
  overflow: hidden;
}

/* Oculta duplicados nativos en Microsoft Edge */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}


.floating-field {
  display: block;
  text-align: left;
  margin-bottom: 18px;
}

.floating-field span {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.floating-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--slate-900);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.floating-field input:focus {
  outline: 0;
  border-color: var(--ruby-800);
  box-shadow: 0 0 0 3px rgba(122, 8, 29, 0.12);
}

.login-card button[type="submit"] {
  width: 100%;
  padding: 13px;
  background: var(--ruby-800);
  color: var(--white);
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
  transition: background 0.2s, transform 0.2s;
}

.login-card button[type="submit"]:hover {
  background: var(--ruby-900);
  transform: translateY(-1px);
}

.forgot-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--slate-600);
}

.forgot-link:hover {
  color: var(--ruby-800);
  text-decoration: underline;
}

.form-error {
  background: #fdecec;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 18px;
  text-align: left;
}

.form-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 18px;
  text-align: left;
}

/* ---------- Admin Topbar ---------- */
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.admin-topbar-inner {
  width: min(1140px, calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.topbar-brand img {
  height: 48px;
  width: auto;
}

.profile-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ruby-800);
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  right: 0;
  width: 370px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
}

.profile-card div{
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--slate-100);
}

.profile-card dt {
  color: var(--slate-500);
}

.profile-card dd {
  font-weight: 600;
  color: var(--slate-800);
}

.profile-dropdown a {
  display: block;
  margin-top: 12px;
  padding-top: 8px;
  text-align: center;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Admin Main Content ---------- */
.admin-main {
  width: min(1140px, calc(100% - 32px));
  margin: 36px auto 64px;
  justify-content: space-between;
}
.admin-main-header {
  justify-content: space-between;
  color: var(--ruby-700);
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-head h1 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  color: var(--ruby-800);
}

.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--ruby-800);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.2s;
}

.btn-admin:hover {
  background: var(--ruby-900);
  transform: translateY(-1px);
}

/* Tables */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: var(--slate-100);
  padding: 14px 20px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-700);
  border-bottom: 1px solid var(--slate-200);
}

.admin-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
  font-size: 0.95rem;
  color: var(--slate-800);
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table tr:hover td {
  background: var(--slate-50);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-publicado {
  background: #f0fdf4;
  color: #16a34a;
}

.badge-borrador {
  background: #fefce8;
  color: #ca8a04;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-actions a {
  font-weight: 600;
  color: var(--ruby-800);
}

.link-danger {
  background: transparent;
  border: 0;
  color: #dc2626;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

.link-danger:hover {
  text-decoration: underline;
}

/* Forms */
.admin-form {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.admin-form label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-800);
  margin-top: 18px;
  margin-bottom: 6px;
}

.admin-form label:first-of-type {
  margin-top: 0;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--slate-900);
  background: var(--white);
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: 0;
  border-color: var(--ruby-800);
  box-shadow: 0 0 0 3px rgba(122, 8, 29, 0.1);
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-preview {
  max-width: 220px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  border: 1px solid var(--slate-200);
}

.volver {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--slate-600);
  font-weight: 600;
}

.volver:hover {
  color: var(--ruby-800);
}
