:root {
    --bg: #F5F7FB;
    --sidebar: #101827;
    --sidebar-2: #182235;
    --card: #FFFFFF;
    --card-soft: #F9FAFC;

    --text: #0B1220;
    --muted: #64748B;
    --muted-2: #94A3B8;

    --accent: #F2B84B;
    --accent-2: #FF7A18;
    --blue: #2F80FF;
    --danger: #FF4D4F;
    --success: #22C55E;

    --border: rgba(15, 23, 42, .10);
    --radius: 22px;
    --shadow: 0 12px 34px rgba(15, 23, 42, .08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* LOGIN */

.admin-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top right, rgba(242, 184, 75, .22), transparent 35%),
        radial-gradient(circle at bottom left, rgba(47, 128, 255, .10), transparent 30%),
        #0B1220;
}

.login-card {
    width: min(420px, 92%);
    background: #FFFFFF;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px;
    text-align: center;
    box-shadow: var(--shadow);
}

.login-card img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    background: white;
    border-radius: 50%;
    padding: 8px;
    margin: 0 auto 18px;
    border: 1px solid var(--border);
}

.login-card h1 {
    margin-bottom: 8px;
}

.login-card p {
    color: var(--muted);
    margin-bottom: 24px;
}

.login-card form {
    display: grid;
    gap: 14px;
}

/* FORM ELEMENTS */

input,
select,
textarea {
    width: 100%;
    padding: 15px 17px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #FFFFFF;
    color: var(--text);
    outline: none;
    transition: .2s ease;
    font-size: 15px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(242, 184, 75, .85);
    box-shadow: 0 0 0 4px rgba(242, 184, 75, .18);
}

textarea {
    resize: vertical;
}

/* BUTTONS */

button,
.admin-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #111;
    border: 0;
    border-radius: 999px;
    padding: 13px 22px;
    font-weight: 900;
    cursor: pointer;
    transition: .25s ease;
    box-shadow: 0 12px 26px rgba(255, 122, 24, .18);
}

button:hover,
.admin-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-secondary:hover {
    border-color: rgba(242, 184, 75, .65);
    color: #B76B00;
}

.btn-edit,
.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    transition: .2s ease;
}

.btn-edit {
    background: #EEF5FF;
    color: var(--blue);
}

.btn-delete {
    background: #FFF1F1;
    color: var(--danger);
}

.btn-edit:hover,
.btn-delete:hover {
    transform: translateY(-2px);
}

/* ALERTS */

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert.error {
    background: #FFF1F1;
    color: var(--danger);
    border: 1px solid rgba(255, 77, 79, .22);
}

.alert.success {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid rgba(34, 197, 94, .22);
}

/* LAYOUT */

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
}

/* SIDEBAR */

.sidebar {
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    border-right: 1px solid rgba(255, 255, 255, .08);
    padding: 24px;
    position: sticky;
    top: 0;
    min-height: 100vh;
    box-shadow: 8px 0 34px rgba(15, 23, 42, .18);
    color: #F8FAFC;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.sidebar-logo img {
    width: 52px;
    height: 52px;
    background: white;
    border-radius: 50%;
    padding: 5px;
}

.sidebar-logo h2 {
    font-size: 20px;
    color: #FFFFFF;
}

.sidebar nav {
    display: grid;
    gap: 10px;
}

.sidebar nav a {
    padding: 14px 16px;
    border-radius: 15px;
    color: #CBD5E1;
    font-weight: 700;
    border: 1px solid transparent;
    transition: .25s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: linear-gradient(135deg, #23395F 0%, #2F4778 100%);
    color: #FFFFFF;
    border-color: rgba(242, 184, 75, .35);
    transform: translateX(3px);
}

/* MAIN */

.admin-main {
    padding: 36px;
    min-width: 0;
}

.admin-header {
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1;
    margin-bottom: 10px;
    letter-spacing: -.04em;
    color: var(--text);
}

.admin-header p {
    color: var(--muted);
    font-size: 18px;
}

/* PANELS & CARDS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.stat-card,
.admin-panel,
.form-card,
.dashboard-panel,
.member-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card,
.admin-panel {
    padding: 26px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    transition: .25s ease;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: -44px;
    right: -44px;
    width: 120px;
    height: 120px;
    background: rgba(242, 184, 75, .16);
    border-radius: 50%;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    font-size: 50px;
    margin-top: 12px;
    color: #D97706;
}

.admin-panel h2 {
    margin-bottom: 18px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* TABLES */

.table-wrap {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
    background: var(--card);
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 17px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    color: var(--text);
}

.admin-table th {
    color: var(--muted-2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: var(--card-soft);
}

.admin-table tbody tr {
    transition: .2s ease;
}

.admin-table tbody tr:hover {
    background: #FAFBFD;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* FORMS */

.form-card {
    padding: 30px;
    display: grid;
    gap: 18px;
    max-width: 980px;
    color: var(--text);
}

.form-row {
    display: grid;
    gap: 9px;
}

.form-row label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* THUMBS */

.admin-thumb {
    width: 78px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.preview-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 20px;
    border: 3px solid var(--accent);
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* TEAM */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.member-card {
    padding: 30px;
    position: relative;
    text-align: center;
    transition: .25s ease;
    overflow: hidden;
}

.member-card::before {
    content: "";
    position: absolute;
    top: -38px;
    right: -38px;
    width: 120px;
    height: 120px;
    background: rgba(47, 128, 255, .10);
    border-radius: 50%;
}

.member-card:hover {
    transform: translateY(-5px);
}

.member-position {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #111;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.member-photo {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    margin: 22px auto;
    border: 4px solid var(--accent);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .12);
}

.member-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text);
}

.member-role {
    color: #B76B00;
    font-weight: 800;
    display: block;
    margin-bottom: 18px;
}

.member-phrase {
    color: var(--muted);
    font-style: italic;
    line-height: 1.7;
}

.member-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* DASHBOARD */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    margin-bottom: 34px;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.dashboard-panel {
    padding: 30px;
}

.dashboard-panel h3 {
    margin-bottom: 22px;
    font-size: 24px;
    color: var(--text);
}

.dashboard-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-list li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.dashboard-list span {
    color: var(--muted);
    font-size: 13px;
}

/* USER LIGHT COMPONENTS */

.user-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #071026;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    flex-shrink: 0;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-cell strong {
    display: block;
    color: #071026;
}

