/* ============================================================
   Eventio Admin CSS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary:   #E74F1D;
    --color-secondary: #F29200;
    --sidebar-width:   240px;
    --font:            -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body { height: 100%; font-family: var(--font); font-size: 15px; color: #111827; background: #f3f4f6; }

/* ---- Layout ---- */
.admin-body { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: var(--sidebar-width);
    background: #111827;
    color: #d1d5db;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid #1f2937;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}
.sidebar-brand small { display: block; font-weight: 400; font-size: .7rem; color: #9ca3af; }
.sidebar-event-dot { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }

.sidebar-nav { flex: 1; padding: .75rem 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1rem;
    color: #9ca3af;
    text-decoration: none;
    font-size: .875rem;
    border-radius: 0;
    transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: #1f2937; color: #f3f4f6; }
.sidebar-nav a.active { background: #1f2937; color: white; border-left: 3px solid var(--color-primary); }
.nav-icon { font-size: 1rem; width: 1.25rem; text-align: center; }
.nav-divider { height: 1px; background: #1f2937; margin: .5rem 0; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #1f2937;
    font-size: .8rem;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logout-link { color: #9ca3af; text-decoration: none; }
.logout-link:hover { color: white; }

.admin-main { flex: 1; overflow-y: auto; }
.admin-content { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }

/* ---- Auth ---- */
.auth-page { background: #f3f4f6; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { background: white; border-radius: 1rem; padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.auth-logo { display: flex; align-items: center; gap: .75rem; font-weight: 700; font-size: 1.2rem; margin-bottom: 1.5rem; }
.auth-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-footer { margin-top: 1.5rem; text-align: center; font-size: .85rem; color: #6b7280; }
.auth-footer a { color: var(--color-primary); text-decoration: none; }

/* ---- Page header ---- */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-sub { color: #6b7280; margin-top: .25rem; font-size: .9rem; }

/* ---- Cards ---- */
.card { background: white; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.07); overflow: hidden; margin-bottom: 1rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid #f3f4f6; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-text { font-size: .9rem; color: #6b7280; line-height: 1.5; margin-top: .25rem; }

/* ---- Stats ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: white; border-radius: .75rem; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.stat-value { font-size: 2rem; font-weight: 700; color: #111827; }
.stat-label { font-size: .8rem; color: #6b7280; margin-top: .25rem; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; padding: .75rem 1.25rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; background: #f9fafb; border-bottom: 1px solid #f3f4f6; }
.table td { padding: .75rem 1.25rem; border-bottom: 1px solid #f9fafb; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafafa; }
.td-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.empty-row { color: #9ca3af; padding: 2rem 1.25rem; text-align: center; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem; border-radius: .4rem; font-size: .875rem; font-weight: 500; cursor: pointer; text-decoration: none; border: none; transition: opacity .15s, transform .1s; white-space: nowrap; }
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--color-primary); color: white; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.btn-secondary:hover { background: #e5e7eb; opacity: 1; }
.btn-ghost { background: transparent; color: #6b7280; border: 1px solid #e5e7eb; }
.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; opacity: 1; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-icon { background: none; border: none; cursor: pointer; padding: .35rem; color: #9ca3af; font-size: 1rem; }

/* ---- Forms ---- */
.form-grid { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .825rem; font-weight: 500; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
    padding: .55rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: .4rem;
    font-size: .9rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    background: white;
    width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: #9ca3af; }
.form-section-title { font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; padding-top: .5rem; border-top: 1px solid #f3f4f6; margin-top: .25rem; }
.form-actions { display: flex; gap: .75rem; padding-top: .5rem; }
.required { color: #dc2626; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .875rem; }
.checkbox-label input { width: auto; }
.input-addon { display: flex; align-items: stretch; }
.input-addon input { border-radius: .4rem 0 0 .4rem; border-right: none; }
.addon-text { display: flex; align-items: center; padding: 0 .75rem; background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 0 .4rem .4rem 0; font-size: .8rem; color: #6b7280; white-space: nowrap; }
.color-input-wrap { display: flex; align-items: center; gap: .5rem; }
.color-input-wrap input[type="color"] { width: 40px; height: 38px; border-radius: .4rem; cursor: pointer; border: 1px solid #d1d5db; padding: 2px; }
.color-preview { font-size: .85rem; color: #6b7280; }
.url-display a { color: var(--color-primary); font-size: .9rem; text-decoration: none; }
.url-display a:hover { text-decoration: underline; }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 9999px; font-size: .72rem; font-weight: 600; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-gray  { background: #f3f4f6; color: #6b7280; }
.badge-blue  { background: #dbeafe; color: #1d4ed8; }

/* ---- Alerts ---- */
.alert { padding: .85rem 1rem; border-radius: .4rem; margin-bottom: 1rem; font-size: .875rem; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ---- Empty states ---- */
.empty-state { padding: 3rem; text-align: center; }
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.empty-state p { color: #9ca3af; margin-bottom: 1rem; }

/* ---- Quick links ---- */
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-top: 1rem; }
.quick-link-card { background: white; border-radius: .75rem; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.07); text-decoration: none; color: #374151; display: flex; flex-direction: column; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 500; transition: box-shadow .15s; }
.quick-link-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.ql-icon { font-size: 1.5rem; }

/* ---- Misc ---- */
.text-link { color: var(--color-primary); text-decoration: none; font-size: .875rem; }
.text-link:hover { text-decoration: underline; }
.code-link { font-family: monospace; font-size: .82rem; color: var(--color-primary); text-decoration: none; }
.code-link:hover { text-decoration: underline; }
code { font-family: monospace; font-size: .82rem; background: #f3f4f6; padding: .15rem .4rem; border-radius: .25rem; }
.mono { font-family: monospace; font-size: .82rem; }
.time-cell { font-family: monospace; font-size: .85rem; white-space: nowrap; color: #6b7280; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .admin-body { flex-direction: column; height: auto; overflow: auto; }
    .sidebar { width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; }
    .sidebar-nav { display: flex; flex-direction: row; flex-wrap: wrap; padding: .25rem; }
    .sidebar-nav a { padding: .4rem .6rem; font-size: .75rem; }
    .admin-content { padding: 1rem; }
}
