/* ============================================================
   Acnovo Admin — Design System
   ============================================================ */

:root {
    --acnovo-blue:        #0b5fff;
    --acnovo-blue-dark:   #0a4fd3;
    --acnovo-blue-light:  rgba(11, 95, 255, 0.08);
    --acnovo-dark:        #1c2433;
    --acnovo-dark-hover:  #252f44;
    --acnovo-surface:     #f4f6f9;
    --acnovo-card:        #ffffff;
    --acnovo-text:        #2d3748;
    --acnovo-muted:       #6b7280;
    --acnovo-border:      #e5e7eb;
    --sidebar-width:      240px;
    --topbar-height:      60px;
    --radius:             10px;
    --shadow-sm:          0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:          0 4px 12px rgba(0,0,0,0.08);
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--acnovo-text);
    background: var(--acnovo-surface);
    min-height: 100vh;
}

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--acnovo-card);
    border-bottom: 1px solid var(--acnovo-border);
    z-index: 200;
}

.topbar-inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1.5rem;
    gap: 1rem;
}

.topbar-page-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--acnovo-text);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--acnovo-text);
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
    line-height: 1;
}
.sidebar-toggle:hover { background: var(--acnovo-surface); }

/* ── Layout wrapper ────────────────────────────────────────── */
.wrapper {
    display: flex;
    padding-top: var(--topbar-height);
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: var(--acnovo-dark);
    display: flex;
    flex-direction: column;
    z-index: 150;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    text-decoration: none;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.brand-sub {
    color: rgba(255,255,255,0.45);
    font-size: 10px;
    letter-spacing: 0.3px;
}

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

.nav-section-label {
    display: block;
    padding: 0.6rem 1.25rem 0.25rem;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1.25rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.nav-link-item i {
    font-size: 15px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.nav-link-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.nav-link-item.active {
    color: #fff;
    background: var(--acnovo-blue-light);
    border-left-color: var(--acnovo-blue);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 140;
}

/* ── Main content ──────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: calc(100vh - var(--topbar-height));
}

/* ── Page header ───────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--acnovo-text);
}

.page-subtitle {
    font-size: 13px;
    color: var(--acnovo-muted);
    margin: 0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.content-card {
    background: var(--acnovo-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--acnovo-border);
    padding: 1.5rem;
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--acnovo-border);
}

.content-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--acnovo-text);
    display: flex;
    align-items: center;
}

/* ── Stats grid ────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--acnovo-card);
    border-radius: var(--radius);
    border: 1px solid var(--acnovo-border);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--acnovo-text);
}

.stat-label {
    font-size: 11px;
    color: var(--acnovo-muted);
    margin-top: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Tables ────────────────────────────────────────────────── */
.table thead th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--acnovo-muted);
    border-bottom: 2px solid var(--acnovo-border);
    padding: 0.6rem 0.75rem;
    background: var(--acnovo-surface);
}

.table tbody td {
    padding: 0.8rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--acnovo-border);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover > td { background: rgba(11,95,255,0.025); }

/* ── Status badges ─────────────────────────────────────────── */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-ready     { background: #d1fae5; color: #065f46; }
.badge-converting{ background: #fef3c7; color: #92400e; }
.badge-uploaded  { background: #dbeafe; color: #1e40af; }
.badge-error     { background: #fee2e2; color: #991b1b; cursor: default; }

/* ── File icon ─────────────────────────────────────────────── */
.file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--acnovo-blue-light);
    color: var(--acnovo-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
    background: var(--acnovo-blue);
    border-color: var(--acnovo-blue);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--acnovo-blue-dark);
    border-color: var(--acnovo-blue-dark);
}
.btn-ghost {
    background: none;
    border: none;
    color: var(--acnovo-muted);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}
.btn-ghost:hover { background: var(--acnovo-surface); color: var(--acnovo-text); }

/* Botón icono pequeño (lápiz edición título) */
.btn-icon-ghost {
    background: none;
    border: none;
    color: var(--acnovo-muted);
    padding: 2px 5px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    vertical-align: middle;
}
tr:hover .btn-icon-ghost,
.cloud-title-wrapper:hover .btn-icon-ghost { opacity: 1; }
.btn-icon-ghost:hover { color: var(--acnovo-blue); background: var(--acnovo-blue-light); }

/* Botones xs para edición inline */
.btn-xs {
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
    border: none;
    cursor: pointer;
}
.btn-xs.btn-primary { background: var(--acnovo-blue); color: #fff; }
.btn-xs.btn-primary:hover { background: var(--acnovo-blue-dark); }
.btn-ghost-sm {
    background: none;
    border: 1px solid var(--acnovo-border);
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 4px;
    color: var(--acnovo-muted);
    cursor: pointer;
}
.btn-ghost-sm:hover { background: var(--acnovo-surface); }

/* Toggle switch — ajuste de tamaño */
.cloud-toggle { cursor: pointer; width: 2.2em; height: 1.2em; }
.cloud-toggle:checked { background-color: var(--acnovo-blue); border-color: var(--acnovo-blue); }

/* ── Drop zone ─────────────────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--acnovo-border);
    border-radius: var(--radius);
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.dragging {
    border-color: var(--acnovo-blue);
    background: var(--acnovo-blue-light);
    outline: none;
}

.drop-zone-inner { pointer-events: none; }

.drop-icon {
    font-size: 40px;
    color: var(--acnovo-blue);
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.drop-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--acnovo-text);
    margin-bottom: 0.25rem;
}

.drop-sub {
    color: var(--acnovo-muted);
    margin-bottom: 0.5rem;
}

.drop-hint {
    display: inline-block;
    background: var(--acnovo-surface);
    border: 1px solid var(--acnovo-border);
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 11px;
    color: var(--acnovo-muted);
}

/* File info bar */
.file-info-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--acnovo-surface);
    border: 1px solid var(--acnovo-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}

/* ── Success state ─────────────────────────────────────────── */
.success-state {
    text-align: center;
    padding: 1rem 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #d1fae5;
    color: #065f46;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.success-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.success-details {
    background: var(--acnovo-surface);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: inline-block;
    text-align: left;
    min-width: 260px;
}

.success-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
    font-size: 13px;
}

/* ── Info list ─────────────────────────────────────────────── */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
}

.info-list li i { margin-top: 2px; flex-shrink: 0; }

/* ── Workflow steps ────────────────────────────────────────── */
.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--acnovo-blue);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 52px;
    color: var(--acnovo-border);
    display: block;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--acnovo-text);
    margin-bottom: 0.25rem;
}

.empty-sub {
    color: var(--acnovo-muted);
    margin-bottom: 0;
}

/* ── Login ─────────────────────────────────────────────────── */
.login-body {
    background: var(--acnovo-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.login-bg-pattern {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(11,95,255,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(11,95,255,0.04) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--acnovo-card);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--acnovo-border);
    padding: 2rem;
}

.login-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.btn-login {
    height: 42px;
    font-weight: 600;
    font-size: 14px;
}

/* Form inputs */
.form-control:focus { border-color: var(--acnovo-blue); box-shadow: 0 0 0 3px rgba(11,95,255,0.12); }
.input-group-text { background: #f9fafb; }

/* ── Responsive (Mobile) ───────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.active {
        display: block;
    }
    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .page-header { flex-direction: column; }
}

/* ── Progress bar ──────────────────────────────────────────── */
.progress { border-radius: 20px; background: var(--acnovo-border); }
.progress-bar { background: var(--acnovo-blue); border-radius: 20px; }