.user-cell small {
    display: block;
    color: var(--muted-2);
    margin-top: 4px;
    font-weight: 700;
}

.role-badge {
    display: inline-flex;
    padding: 7px 14px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #071026;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.status-active {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 800;
}

.status-active::before {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
}

/* MOBILE / TABLET */

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        min-height: auto;
        padding: 18px;
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .sidebar-logo {
        margin-bottom: 18px;
    }

    .sidebar nav {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar nav a {
        white-space: nowrap;
        flex: 0 0 auto;
        padding: 12px 14px;
    }

    .sidebar nav a:hover,
    .sidebar nav a.active {
        transform: none;
    }

    .admin-main {
        padding: 24px;
    }

    .stats-grid,
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .admin-main {
        padding: 18px;
    }

    .admin-header {
        margin-bottom: 22px;
    }

    .admin-header h1 {
        font-size: 34px;
    }

    .admin-header p {
        font-size: 15px;
    }

    .quick-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-actions .admin-btn,
    .admin-btn,
    button {
        width: 100%;
    }

    .stats-grid,
    .dashboard-grid,
    .dashboard-panels,
    .cards-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-card,
    .dashboard-panel,
    .member-card,
    .stat-card,
    .admin-panel {
        padding: 22px;
        border-radius: 18px;
    }

    .stat-card strong {
        font-size: 42px;
    }

    .table-wrap {
        border-radius: 18px;
    }

    .admin-table {
        min-width: 760px;
    }

    .admin-table th,
    .admin-table td {
        padding: 14px;
        font-size: 14px;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-edit,
    .btn-delete {
        width: 100%;
    }

    .user-cell {
        min-width: 230px;
    }
}

@media (max-width: 420px) {
    .admin-main {
        padding: 14px;
    }

    .sidebar-logo h2 {
        font-size: 18px;
    }

    .sidebar-logo img {
        width: 46px;
        height: 46px;
    }

    .admin-header h1 {
        font-size: 30px;
    }

    input,
    select,
    textarea {
        padding: 13px 14px;
    }

    .member-photo {
        width: 112px;
        height: 112px;
    }
}

.volver-sitio {
    margin-top: 20px;
    width: 100%;
}

/* RESPONSIVE FIX ADMIN GLOBAL */

@media (max-width: 1024px) {
  body {
    overflow-x: hidden;
  }

  .admin-layout {
    display: block;
    width: 100%;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    position: relative;
    padding: 18px;
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
  }

  .sidebar nav a {
    min-width: max-content;
    white-space: nowrap;
  }

  .admin-main {
    width: 100%;
    padding: 20px;
  }

  .admin-header h1 {
    font-size: 32px;
  }

  .admin-header p {
    font-size: 15px;
  }

  .dashboard-grid,
  .dashboard-panels,
  .cards-grid,
  .form-grid,
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .form-card {
    max-width: 100%;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
  }

  .admin-table {
    min-width: 720px;
  }
}

@media (max-width: 600px) {
  .login-card {
    width: 92%;
    padding: 24px;
  }

  .login-card h1 {
    font-size: 26px;
  }

  .login-card img {
    width: 76px;
    height: 76px;
  }

  input,
  select,
  textarea,
  button,
  .admin-btn,
  .btn-secondary {
    width: 100%;
  }

  .quick-actions {
    flex-direction: column;
    width: 100%;
  }

  .admin-main {
    padding: 16px;
  }

  .admin-header {
    margin-bottom: 22px;
  }

  .admin-header h1 {
    font-size: 28px;
  }

  .stat-card,
  .dashboard-panel,
  .member-card,
  .form-card,
  .admin-panel {
    padding: 20px;
    border-radius: 18px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-edit,
  .btn-delete {
    width: 100%;
    justify-content: center;
  }
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top right, rgba(242, 184, 75, .18), transparent 34%),
        #0B111B;
    transition: opacity .45s ease, visibility .45s ease;
}

.loader-card {
    display: grid;
    place-items: center;
    gap: 18px;
    text-align: center;
    animation: loaderFloat 1.8s ease-in-out infinite;
}

.loader-card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
}

.loader-card p {
    color: #F2B84B;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 13px;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes loaderFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.03);
    }
}