/* ===== Base ===== */
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #020617;
    color: #e5e7eb;
}

/* ===== Topbar ===== */
.topbar {
    height: 60px;
    background: #020617;
    border-bottom: 1px solid #111827;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #020617;
}
.brand-text {
    display: flex;
    flex-direction: column;
}
.brand-title {
    font-size: 16px;
    font-weight: 600;
}
.brand-sub {
    font-size: 11px;
    color: #9ca3af;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.user-label {
    color: #e5e7eb;
}
.topbar-btn {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: transparent;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 13px;
}
.topbar-btn:hover {
    background: #111827;
}

/* ===== Layout ===== */
.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    height: calc(100vh - 60px);
}

/* ===== Sidebar ===== */
.sidebar {
    background: #020617;
    border-right: 1px solid #111827;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: .05em;
    margin-bottom: 2px;
}
.sidebar-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
}
.sidebar-item .icon {
    width: 18px;
}
.sidebar-item:hover {
    background: #111827;
}
.sidebar-item.active {
    background: #111827;
    border: 1px solid #1d4ed8;
}
.sidebar-separator {
    border-bottom: 1px solid #111827;
    margin: 4px 0;
}
.breadcrumb-box {
    background: #020617;
    border-radius: 8px;
    padding: 8px 10px;
    border: 1px solid #111827;
    font-size: 12px;
}
.breadcrumb-home {
    color: #38bdf8;
    text-decoration: none;
}
.breadcrumb-path {
    margin-top: 4px;
    word-break: break-all;
}

/* Carpeta nueva */
.folder-form input[type="text"] {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #1f2937;
    padding: 7px 9px;
    background: #020617;
    color: #e5e7eb;
    font-size: 13px;
    margin-bottom: 6px;
}
.folder-form button {
    width: 100%;
    border-radius: 8px;
    border: none;
    background: #1d4ed8;
    color: #e5e7eb;
    padding: 7px 9px;
    font-size: 13px;
    cursor: pointer;
}
.folder-form button:hover {
    background: #2563eb;
}

/* ===== Main ===== */
.main {
    padding: 14px 18px 18px;
    background: radial-gradient(circle at top left, #0f172a, #020617 55%);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.toolbar-left h2 {
    margin: 0;
    font-size: 18px;
}
.toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
}
.input {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    font-size: 13px;
    min-width: 220px;
}
.select {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    font-size: 13px;
}
.checkbox-label {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Cards */
.card {
    background: rgba(15,23,42,0.9);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.45);
    border: 1px solid #111827;
}

/* Upload card */
.upload-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dropzone {
    border: 2px dashed #4b5563;
    border-radius: 12px;
    padding: 26px;
    text-align: center;
    background: #020617;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.dropzone-icon {
    font-size: 26px;
    margin-bottom: 4px;
}
.dropzone-text {
    font-size: 14px;
    color: #e5e7eb;
}
.dropzone.dragover {
    background: #111827;
    border-color: #38bdf8;
    transform: translateY(-1px);
}
.progress-container {
    margin-top: 8px;
    background: #020617;
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar {
    width: 0%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    color: #020617;
    text-align: center;
    padding: 5px 0;
    font-size: 12px;
    font-weight: 600;
}

/* Files card */
.files-card {
    padding-top: 10px;
}
.table-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1.5fr 2fr 2fr;
    padding: 6px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9ca3af;
    border-bottom: 1px solid #1f2937;
}
.file-list {
    margin-top: 0;
}
.file-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1.5fr 2fr 2fr;
    padding: 7px 14px;
    font-size: 13px;
    align-items: center;
    border-bottom: 1px solid #020617;
}
.file-row:nth-child(even) {
    background: #020617;
}
.folder-row {
    background: #020617;
}
.cell {
    padding-right: 6px;
}
.file-icon {
    margin-right: 6px;
}

/* Grid view */
.file-list[data-view="grid"] {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.file-list[data-view="grid"] .file-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 230px;
    border-radius: 10px;
    border: 1px solid #111827;
    background: #020617;
}
.file-list[data-view="grid"] .table-header {
    display: none;
}

/* Botones */
.btn {
    border: none;
    cursor: pointer;
    font-size: 12px;
}
.pill {
    border-radius: 999px;
    padding: 4px 10px;
    margin-right: 4px;
}
.primary {
    background: #2563eb;
    color: #e5e7eb;
}
.primary:hover {
    background: #1d4ed8;
}
.success {
    background: #16a34a;
    color: #e5e7eb;
}
.success:hover {
    background: #15803d;
}
.danger {
    background: #dc2626;
    color: #e5e7eb;
    text-decoration: none;
    display: inline-block;
}
.danger:hover {
    background: #b91c1c;
}
.fav-btn {
    background: #eab308;
    color: #020617;
}
.fav-btn:hover {
    background: #facc15;
}

.empty-msg {
    font-size: 13px;
    color: #9ca3af;
    padding: 10px 14px;
}

/* Login */
.login-box {
    width: 320px;
    margin: 120px auto;
    background: #020617;
    border-radius: 12px;
    padding: 20px 20px 18px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.65);
    border: 1px solid #111827;
    text-align: center;
}
.login-box h2 {
    margin-top: 6px;
    margin-bottom: 14px;
    font-size: 18px;
    color: #e5e7eb;
}
.login-box input {
    width: 100%;
    padding: 8px 10px;
    margin: 6px 0;
    border-radius: 8px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    font-size: 14px;
}
.login-box button {
    width: 100%;
    padding: 9px 10px;
    margin-top: 8px;
    border-radius: 8px;
    border: none;
    background: #1d4ed8;
    color: #e5e7eb;
    font-size: 14px;
    cursor: pointer;
}
.login-box button:hover {
    background: #2563eb;
}
.error {
    color: #f87171;
    font-size: 13px;
    margin-top: 8px;
}
.logo {
    width: 50px;
    margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
}
@media (max-width: 700px) {
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .toolbar-right {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .table-header {
        display: none;
    }
    .file-row {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }
}
