@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --navy: #17233c;
    --navy-light: #243653;
    --gold: #c7a66a;
    --gold-light: #e5d1a7;
    --text: #263247;
    --muted: #7d8797;
    --border: #e9edf2;
    --background: #f5f7fa;
    --white: #fff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
}

a { text-decoration: none; }

/* ACCESO */
.login-page {
    min-height: 100vh;
    background: #f5f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px;
}

.login-wrapper {
    width: min(1050px, 100%);
    min-height: 620px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(23,35,60,.12);
}

.login-brand {
    position: relative;
    overflow: hidden;
    padding: 65px 55px;
    color: white;
    background:
        radial-gradient(circle at 85% 15%, rgba(199,166,106,.25), transparent 34%),
        linear-gradient(145deg, #17233c, #263b5a);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand:after {
    content: '';
    position: absolute;
    width: 370px;
    height: 370px;
    right: -190px;
    bottom: -190px;
    border: 1px solid rgba(229,209,167,.25);
    border-radius: 50%;
    box-shadow: 0 0 0 35px rgba(229,209,167,.035), 0 0 0 75px rgba(229,209,167,.025);
}

.brand-symbol {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    margin-bottom: 35px;
}

.brand-overline, .eyebrow, .welcome-kicker {
    letter-spacing: 2.3px;
    font-size: 10px;
    font-weight: 800;
}

.brand-overline { color: var(--gold-light); }

.login-brand h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(36px, 4vw, 49px);
    line-height: 1.17;
    font-weight: 600;
    margin: 12px 0 20px;
}

.brand-description {
    color: #c4cbd6;
    line-height: 1.8;
    max-width: 330px;
    font-size: 14px;
}

.brand-footer {
    position: absolute;
    bottom: 35px;
    color: var(--gold-light);
    font-size: 10px;
    letter-spacing: 3px;
    font-weight: 700;
}

.login-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 55px;
}

.login-content { width: 100%; max-width: 355px; }
.mobile-brand { display: none; }

.login-content .eyebrow { color: #ad8b50; margin-bottom: 12px; }
.login-content h2 { font-size: 29px; margin: 0 0 8px; color: var(--navy); }
.muted { color: var(--muted); font-size: 13px; margin: 0 0 32px; }

.login-content label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin: 20px 0 9px;
}

.login-content input {
    width: 100%;
    height: 49px;
    padding: 0 14px;
    border: 1px solid #dfe4eb;
    border-radius: 7px;
    background: #fbfcfd;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: .2s;
}

.login-content input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(199,166,106,.13);
}

