/* ============================================
   JAVIETA — Admin Panel Styles
   ============================================ */

:root {
    --red:          #DA251D;
    --red-dark:     #A81B15;
    --gold:         #F5C000;
    --ink:          #1A0A09;
    --sidebar-bg:   #1A0A09;
    --sidebar-w:    240px;
    --white:        #FFFFFF;
    --body-bg:      #F5F4F2;
    --card-bg:      #FFFFFF;
    --border-color: #E5E2DE;
    --text:         #2D2420;
    --muted:        #8A7E7C;
    --success:      #1A7F4B;
    --success-bg:   #EDFAF4;
    --error:        #C0392B;
    --error-bg:     #FDF0ED;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Inter', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--body-bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* === LOGIN PAGE === */
.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    background-image: radial-gradient(circle at 70% 30%, rgba(218,37,29,0.15) 0%, transparent 60%);
}

.login-wrap {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--ink);
    display: block;
    margin-bottom: 0.25rem;
}
.login-brand p {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: var(--muted);
    transition: color 0.2s;
}
.back-link:hover { color: var(--red); }

/* === ADMIN LAYOUT === */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 0.5rem;
}
.sidebar-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--white);
    display: block;
    line-height: 1;
    margin-bottom: 3px;
}
.logo-gold { color: var(--gold); }
.sidebar-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 0.84rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.07);
    color: var(--white);
}
.sidebar-link.active {
    background: var(--red);
    color: var(--white);
}
.sidebar-link .icon { font-size: 1rem; line-height: 1; }

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 0.75rem 0;
}

.sidebar-logout { color: rgba(255,255,255,0.4); }
.sidebar-logout:hover { background: rgba(218,37,29,0.2); color: #ff8a8a; }

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-avatar {
    width: 32px; height: 32px;
    background: var(--red);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}
.user-name {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.65);
    font-weight: 500;
}

/* MAIN AREA */
.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-page-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
}

.btn-view-site {
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.2s, border-color 0.2s;
}
.btn-view-site:hover { color: var(--red); border-color: var(--red); }

.admin-content {
    padding: 1.75rem;
    flex: 1;
}

/* === CARDS & FORMS === */
.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
}
.admin-card h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1.25rem;
}
.admin-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1rem;
}

.help-text {
    font-size: 0.83rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    background: #F9F7F5;
    border-left: 3px solid var(--gold);
    padding: 0.6rem 0.85rem;
    border-radius: 0 6px 6px 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    margin-bottom: 1rem;
}
.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-group small {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}
.form-row .form-group { margin-bottom: 1rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text);
    background: var(--white);
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(218,37,29,0.1);
}
textarea { resize: vertical; min-height: 80px; }

/* === BUTTONS === */
.btn-admin-primary {
    background: var(--red);
    color: var(--white);
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: inline-block;
    text-align: center;
}
.btn-admin-primary:hover { background: var(--red-dark); transform: translateY(-1px); }

.btn-admin-secondary {
    background: var(--body-bg);
    color: var(--text);
    border: 1.5px solid var(--border-color);
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-block;
}
.btn-admin-secondary:hover { background: var(--border-color); }

.btn-sm {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(218,37,29,0.08);
    color: var(--red);
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-sm:hover { background: var(--red); color: var(--white); }
.btn-sm-grey { background: rgba(0,0,0,0.05); color: var(--muted); }
.btn-sm-grey:hover { background: var(--muted); color: var(--white); }
.btn-sm-danger { background: rgba(192,57,43,0.08); color: var(--error); }
.btn-sm-danger:hover { background: var(--error); color: var(--white); }

/* === ALERTS === */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(26,127,75,0.2); }
.alert-error   { background: var(--error-bg);   color: var(--error);   border: 1px solid rgba(192,57,43,0.2); }

/* === TABLE === */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-table th {
    text-align: left;
    padding: 0.6rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}
.admin-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFAF9; }
.row-inactive td { opacity: 0.5; }
.actions-cell { white-space: nowrap; }
.actions-cell a + a { margin-left: 0.35rem; }

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.badge-active   { background: rgba(26,127,75,0.12);  color: var(--success); }
.badge-inactive { background: rgba(0,0,0,0.06);      color: var(--muted); }
.badge-red      { background: rgba(218,37,29,0.1);   color: var(--red); }

/* === DASHBOARD === */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--red-dark, #A81B15), var(--red));
    color: var(--white);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.dashboard-welcome h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.dashboard-welcome p { font-size: 0.9rem; opacity: 0.8; }

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.dash-stat {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: block;
}
.dash-stat:hover { border-color: var(--red); box-shadow: 0 4px 16px rgba(218,37,29,0.1); }
.dash-stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--red);
    line-height: 1;
    margin-bottom: 0.35rem;
}
.dash-stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }

.dash-section { margin-bottom: 1.5rem; }
.dash-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.view-all { font-size: 0.78rem; font-weight: 600; color: var(--red); }
.view-all:hover { text-decoration: underline; }

.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.quick-action {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.quick-action:hover { border-color: var(--red); box-shadow: 0 2px 12px rgba(218,37,29,0.1); }
.qa-icon { font-size: 1.1rem; }

.dash-list { display: flex; flex-direction: column; gap: 0.5rem; }
.dash-list-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.dash-list-title { flex: 1; font-size: 0.85rem; font-weight: 500; min-width: 200px; }
.dash-list-date { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.dash-list-edit { font-size: 0.75rem; font-weight: 600; color: var(--red); }
.dash-list-edit:hover { text-decoration: underline; }

/* === LOGIN FORM (reuse form-group styles) === */
.login-form { display: flex; flex-direction: column; gap: 0; }
.login-form .form-group { margin-bottom: 1rem; }
.login-form input { font-size: 0.95rem; }
