/* =============================================
   PabloTCG — Admin Panel CSS
   ============================================= */

:root {
    --orange:     #FF5500;
    --orange-lo:  #CC4400;
    --orange-tint:#FFF3EE;
    --white:      #FFFFFF;
    --bg:         #F4F4F5;
    --surface:    #FAFAFA;
    --border:     #E4E4E7;
    --dark:       #0F0F0F;
    --text:       #18181B;
    --muted:      #71717A;
    --sidebar-w:  230px;
    --radius:     10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 200;
}

.sidebar-logo {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.85rem;
    padding: 1.35rem 1.5rem 1.2rem;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo .orange { color: var(--orange); }

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.72rem 1.4rem;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.16s;
    border-left: 3px solid transparent;
    margin: 0.05rem 0;
}
.sidebar-nav a:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.05); }
.sidebar-nav a.active {
    color: var(--orange);
    border-left-color: var(--orange);
    background: rgba(255,85,0,0.1);
}

.sidebar-footer {
    padding: 1rem 1.4rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.sidebar-footer a {
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.16s;
    padding: 0.25rem 0;
}
.sidebar-footer a:hover { color: rgba(255,255,255,0.8); }
.sidebar-footer a.logout:hover { color: #FF6B6B; }

/* MAIN */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem 2.5rem;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}
.page-header h1 {
    font-family: 'Bebas Neue', cursive;
    font-size: 2rem;
    letter-spacing: 0.05em;
    color: var(--text);
    line-height: 1;
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-card.orange { border-left: 3px solid var(--orange); }
.stat-icon { font-size: 1.6rem; }
.stat-num {
    font-family: 'Bebas Neue', cursive;
    font-size: 2rem;
    color: var(--orange);
    line-height: 1;
}
.stat-label {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* PANEL */
.panel {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.panel-head {
    padding: 0.9rem 1.4rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
}
.panel-head h2 { font-size: 0.9rem; font-weight: 700; color: var(--text); }

/* TWO COL */
.two-col {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* FORMS */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.4rem;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.field input,
.field select,
.field textarea {
    padding: 0.58rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.16s, box-shadow 0.16s;
    outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,85,0,0.1);
}
.field small { font-size: 0.74rem; color: var(--muted); }
.field textarea { resize: vertical; min-height: 80px; }
.file-input { padding: 0.4rem 0.6rem; cursor: pointer; font-size: 0.84rem; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-grid .span-2 { grid-column: span 2; }
.form-row { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* BUTTONS */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.58rem 1.3rem;
    background: var(--orange);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
    align-self: flex-start;
}
.btn-primary:hover { background: var(--orange-lo); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,85,0,0.3); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 0.56rem 1.2rem;
    background: transparent;
    color: var(--orange);
    border: 1.5px solid var(--orange);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
}
.btn-outline:hover { background: var(--orange-tint); }
.btn-full { width: 100%; justify-content: center; }

.btn-sm {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-sm:hover { background: var(--orange-tint); border-color: var(--orange); color: var(--orange); }
.btn-sm.danger:hover { background: #FEE2E2; border-color: #DC2626; color: #DC2626; }

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td { padding: 0.72rem 1.3rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th {
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); background: var(--surface);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFAFA; }
.actions { display: flex; gap: 0.35rem; align-items: center; }

/* CAT TABS */
.cat-tabs { display: flex; gap: 0.4rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.cat-tab {
    padding: 0.38rem 1rem;
    border-radius: 99px;
    font-size: 0.83rem; font-weight: 600;
    text-decoration: none; color: var(--muted);
    background: var(--white); border: 1.5px solid var(--border);
    transition: all 0.16s;
}
.cat-tab:hover { border-color: var(--orange); color: var(--orange); }
.cat-tab.active { background: var(--orange); color: var(--white); border-color: var(--orange); box-shadow: 0 2px 10px rgba(255,85,0,0.25); }

/* PRODUCTS ADMIN */
.products-admin-grid {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
}
.product-admin-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    display: flex; align-items: center; gap: 0.85rem; padding: 0.85rem;
    background: var(--white); transition: box-shadow 0.18s, border-color 0.18s;
}
.product-admin-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-color: rgba(255,85,0,0.15); }

.pac-image {
    width: 52px; height: 68px; border-radius: 6px; overflow: hidden;
    background: var(--orange-tint); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.pac-image img { width: 100%; height: 100%; object-fit: contain; }
.pac-info { flex: 1; min-width: 0; }
.pac-info strong { display: block; font-size: 0.86rem; margin-bottom: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pac-meta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.price-tag { font-family: 'Bebas Neue', cursive; font-size: 1.1rem; color: var(--orange); }
.badge-green, .badge-red {
    font-size: 0.67rem; font-weight: 700;
    padding: 0.15rem 0.45rem; border-radius: 99px; text-transform: uppercase;
}
.badge-green { background: #DCFCE7; color: #15803D; }
.badge-red { background: #FEE2E2; color: #DC2626; }
.pac-actions { display: flex; flex-direction: column; gap: 0.3rem; }

/* SOCIALS */
.socials-admin-list { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.6rem; }
.social-admin-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; background: var(--bg); border-radius: 8px;
    border: 1px solid var(--border); gap: 1rem;
}
.social-admin-info { display: flex; align-items: center; gap: 0.55rem; min-width: 0; flex: 1; }
.social-admin-info strong { font-size: 0.88rem; }
.social-icon-tag {
    background: var(--orange-tint); color: var(--orange);
    font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.4rem;
    border-radius: 4px; text-transform: uppercase;
}
.social-url {
    font-size: 0.76rem; color: var(--muted); text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px;
}
.social-url:hover { color: var(--orange); }
.social-admin-actions { display: flex; gap: 0.3rem; }

/* ALERTS */
.alert {
    padding: 0.78rem 1.2rem; border-radius: 8px;
    font-size: 0.875rem; font-weight: 500; margin-bottom: 1.25rem;
    display: flex; align-items: center; gap: 0.6rem;
}
.alert-success { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.alert-error   { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.alert a { color: inherit; font-weight: 700; }

/* EMPTY */
.empty-panel { padding: 2rem 1.4rem; text-align: center; color: var(--muted); font-size: 0.875rem; }
.empty-panel a { color: var(--orange); font-weight: 600; text-decoration: none; }

/* MODAL */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45); z-index: 500;
    align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--white); border-radius: 14px;
    width: 100%; max-width: 480px; overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    animation: modalIn 0.22s ease;
}
.modal-lg { max-width: 620px; }
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-head {
    padding: 1.15rem 1.4rem; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--surface);
}
.modal-head h3 { font-size: 0.95rem; font-weight: 700; }
.modal-close {
    background: none; border: none; font-size: 1rem; cursor: pointer;
    color: var(--muted); padding: 0.2rem 0.45rem; border-radius: 4px; transition: all 0.16s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

/* LOGIN PAGE */
.login-body { display: block; overflow: hidden; position: relative; }
.login-bg {
    position: fixed; inset: 0;
    background: var(--dark);
    background-image:
        linear-gradient(rgba(255,85,0,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,85,0,0.08) 1px, transparent 1px);
    background-size: 44px 44px;
}
.login-container {
    position: relative; z-index: 10; min-height: 100vh;
    display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.login-card {
    background: var(--white); border-radius: 16px;
    padding: 2.5rem 2.25rem; width: 100%; max-width: 380px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.06);
}
.login-logo {
    font-family: 'Bebas Neue', cursive;
    font-size: 2.6rem; text-align: center; margin-bottom: 0.2rem;
    color: var(--dark); letter-spacing: 0.06em; line-height: 1;
}
.login-logo .orange { color: var(--orange); }
.login-subtitle {
    text-align: center; color: var(--muted); font-size: 0.78rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 2rem;
}
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.back-link {
    display: block; text-align: center; margin-top: 1.25rem;
    font-size: 0.8rem; color: var(--muted); text-decoration: none; transition: color 0.18s;
}
.back-link:hover { color: var(--orange); }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .two-col { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .admin-main { margin-left: 0; padding: 1rem; }
    .admin-sidebar { transform: translateX(-100%); transition: transform 0.28s; }
    .admin-sidebar.open { transform: translateX(0); }
    .stats-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
}

/* ===== DRAG & DROP ===== */
.drag-handle {
    cursor: grab;
    color: var(--muted);
    font-size: 1.1rem;
    padding: 0 0.4rem;
    opacity: 0.4;
    transition: opacity 0.15s;
    user-select: none;
    flex-shrink: 0;
}
.drag-handle:hover { opacity: 1; color: var(--orange); }
.drag-handle:active { cursor: grabbing; }

.drag-handle-cell {
    width: 32px;
    padding: 0 0.3rem !important;
}

.sortable-ghost {
    opacity: 0.3;
    background: var(--orange-tint) !important;
}
.sortable-chosen {
    box-shadow: 0 4px 20px rgba(255,85,0,0.2) !important;
    border-color: var(--orange) !important;
}
.sortable-drag { opacity: 0.95; }

.drag-hint {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
    font-style: italic;
}

/* Save indicator toast */
.save-indicator {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--dark);
    color: var(--white);
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    animation: slideUp 0.2s ease;
}
.save-indicator.ok  { background: #15803D; }
.save-indicator.err { background: #DC2626; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* LIVE TOGGLE */
.live-toggle { font-size: 0.7rem !important; font-weight: 700 !important; min-width: 80px; }
.live-toggle.live-on { background: #ef4444 !important; color: #fff !important; border-color: #ef4444 !important; }
.social-admin-item.is-live { border-left: 3px solid #ef4444; }