.btn-primary {
    width: 100%;
    height: 49px;
    margin-top: 28px;
    border: 0;
    border-radius: 7px;
    background: var(--navy);
    color: white;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.btn-primary:hover { background: #293d5e; }
.btn-primary span { margin-left: 8px; color: var(--gold-light); }

.login-note {
    color: #929baa;
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
    margin-top: 28px;
}

.alert {
    padding: 12px 14px;
    border-radius: 7px;
    font-size: 12px;
    margin: 18px 0;
}
.alert-error { background: #fff0ef; color: #a83d36; border: 1px solid #f4d4d1; }

/* PANEL */
.admin-page { min-height: 100vh; background: var(--background); }

.sidebar {
    width: 255px;
    position: fixed;
    inset: 0 auto 0 0;
    background: var(--navy);
    color: white;
    padding: 27px 19px;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0 7px 36px;
}

.sidebar-brand b { color: var(--gold-light); }
.brand-symbol.small {
    width: 38px;
    height: 38px;
    margin: 0;
    font-size: 23px;
}

.sidebar-label {
    color: #8996a9;
    font-size: 9px;
    letter-spacing: 1.7px;
    font-weight: 800;
    padding: 0 10px;
    margin-bottom: 13px;
}

.side-link {
    min-height: 45px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 6px;
    color: #c3cbd7;
    font-size: 12px;
    margin-bottom: 5px;
}

.side-link > span { width: 18px; text-align: center; font-size: 16px; }
.side-link.active { background: #2c3c58; color: white; }
.side-link.disabled { opacity: .48; cursor: default; }
.side-link small { margin-left: auto; font-size: 8px; }

.sidebar-bottom { margin-top: auto; }
.sidebar-user {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 20px 3px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #3b4e6d;
    color: var(--gold-light);
    font-weight: 700;
}
.sidebar-user-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sidebar-user-info strong { font-size: 11px; overflow-wrap: anywhere; }
.sidebar-user-info span { font-size: 9px; color: #aeb9c9; }

.logout-button {
    width: 100%;
    border: 1px solid rgba(255,255,255,.15);
    color: #d7deea;
    background: transparent;
    padding: 10px;
    border-radius: 6px;
    font: inherit;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
}
.logout-button:hover { background: rgba(255,255,255,.07); }

.admin-main {
    margin-left: 255px;
    padding: 32px 40px;
    max-width: 1600px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 27px;
}
.topbar .eyebrow { color: #a38a5d; font-size: 9px; }
.topbar h1 { margin: 5px 0 0; font-size: 24px; color: var(--navy); }
.topbar-user { font-size: 11px; color: #697588; }
.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #39a879;
    margin-right: 6px;
}

.welcome {
    min-height: 165px;
    padding: 29px 34px;
    border-radius: 11px;
    color: white;
    background: linear-gradient(110deg, #1b2b48, #344b6c);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.welcome-kicker { color: var(--gold-light); font-size: 9px; }
.welcome h2 { font-family: 'Playfair Display', serif; font-size: 27px; margin: 8px 0; }
.welcome p:last-child { font-size: 12px; color: #c7cfdb; margin: 0; }
.welcome-decoration {
    font-family: 'Playfair Display', serif;
    color: rgba(229,209,167,.12);
    font-size: 170px;
    line-height: 1;
    margin-right: 35px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
    margin: 22px 0;
}
.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 20px;
    min-height: 145px;
}
.stat-icon {
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    margin-bottom: 13px;
    font-size: 16px;
}
.stat-icon.purple { background: #f0edfb; color: #7765b2; }
.stat-icon.gold { background: #f8f1e5; color: #ae8950; }
.stat-icon.green { background: #e8f5ef; color: #469b76; }
.stat-card > span { display: block; color: #778194; font-size: 10px; }
.stat-card > strong { display: inline-block; font-size: 25px; color: var(--navy); margin: 5px 8px 0 0; }
.stat-card > small { color: #9aa3b0; font-size: 9px; }

.content-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 23px;
}
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.section-heading h3 { margin: 0 0 5px; font-size: 15px; color: var(--navy); }
.section-heading p { margin: 0; font-size: 10px; color: #8a94a3; }
.coming-label {
    font-size: 8px;
    letter-spacing: 1px;
    color: #a17e46;
    background: #faf5eb;
    padding: 7px 9px;
    border-radius: 4px;
    white-space: nowrap;
}

.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th {
    text-align: left;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #8b95a4;
    background: #fafbfd;
    padding: 12px 13px;
}
td { padding: 14px 13px; border-bottom: 1px solid #eef0f4; font-size: 10px; color: #697588; }
td strong { color: #344158; }
.status-pill { padding: 5px 8px; border-radius: 20px; font-size: 9px; }
.status-pill.active { color: #27835d; background: #eaf6f0; }
.status-pill.suspended { color: #a64d4d; background: #fff0ef; }

.empty-state { text-align: center; padding: 35px 15px 28px; }
.empty-icon { font-size: 27px; color: #c4ad81; }
.empty-state h4 { color: var(--navy); font-size: 13px; margin: 10px 0 5px; }
.empty-state p { color: #929baa; font-size: 10px; }
.admin-footer { text-align: center; color: #a0a8b4; font-size: 9px; padding: 25px 0 10px; }

@media (max-width: 900px) {
    .sidebar { width: 210px; }
    .admin-main { margin-left: 210px; padding: 25px 22px; }
    .stats-grid { gap: 10px; }
    .stat-card { padding: 15px; }
}

@media (max-width: 650px) {
    .login-page { padding: 15px; background: white; }
    .login-wrapper { display: block; min-height: auto; box-shadow: none; }
    .login-brand { display: none; }
    .login-panel { padding: 45px 10px; min-height: 90vh; }
    .mobile-brand { display: block; color: var(--navy); font-weight: 800; letter-spacing: 2px; margin-bottom: 55px; }
    .mobile-brand span { color: #b18e55; }
    .login-content { max-width: 390px; }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 14px 17px;
    }
    .sidebar-brand { padding: 0; }
    .sidebar-label, .side-link, .sidebar-user { display: none; }
    .sidebar-bottom { margin-top: 12px; }
    .logout-button { text-align: center; }
    .admin-main { margin: 0; padding: 23px 15px; }
    .topbar { align-items: flex-start; }
    .topbar h1 { font-size: 21px; }
    .topbar-user { padding-top: 8px; font-size: 9px; }
    .welcome { min-height: 145px; padding: 22px; }
    .welcome h2 { font-size: 22px; }
    .welcome p:last-child { max-width: 260px; line-height: 1.6; }
    .welcome-decoration { font-size: 100px; margin-right: -10px; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 120px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .content-card { padding: 17px 12px; }
}

/* ===== MÓDULO DE ORGANIZACIONES ===== */
.alert-success {
    background: #eaf6f0;
    color: #27835d;
    border: 1px solid #cce9da;
    padding: 13px 16px;
    border-radius: 8px;
    margin: 0 0 18px;
    font-size: 12px;
}
.btn-primary.btn-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 38px;
    padding: 0 15px;
    margin: 0;
    text-decoration: none;
    font-size: 11px;
    border: 0;
    cursor: pointer;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dce1e8;
    background: #fff;
    color: #34445e;
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
}
.btn-secondary:hover { background: #f5f7fa; }
.search-form {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 20px 0;
}
.search-form input {
    flex: 1;
    min-width: 120px;
    border: 1px solid #dce1e8;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    font-size: 11px;
}
.clear-search { color: #788397; font-size: 11px; text-decoration: none; }
.table-subtitle {
    display: block;
    margin-top: 4px;
    color: #8a94a3;
    font-size: 9px;
    overflow-wrap: anywhere;
}
.action-group { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.action-group form { margin: 0; }
.action-link {
    border: 0;
    padding: 0;
    background: none;
    color: #526b91;
    font: inherit;
    font-size: 10px;
    text-decoration: none;
    cursor: pointer;
}
.action-danger { color: #b34d4d; }
.action-success { color: #27835d; }
.org-edit-card { margin-bottom: 20px; }
.org-form { margin-top: 20px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.form-field label {
    color: #39475d;
    font-size: 11px;
    font-weight: 600;
}
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid #dce1e8;
    border-radius: 6px;
    padding: 10px 11px;
    background: #fff;
    color: #29374c;
    font: inherit;
    font-size: 12px;
}
.form-field textarea { resize: vertical; min-height: 75px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #9b835b;
    box-shadow: 0 0 0 2px rgba(155,131,91,.12);
}
.form-field small { color: #8a94a3; font-size: 10px; line-height: 1.5; }
.form-field-full { grid-column: 1 / -1; }
.org-submit { width: auto; min-width: 180px; margin-top: 8px; }
.register-wrapper { align-items: flex-start; }
.register-panel { align-items: flex-start; padding-top: 45px; padding-bottom: 45px; }
.register-content { max-width: 440px; }
.register-content .muted { margin-bottom: 22px; }
.register-content .form-field { margin-bottom: 13px; }
.register-content .btn-primary { margin-top: 8px; }
.register-content .login-note a,
.login-note a { color: #9b7842; font-weight: 600; text-decoration: none; }
.register-content .login-note a:hover,
.login-note a:hover { text-decoration: underline; }

@media (max-width: 650px) {
    .search-form { flex-wrap: wrap; }
    .search-form input { flex-basis: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .form-field-full { grid-column: auto; }
    .section-heading { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
    .section-heading .btn-primary { width: 100%; }
    .register-panel { padding: 28px 20px; }
}
