/* ============================================================
   Sistema de Eventos — admin.css
   Admin panel specific styles
   ============================================================ */

/* --- Admin Body --- */
.admin-body {
    background: #f0f2f5;
    font-size: .94rem;
}

/* --- Login Page --- */
.login-body {
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-container { width: 100%; max-width: 420px; padding: 1rem; }
.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo .brand-icon { font-size: 2.5rem; color: var(--primary); display: block; }
.login-logo h1 { font-size: 1.5rem; color: var(--primary); margin-bottom: .25rem; }
.login-logo p { color: var(--text-muted); font-size: .9rem; }

/* --- Topbar --- */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--primary);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* --- Hamburger Button --- */
.admin-sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .25rem .3rem;
    border-radius: 4px;
}
.admin-sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}
.admin-sidebar-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.admin-sidebar-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.admin-sidebar-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Sidebar Backdrop --- */
.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 299;
    background: rgba(0,0,0,.45);
}
.admin-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.admin-brand:hover { color: var(--accent); text-decoration: none; }

.admin-topbar-right { display: flex; align-items: center; gap: 1rem; }
.admin-site-link {
    color: rgba(255,255,255,.75);
    font-size: .87rem;
    text-decoration: none;
}
.admin-site-link:hover { color: var(--accent); }
.admin-logout-btn {
    background: rgba(255,255,255,.12);
    color: var(--white);
    padding: .35rem .9rem;
    border-radius: var(--radius);
    font-size: .87rem;
    text-decoration: none;
    transition: background .2s;
}
.admin-logout-btn:hover { background: rgba(255,255,255,.22); color: var(--white); text-decoration: none; }

/* --- Layout --- */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* --- Sidebar --- */
.admin-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}
.admin-sidebar nav ul { list-style: none; }
.admin-sidebar nav ul li a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem 1.25rem;
    color: var(--text);
    font-size: .93rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.admin-sidebar nav ul li a:hover {
    background: var(--bg);
    color: var(--primary);
    text-decoration: none;
}
.admin-sidebar nav ul li a.active {
    background: #eef2fb;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 700;
}
.nav-icon { font-size: 1.1rem; }

/* --- Content Area --- */
.admin-content {
    flex: 1;
    padding: 2rem 2.5rem;
    min-width: 0;
}

/* --- Page Header --- */
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}
.admin-page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--primary);
    transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-pending  { border-top-color: #fd7e14; }
.stat-waitlist { border-top-color: #0dcaf0; }
.stat-today    { border-top-color: #198754; }

.stat-icon  { font-size: 1.8rem; margin-bottom: .4rem; }
.stat-value { font-size: 2.2rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: .25rem; }
.stat-label { font-size: .82rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }

/* --- Admin Sections --- */
.admin-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.admin-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

/* Quick Actions */
.quick-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* --- Tables --- */
.table-responsive { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.admin-table th {
    background: var(--primary);
    color: var(--white);
    padding: .7rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.admin-table td {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #f8f9fa; }

.admin-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}
.admin-thumb-placeholder {
    width: 48px;
    height: 36px;
    background: var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    color: var(--text-muted);
}

.actions-cell { white-space: nowrap; }
.actions-cell .btn,
.actions-cell form { display: inline-block; }
.actions-cell form { margin: 0; }

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
    background: var(--white);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}
.filter-search { flex: 1; min-width: 200px; max-width: 320px; }
.filter-select { min-width: 150px; width: auto; flex: 0 0 auto; }

/* --- Admin Form Card --- */
.admin-form-card {
    max-width: 900px;
    margin: 0;
}
.current-image { margin-bottom: .75rem; }
.admin-preview-img {
    width: 200px;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: .35rem;
}

/* --- Fields page layout --- */
.fields-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}
.fields-list { background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.fields-list h2 { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.field-form-panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 70px;
}
.field-form-panel h2 { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 1.25rem; }

/* Drag handle for sortable fields table */
.drag-handle {
    cursor: grab;
    color: #adb5bd;
    font-size: 1.1rem;
    text-align: center;
    user-select: none;
}
.drag-handle:active { cursor: grabbing; }
.drag-ghost { opacity: .4; background: var(--bg); }

/* --- Registration detail grid --- */
.detail-grid { display: grid; gap: .1rem; }
.detail-row {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--bg);
    font-size: .93rem;
}
.detail-row:last-child { border-bottom: none; }

/* --- Admin Responsive --- */
@media (max-width: 1100px) {
    .stats-grid    { grid-template-columns: repeat(2, 1fr); }
    .fields-layout { grid-template-columns: 1fr; }
    .field-form-panel { position: static; }
}
@media (max-width: 768px) {
    .admin-sidebar-toggle { display: flex; }
    .admin-sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        height: calc(100vh - 56px);
        z-index: 300;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 4px 0 16px rgba(0,0,0,.18);
    }
    .admin-sidebar.sidebar-open {
        transform: translateX(0);
    }
    .admin-sidebar-backdrop.backdrop-open {
        display: block;
    }
    .admin-content { padding: 1.25rem; }
    .stats-grid    { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .stats-grid    { grid-template-columns: 1fr; }
    .admin-page-header { flex-direction: column; align-items: flex-start; }
}

/* --- Recurring Schedules Table --- */
.schedule-table { margin-bottom: 0; }
.schedule-table th { padding: .45rem .6rem; font-size: .82rem; }
.schedule-table td { padding: .35rem .5rem; vertical-align: middle; }
.schedule-table .form-control { padding: .3rem .45rem; font-size: .9rem; }
.schedule-table select.form-control { min-width: 150px; }

/* --- Logs Export Bar --- */
.logs-export-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: .65rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    font-size: .88rem;
}
.logs-export-label {
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    margin-right: .25rem;
}
.logs-export-group {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.logs-export-scope {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.logs-export-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 .25rem;
}
@media (max-width: 600px) {
    .logs-export-bar { flex-direction: column; align-items: flex-start; }
    .logs-export-divider { display: none; }
}
